marionette-rails 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
|
|
1
1
|
// MarionetteJS (Backbone.Marionette)
|
2
2
|
// ----------------------------------
|
3
|
-
// v1.0.
|
3
|
+
// v1.0.4
|
4
4
|
//
|
5
5
|
// Copyright (c)2013 Derick Bailey, Muted Solutions, LLC.
|
6
6
|
// Distributed under MIT license
|
@@ -19,7 +19,7 @@
|
|
19
19
|
|
20
20
|
// Backbone.BabySitter
|
21
21
|
// -------------------
|
22
|
-
// v0.0.
|
22
|
+
// v0.0.6
|
23
23
|
//
|
24
24
|
// Copyright (c)2013 Derick Bailey, Muted Solutions, LLC.
|
25
25
|
// Distributed under MIT license
|
@@ -37,14 +37,13 @@ Backbone.ChildViewContainer = (function(Backbone, _){
|
|
37
37
|
// Container Constructor
|
38
38
|
// ---------------------
|
39
39
|
|
40
|
-
var Container = function(
|
40
|
+
var Container = function(views){
|
41
41
|
this._views = {};
|
42
42
|
this._indexByModel = {};
|
43
|
-
this._indexByCollection = {};
|
44
43
|
this._indexByCustom = {};
|
45
44
|
this._updateLength();
|
46
45
|
|
47
|
-
this.
|
46
|
+
_.each(views, this.add, this);
|
48
47
|
};
|
49
48
|
|
50
49
|
// Container Methods
|
@@ -54,7 +53,7 @@ Backbone.ChildViewContainer = (function(Backbone, _){
|
|
54
53
|
|
55
54
|
// Add a view to this container. Stores the view
|
56
55
|
// by `cid` and makes it searchable by the model
|
57
|
-
// and
|
56
|
+
// cid (and model itself). Optionally specify
|
58
57
|
// a custom key to store an retrieve the view.
|
59
58
|
add: function(view, customIndex){
|
60
59
|
var viewCid = view.cid;
|
@@ -67,11 +66,6 @@ Backbone.ChildViewContainer = (function(Backbone, _){
|
|
67
66
|
this._indexByModel[view.model.cid] = viewCid;
|
68
67
|
}
|
69
68
|
|
70
|
-
// index it by collection
|
71
|
-
if (view.collection){
|
72
|
-
this._indexByCollection[view.collection.cid] = viewCid;
|
73
|
-
}
|
74
|
-
|
75
69
|
// index by custom
|
76
70
|
if (customIndex){
|
77
71
|
this._indexByCustom[customIndex] = viewCid;
|
@@ -81,18 +75,16 @@ Backbone.ChildViewContainer = (function(Backbone, _){
|
|
81
75
|
},
|
82
76
|
|
83
77
|
// Find a view by the model that was attached to
|
84
|
-
// it. Uses the model's `cid` to find it
|
85
|
-
// retrieves the view by it's `cid` from the result
|
78
|
+
// it. Uses the model's `cid` to find it.
|
86
79
|
findByModel: function(model){
|
87
|
-
|
88
|
-
return this.findByCid(viewCid);
|
80
|
+
return this.findByModelCid(model.cid);
|
89
81
|
},
|
90
82
|
|
91
|
-
// Find a view by the
|
92
|
-
// it. Uses the
|
93
|
-
//
|
94
|
-
|
95
|
-
var viewCid = this.
|
83
|
+
// Find a view by the `cid` of the model that was attached to
|
84
|
+
// it. Uses the model's `cid` to find the view `cid` and
|
85
|
+
// retrieve the view using it.
|
86
|
+
findByModelCid: function(modelCid){
|
87
|
+
var viewCid = this._indexByModel[modelCid];
|
96
88
|
return this.findByCid(viewCid);
|
97
89
|
},
|
98
90
|
|
@@ -122,26 +114,13 @@ Backbone.ChildViewContainer = (function(Backbone, _){
|
|
122
114
|
delete this._indexByModel[view.model.cid];
|
123
115
|
}
|
124
116
|
|
125
|
-
// delete collection index
|
126
|
-
if (view.collection){
|
127
|
-
delete this._indexByCollection[view.collection.cid];
|
128
|
-
}
|
129
|
-
|
130
117
|
// delete custom index
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
if (this._indexByCustom[key] === viewCid){
|
136
|
-
cust = key;
|
137
|
-
break;
|
138
|
-
}
|
118
|
+
_.any(this._indexByCustom, function(cid, key) {
|
119
|
+
if (cid === viewCid) {
|
120
|
+
delete this._indexByCustom[key];
|
121
|
+
return true;
|
139
122
|
}
|
140
|
-
}
|
141
|
-
|
142
|
-
if (cust){
|
143
|
-
delete this._indexByCustom[cust];
|
144
|
-
}
|
123
|
+
}, this);
|
145
124
|
|
146
125
|
// remove the view from the container
|
147
126
|
delete this._views[viewCid];
|
@@ -153,44 +132,24 @@ Backbone.ChildViewContainer = (function(Backbone, _){
|
|
153
132
|
// Call a method on every view in the container,
|
154
133
|
// passing parameters to the call method one at a
|
155
134
|
// time, like `function.call`.
|
156
|
-
call: function(method
|
157
|
-
|
158
|
-
this.apply(method, args);
|
135
|
+
call: function(method){
|
136
|
+
this.apply(method, _.tail(arguments));
|
159
137
|
},
|
160
138
|
|
161
139
|
// Apply a method on every view in the container,
|
162
140
|
// passing parameters to the call method one at a
|
163
141
|
// time, like `function.apply`.
|
164
142
|
apply: function(method, args){
|
165
|
-
|
166
|
-
|
167
|
-
// fix for IE < 9
|
168
|
-
args = args || [];
|
169
|
-
|
170
|
-
_.each(this._views, function(view, key){
|
143
|
+
_.each(this._views, function(view){
|
171
144
|
if (_.isFunction(view[method])){
|
172
|
-
view[method].apply(view, args);
|
145
|
+
view[method].apply(view, args || []);
|
173
146
|
}
|
174
147
|
});
|
175
|
-
|
176
148
|
},
|
177
149
|
|
178
150
|
// Update the `.length` attribute on this container
|
179
151
|
_updateLength: function(){
|
180
152
|
this.length = _.size(this._views);
|
181
|
-
},
|
182
|
-
|
183
|
-
// set up an initial list of views
|
184
|
-
_addInitialViews: function(views){
|
185
|
-
if (!views){ return; }
|
186
|
-
|
187
|
-
var view, i,
|
188
|
-
length = views.length;
|
189
|
-
|
190
|
-
for (i=0; i<length; i++){
|
191
|
-
view = views[i];
|
192
|
-
this.add(view);
|
193
|
-
}
|
194
153
|
}
|
195
154
|
});
|
196
155
|
|
@@ -1418,7 +1377,13 @@ Marionette.View = Backbone.View.extend({
|
|
1418
1377
|
// A single item view implementation that contains code for rendering
|
1419
1378
|
// with underscore.js templates, serializing the view's model or collection,
|
1420
1379
|
// and calling several methods on extended views, such as `onRender`.
|
1421
|
-
Marionette.ItemView =
|
1380
|
+
Marionette.ItemView = Marionette.View.extend({
|
1381
|
+
|
1382
|
+
// Setting up the inheritance chain which allows changes to
|
1383
|
+
// Marionette.View.prototype.constructor which allows overriding
|
1384
|
+
constructor: function(){
|
1385
|
+
Marionette.View.prototype.constructor.apply(this, slice(arguments));
|
1386
|
+
},
|
1422
1387
|
|
1423
1388
|
// Serialize the model or collection for the view. If a model is
|
1424
1389
|
// found, `.toJSON()` is called. If a collection is found, `.toJSON()`
|
@@ -1749,6 +1714,12 @@ Marionette.CollectionView = Marionette.View.extend({
|
|
1749
1714
|
// Extends directly from CollectionView and also renders an
|
1750
1715
|
// an item view as `modelView`, for the top leaf
|
1751
1716
|
Marionette.CompositeView = Marionette.CollectionView.extend({
|
1717
|
+
|
1718
|
+
// Setting up the inheritance chain which allows changes to
|
1719
|
+
// Marionette.CollectionView.prototype.constructor which allows overriding
|
1720
|
+
constructor: function(){
|
1721
|
+
Marionette.CollectionView.prototype.constructor.apply(this, slice(arguments));
|
1722
|
+
},
|
1752
1723
|
|
1753
1724
|
// Configured the initial events that the composite view
|
1754
1725
|
// binds to. Override this method to prevent the initial
|
@@ -1893,7 +1864,7 @@ Marionette.Layout = Marionette.ItemView.extend({
|
|
1893
1864
|
this._firstRender = true;
|
1894
1865
|
this._initializeRegions(options);
|
1895
1866
|
|
1896
|
-
Marionette.ItemView.call(this, options);
|
1867
|
+
Marionette.ItemView.prototype.constructor.call(this, options);
|
1897
1868
|
},
|
1898
1869
|
|
1899
1870
|
// Layout's render will use the existing region objects the
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"lib/backbone.marionette.min.js","sources":["backbone.marionette.js"],"names":["Backbone","ChildViewContainer","_","Container","initialViews","this","_views","_indexByModel","_indexByCollection","_indexByCustom","_updateLength","_addInitialViews","extend","prototype","add","view","customIndex","viewCid","cid","model","collection","findByModel","findByCid","findByCollection","col","findByCustom","index","findByIndex","values","remove","cust","key","hasOwnProperty","call","method","args","Array","slice","arguments","apply","each","isFunction","length","size","views","i","methods","concat","toArray","Wreqr","Marionette","Handlers","options","_wreqrHandlers","initialize","Model","Events","setHandlers","handlers","handler","name","context","isObject","callback","setHandler","config","trigger","hasHandler","getHandler","Error","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","tail","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","compiledTemplate","template","loadTemplate","compileTemplate","html","rawTemplate","Renderer","data","templateFunc","View","bindAll","onShowCalled","getTemplate","mixinTemplateHelpers","templateHelpers","configureTriggers","triggers","triggerEvents","result","e","preventDefault","stopPropagation","delegateEvents","events","_delegateDOMEvents","combinedEvents","undelegateEvents","shouldClose","unbindUIElements","bindUIElements","ui","_uiBindings","keys","ItemView","serializeData","toJSON","items","CollectionView","itemViewEventPrefix","_initChildViewStorage","_initialEvents","addChildView","removeItemView","item","closeEmptyView","getItemView","indexOf","addItemView","children","child","triggerBeforeRender","triggerRendered","_renderChildren","closeChildren","showCollection","showEmptyView","EmptyView","_showingEmptyView","itemView","itemViewOptions","buildItemView","addChildViewEventForwarding","renderItemView","splice","appendHtml","ItemViewType","removeChildView","checkEmpty","collectionView","CompositeView","isRendered","resetItemViewContainer","renderModel","cv","iv","$container","getItemViewContainer","containerView","$itemViewContainer","container","itemViewContainer","Layout","_firstRender","_initializeRegions","_reInitializeRegions","regionManager","_buildRegions","that","_initRegionManager","AppRouter","Router","appRoutes","controller","processAppRoutes","routeNames","reverse","route","bind","Application","_initCallbacks","vent","reqres","submodules","addInitializer","initializer","start","_regionManager","module","unshift","Module","create","moduleName","app","_setupInitializersAndFinalizers","startWithParent","_initializerCallbacks","addFinalizer","_finalizerCallbacks","_isInitialized","mod","stop","addDefinition","moduleDefinition","customArgs","_runModuleDefinition","flatten","moduleNames","moduleDefinitions","parentModule","_getModule","_addModuleDefinition","def","fn","define","startWithParentIsConfigured"],"mappings":"AAkCAA,SAASC,mBAAqB,SAAUD,EAAUE,GAKhD,GAAIC,GAAY,SAASC,GACvBC,KAAKC,UACLD,KAAKE,iBACLF,KAAKG,sBACLH,KAAKI,kBACLJ,KAAKK,gBAELL,KAAKM,iBAAiBP,GAMxBF,GAAEU,OAAOT,EAAUU,WAMjBC,IAAK,SAASC,EAAMC,GAClB,GAAIC,GAAUF,EAAKG,GAGnBb,MAAKC,OAAOW,GAAWF,EAGnBA,EAAKI,QACPd,KAAKE,cAAcQ,EAAKI,MAAMD,KAAOD,GAInCF,EAAKK,aACPf,KAAKG,mBAAmBO,EAAKK,WAAWF,KAAOD,GAI7CD,IACFX,KAAKI,eAAeO,GAAeC,GAGrCZ,KAAKK,iBAMPW,YAAa,SAASF,GACpB,GAAIF,GAAUZ,KAAKE,cAAcY,EAAMD,IACvC,OAAOb,MAAKiB,UAAUL,IAMxBM,iBAAkB,SAASC,GACzB,GAAIP,GAAUZ,KAAKG,mBAAmBgB,EAAIN,IAC1C,OAAOb,MAAKiB,UAAUL,IAIxBQ,aAAc,SAASC,GACrB,GAAIT,GAAUZ,KAAKI,eAAeiB,EAClC,OAAOrB,MAAKiB,UAAUL,IAKx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T,GAAEuC,WAAWyS,IAEfC,EAAKD,EACLjB,GAAkB,GAET/T,EAAE4D,SAASoR,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,EAAazB,eAAe,SAASlQ,GAC/BsQ,EAAOO,iBACTP,EAAOF,MAAMpQ,SAWdF,GACN7C,KAAML,SAAUE"}
|
1
|
+
{"version":3,"file":"lib/backbone.marionette.min.js","sources":["backbone.marionette.js"],"names":["Backbone","ChildViewContainer","_","Container","views","this","_views","_indexByModel","_indexByCustom","_updateLength","each","add","extend","prototype","view","customIndex","viewCid","cid","model","findByModel","findByModelCid","modelCid","findByCid","findByCustom","index","findByIndex","values","remove","any","key","call","method","apply","tail","arguments","args","isFunction","length","size","methods","concat","toArray","Wreqr","Marionette","Handlers","options","_wreqrHandlers","initialize","Model","Events","setHandlers","handlers","handler","name","context","isObject","callback","setHandler","config","trigger","hasHandler","getHandler","Error","Array","slice","removeHandler","removeAllHandlers","CommandStorage","_commands","getCommands","commandName","commands","command","instances","addCommand","push","clearCommands","Commands","storageType","constructor","_initializeStorage","on","_executeCommands","execute","storage","StorageType","RequestResponse","request","EventAggregator","EA","global","protoSlice","throwError","message","error","$","getOption","target","optionName","value","undefined","triggerMethod","getEventName","match","prefix","eventName","toUpperCase","splitter","event","methodName","replace","MonitorDOMRefresh","handleShow","_isShown","triggerDOMRefresh","handleRender","_isRendered","listenTo","bindFromStrings","entity","evt","methodNames","split","bindToFunction","unbindFromStrings","stopListening","unbindToFunction","iterateEvents","bindings","functionCallback","stringCallback","bindEntityEvents","unbindEntityEvents","Callbacks","_deferred","Deferred","_callbacks","contextOverride","cb","ctx","done","run","resolve","reset","callbacks","Controller","close","unbind","Region","el","err","buildRegion","regionConfig","defaultRegionType","regionIsString","regionSelectorIsString","selector","regionTypeIsUndefined","regionType","regionIsType","RegionType","region","parentEl","getEl","find","show","ensureEl","isViewClosed","isClosed","isUndefined","$el","isDifferentView","currentView","render","open","empty","append","attachView","RegionManager","_regions","addRegions","regionDefinitions","defaults","regions","definition","addRegion","isString","hasSelector","_store","get","removeRegion","_remove","removeRegions","closeRegions","_setLength","TemplateCache","templateId","templateCaches","cachedTemplate","load","clear","i","compiledTemplate","template","loadTemplate","compileTemplate","html","rawTemplate","Renderer","data","templateFunc","View","bindAll","onShowCalled","getTemplate","mixinTemplateHelpers","templateHelpers","configureTriggers","triggers","triggerEvents","result","e","preventDefault","stopPropagation","collection","delegateEvents","events","_delegateDOMEvents","combinedEvents","undelegateEvents","shouldClose","unbindUIElements","bindUIElements","ui","_uiBindings","keys","ItemView","serializeData","toJSON","items","CollectionView","itemViewEventPrefix","_initChildViewStorage","_initialEvents","addChildView","removeItemView","item","closeEmptyView","getItemView","indexOf","addItemView","children","child","triggerBeforeRender","triggerRendered","_renderChildren","closeChildren","showCollection","showEmptyView","EmptyView","_showingEmptyView","itemView","itemViewOptions","buildItemView","addChildViewEventForwarding","renderItemView","splice","appendHtml","ItemViewType","removeChildView","checkEmpty","collectionView","CompositeView","isRendered","resetItemViewContainer","renderModel","cv","iv","$container","getItemViewContainer","containerView","$itemViewContainer","container","itemViewContainer","Layout","_firstRender","_initializeRegions","_reInitializeRegions","regionManager","_buildRegions","that","_initRegionManager","AppRouter","Router","appRoutes","controller","processAppRoutes","routeNames","reverse","route","bind","Application","_initCallbacks","vent","reqres","submodules","addInitializer","initializer","start","_regionManager","module","unshift","Module","create","moduleName","app","_setupInitializersAndFinalizers","startWithParent","_initializerCallbacks","addFinalizer","_finalizerCallbacks","_isInitialized","mod","stop","addDefinition","moduleDefinition","customArgs","_runModuleDefinition","flatten","moduleNames","moduleDefinitions","parentModule","_getModule","_addModuleDefinition","def","fn","define","startWithParentIsConfigured"],"mappings":"AAkCAA,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IrF,GAASoS,EAAYpS,OAGrBqS,IAWJ,OAVAA,GAAkBrS,EAAO,GAAKgS,EAG9BnU,EAAEQ,KAAK+T,EAAa,SAASf,EAAYjH,GACvC,GAAIkI,GAAerB,CACnBA,GAASjT,KAAKuU,WAAWD,EAAcjB,EAAYC,GACnDtT,KAAKwU,qBAAqBF,EAAcrB,EAAQoB,EAAkBjI,GAAI6H,IACrEjU,MAGIiT,GAGTsB,WAAY,SAASD,EAAcjB,EAAYC,GAE7C,GAAIL,GAASqB,EAAajB,EAU1B,OARKJ,KAEHA,EAAS,GAAI3Q,GAAW6Q,OAAOE,EAAYC,GAC3CgB,EAAajB,GAAcJ,EAE3BqB,EAAa1B,WAAWS,GAAcJ,GAGjCA,GAGTuB,qBAAsB,SAASF,EAAcrB,EAAQwB,EAAK3S,GACxD,GAAI4S,GACAlB,CAEA3T,GAAEkC,WAAW0S,IAEfC,EAAKD,EACLjB,GAAkB,GAET3T,EAAEqD,SAASuR,IAEpBC,EAAKD,EAAIE,OACTnB,EAAkBiB,EAAIjB,iBAItBA,GAAkB,EAIhBkB,GACFzB,EAAOc,cAAcW,EAAI5S,GAK3BmR,EAAOO,gBAAkBP,EAAOO,iBAAmBA,EAG/CP,EAAOO,kBAAoBP,EAAO2B,8BAGpC3B,EAAO2B,6BAA8B,EAGrCN,EAAazB,eAAe,SAASrQ,GAC/ByQ,EAAOO,iBACTP,EAAOF,MAAMvQ,SAWdF,GACNtC,KAAML,SAAUE"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
// MarionetteJS (Backbone.Marionette)
|
2
2
|
// ----------------------------------
|
3
|
-
// v1.0.
|
3
|
+
// v1.0.4
|
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._indexByCollection={},this._indexByCustom={},this._updateLength(),this._addInitialViews(e)};t.extend(i.prototype,{add:function(e,t){var i=e.cid;this._views[i]=e,e.model&&(this._indexByModel[e.model.cid]=i),e.collection&&(this._indexByCollection[e.collection.cid]=i),t&&(this._indexByCustom[t]=i),this._updateLength()},findByModel:function(e){var t=this._indexByModel[e.cid];return this.findByCid(t)},findByCollection:function(e){var t=this._indexByCollection[e.cid];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 t=e.cid;e.model&&delete this._indexByModel[e.model.cid],e.collection&&delete this._indexByCollection[e.collection.cid];var i;for(var n in this._indexByCustom)if(this._indexByCustom.hasOwnProperty(n)&&this._indexByCustom[n]===t){i=n;break}i&&delete this._indexByCustom[i],delete this._views[t],this._updateLength()},call:function(e,t){t=Array.prototype.slice.call(arguments,1),this.apply(e,t)},apply:function(e,i){i=i||[],t.each(this._views,function(n){t.isFunction(n[e])&&n[e].apply(n,i)})},_updateLength:function(){this.length=t.size(this._views)},_addInitialViews:function(e){if(e){var t,i,n=e.length;for(i=0;n>i;i++)t=e[i],this.add(t)}}});var n=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];return t.each(n,function(e){i.prototype[e]=function(){var i=t.values(this._views),n=[i].concat(t.toArray(arguments));return t[e].apply(t,n)}}),i}(Backbone,_),Backbone.Wreqr=function(e,t,i){"use strict";var n={};return n.Handlers=function(e,t){var i=function(e){this.options=e,this._wreqrHandlers={},t.isFunction(this.initialize)&&this.initialize(e)};return i.extend=e.Model.extend,t.extend(i.prototype,e.Events,{setHandlers:function(e){t.each(e,function(e,i){var n=null;t.isObject(e)&&!t.isFunction(e)&&(n=e.context,e=e.callback),this.setHandler(i,e,n)},this)},setHandler:function(e,t,i){var n={callback:t,context:i};this._wreqrHandlers[e]=n,this.trigger("handler:add",e,t,i)},hasHandler:function(e){return!!this._wreqrHandlers[e]},getHandler:function(e){var t=this._wreqrHandlers[e];if(!t)throw Error("Handler not found for '"+e+"'");return function(){var e=Array.prototype.slice.apply(arguments);return t.callback.apply(t.context,e)}},removeHandler:function(e){delete this._wreqrHandlers[e]},removeAllHandlers:function(){this._wreqrHandlers={}}}),i}(e,i),n.CommandStorage=function(){var t=function(e){this.options=e,this._commands={},i.isFunction(this.initialize)&&this.initialize(e)};return i.extend(t.prototype,e.Events,{getCommands:function(e){var t=this._commands[e];return t||(t={command:e,instances:[]},this._commands[e]=t),t},addCommand:function(e,t){var i=this.getCommands(e);i.instances.push(t)},clearCommands:function(e){var t=this.getCommands(e);t.instances=[]}}),t}(),n.Commands=function(e){return e.Handlers.extend({storageType:e.CommandStorage,constructor:function(t){this.options=t||{},this._initializeStorage(this.options),this.on("handler:add",this._executeCommands,this);var i=Array.prototype.slice.call(arguments);e.Handlers.prototype.constructor.apply(this,i)},execute:function(e,t){e=arguments[0],t=Array.prototype.slice.call(arguments,1),this.hasHandler(e)?this.getHandler(e).apply(this,t):this.storage.addCommand(e,t)},_executeCommands:function(e,t,n){var r=this.storage.getCommands(e);i.each(r.instances,function(e){t.apply(n,e)}),this.storage.clearCommands(e)},_initializeStorage:function(e){var t,n=e.storageType||this.storageType;t=i.isFunction(n)?new n:n,this.storage=t}})}(n),n.RequestResponse=function(e){return e.Handlers.extend({request:function(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);return this.getHandler(e).apply(this,t)}})}(n),n.EventAggregator=function(e,t){var i=function(){};return i.extend=e.Model.extend,t.extend(i.prototype,e.Events),i}(e,i),n}(Backbone,Backbone.Marionette,_);var Marionette=function(e,t,i){"use strict";function n(e){return s.call(e)}function r(e,t){var i=Error(e);throw i.name=t||"Error",i}var o={};t.Marionette=o,o.$=t.$;var s=Array.prototype.slice;return o.extend=t.Model.extend,o.getOption=function(e,t){if(e&&t){var i;return i=e.options&&t in e.options&&void 0!==e.options[t]?e.options[t]:e[t]}},o.triggerMethod=function(){function e(e,t,i){return i.toUpperCase()}var t=/(^|:)(\w)/gi,n=function(n){var r="on"+n.replace(t,e),o=this[r];return this.trigger.apply(this,arguments),i.isFunction(o)?o.apply(this,i.tail(arguments)):void 0};return n}(),o.MonitorDOMRefresh=function(){function e(e){e._isShown=!0,n(e)}function t(e){e._isRendered=!0,n(e)}function n(e){e._isShown&&e._isRendered&&i.isFunction(e.triggerMethod)&&e.triggerMethod("dom:refresh")}return function(i){i.listenTo(i,"show",function(){e(i)}),i.listenTo(i,"render",function(){t(i)})}}(),function(e){function t(e,t,n,o){var s=o.split(/\s+/);i.each(s,function(i){var o=e[i];o||r("Method '"+i+"' was configured as an event handler, but does not exist."),e.listenTo(t,n,o,e)})}function n(e,t,i,n){e.listenTo(t,i,n,e)}function o(e,t,n,r){var o=r.split(/\s+/);i.each(o,function(i){var r=e[i];e.stopListening(t,n,r,e)})}function s(e,t,i,n){e.stopListening(t,i,n,e)}function h(e,t,n,r,o){t&&n&&(i.isFunction(n)&&(n=n.call(e)),i.each(n,function(n,s){i.isFunction(n)?r(e,t,s,n):o(e,t,s,n)}))}e.bindEntityEvents=function(e,i,r){h(e,i,r,n,t)},e.unbindEntityEvents=function(e,t,i){h(e,t,i,s,o)}}(o),o.Callbacks=function(){this._deferred=o.$.Deferred(),this._callbacks=[]},i.extend(o.Callbacks.prototype,{add:function(e,t){this._callbacks.push({cb:e,ctx:t}),this._deferred.done(function(i,n){t&&(i=t),e.call(i,n)})},run:function(e,t){this._deferred.resolve(t,e)},reset:function(){var e=this._callbacks;this._deferred=o.$.Deferred(),this._callbacks=[],i.each(e,function(e){this.add(e.cb,e.ctx)},this)}}),o.Controller=function(e){this.triggerMethod=o.triggerMethod,this.options=e||{},i.isFunction(this.initialize)&&this.initialize(this.options)},o.Controller.extend=o.extend,i.extend(o.Controller.prototype,t.Events,{close:function(){this.stopListening(),this.triggerMethod("close"),this.unbind()}}),o.Region=function(e){if(this.options=e||{},this.el=o.getOption(this,"el"),!this.el){var t=Error("An 'el' must be specified for a region.");throw t.name="NoElError",t}if(this.initialize){var i=Array.prototype.slice.apply(arguments);this.initialize.apply(this,i)}},i.extend(o.Region,{buildRegion:function(e,t){var n="string"==typeof e,r="string"==typeof e.selector,o=e.regionType===void 0,s="function"==typeof e;if(!s&&!n&&!r)throw Error("Region must be specified as a Region type, a selector string or an object with selector property");var h,a;n&&(h=e),e.selector&&(h=e.selector),s&&(a=e),!s&&o&&(a=t),e.regionType&&(a=e.regionType);var l=new a({el:h});return e.parentEl&&(l.getEl=function(t){var n=e.parentEl;return i.isFunction(n)&&(n=n()),n.find(t)}),l}}),i.extend(o.Region.prototype,t.Events,{show:function(e){this.ensureEl();var t=e.isClosed||i.isUndefined(e.$el),n=e!==this.currentView;n&&this.close(),e.render(),(n||t)&&this.open(e),this.currentView=e,o.triggerMethod.call(this,"show",e),o.triggerMethod.call(e,"show")},ensureEl:function(){this.$el&&0!==this.$el.length||(this.$el=this.getEl(this.el))},getEl:function(e){return o.$(e)},open:function(e){this.$el.empty().append(e.el)},close:function(){var e=this.currentView;e&&!e.isClosed&&(e.close?e.close():e.remove&&e.remove(),o.triggerMethod.call(this,"close"),delete this.currentView)},attachView:function(e){this.currentView=e},reset:function(){this.close(),delete this.$el}}),o.Region.extend=o.extend,o.RegionManager=function(e){var t=e.Controller.extend({constructor:function(t){this._regions={},e.Controller.prototype.constructor.call(this,t)},addRegions:function(e,t){var n={};return i.each(e,function(e,r){"string"==typeof e&&(e={selector:e}),e.selector&&(e=i.defaults({},e,t));var o=this.addRegion(r,e);n[r]=o},this),n},addRegion:function(t,n){var r,o=i.isObject(n),s=i.isString(n),h=!!n.selector;return r=s||o&&h?e.Region.buildRegion(n,e.Region):i.isFunction(n)?e.Region.buildRegion(n,e.Region):n,this._store(t,r),this.triggerMethod("region:add",t,r),r},get:function(e){return this._regions[e]},removeRegion:function(e){var t=this._regions[e];this._remove(e,t)},removeRegions:function(){i.each(this._regions,function(e,t){this._remove(t,e)},this)},closeRegions:function(){i.each(this._regions,function(e){e.close()},this)},close:function(){this.removeRegions();var t=Array.prototype.slice.call(arguments);e.Controller.prototype.close.apply(this,t)},_store:function(e,t){this._regions[e]=t,this._setLength()},_remove:function(e,t){t.close(),delete this._regions[e],this._setLength(),this.triggerMethod("region:remove",e,t)},_setLength:function(){this.length=i.size(this._regions)}}),n=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];return i.each(n,function(e){t.prototype[e]=function(){var t=i.values(this._regions),n=[t].concat(i.toArray(arguments));return i[e].apply(i,n)}}),t}(o),o.TemplateCache=function(e){this.templateId=e},i.extend(o.TemplateCache,{templateCaches:{},get:function(e){var t=this.templateCaches[e];return t||(t=new o.TemplateCache(e),this.templateCaches[e]=t),t.load()},clear:function(){var e,t=n(arguments),i=t.length;if(i>0)for(e=0;i>e;e++)delete this.templateCaches[t[e]];else this.templateCaches={}}}),i.extend(o.TemplateCache.prototype,{load:function(){if(this.compiledTemplate)return this.compiledTemplate;var e=this.loadTemplate(this.templateId);return this.compiledTemplate=this.compileTemplate(e),this.compiledTemplate},loadTemplate:function(e){var t=o.$(e).html();return t&&0!==t.length||r("Could not find template: '"+e+"'","NoTemplateError"),t},compileTemplate:function(e){return i.template(e)}}),o.Renderer={render:function(e,t){if(!e){var i=Error("Cannot render the template since it's false, null or undefined.");throw i.name="TemplateNotFoundError",i}var n;return n="function"==typeof e?e:o.TemplateCache.get(e),n(t)}},o.View=t.View.extend({constructor:function(){i.bindAll(this,"render");var e=Array.prototype.slice.apply(arguments);t.View.prototype.constructor.apply(this,e),o.MonitorDOMRefresh(this),this.listenTo(this,"show",this.onShowCalled,this)},triggerMethod:o.triggerMethod,getTemplate:function(){return o.getOption(this,"template")},mixinTemplateHelpers:function(e){e=e||{};var t=this.templateHelpers;return i.isFunction(t)&&(t=t.call(this)),i.extend(e,t)},configureTriggers:function(){if(this.triggers){var e={},t=i.result(this,"triggers");return i.each(t,function(t,i){e[i]=function(e){e&&e.preventDefault&&e.preventDefault(),e&&e.stopPropagation&&e.stopPropagation();var i={view:this,model:this.model,collection:this.collection};this.triggerMethod(t,i)}},this),e}},delegateEvents:function(e){this._delegateDOMEvents(e),o.bindEntityEvents(this,this.model,o.getOption(this,"modelEvents")),o.bindEntityEvents(this,this.collection,o.getOption(this,"collectionEvents"))},_delegateDOMEvents:function(e){e=e||this.events,i.isFunction(e)&&(e=e.call(this));var n={},r=this.configureTriggers();i.extend(n,e,r),t.View.prototype.delegateEvents.call(this,n)},undelegateEvents:function(){var e=Array.prototype.slice.call(arguments);t.View.prototype.undelegateEvents.apply(this,e),o.unbindEntityEvents(this,this.model,o.getOption(this,"modelEvents")),o.unbindEntityEvents(this,this.collection,o.getOption(this,"collectionEvents"))},onShowCalled:function(){},close:function(){if(!this.isClosed){var e=this.triggerMethod("before:close");e!==!1&&(this.isClosed=!0,this.triggerMethod("close"),this.unbindUIElements(),this.remove())}},bindUIElements:function(){if(this.ui){this._uiBindings||(this._uiBindings=this.ui);var e=i.result(this,"_uiBindings");this.ui={},i.each(i.keys(e),function(t){var i=e[t];this.ui[t]=this.$(i)},this)}},unbindUIElements:function(){this.ui&&(i.each(this.ui,function(e,t){delete this.ui[t]},this),this.ui=this._uiBindings,delete this._uiBindings)}}),o.ItemView=o.View.extend({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({_initialEvents:function(){this.collection&&(this.listenTo(this.collection,"add",this.addChildView,this),this.listenTo(this.collection,"remove",this.removeItemView,this),this.listenTo(this.collection,"reset",this._renderChildren,this))},getItemView:function(){var e=o.getOption(this,"itemView")||this.constructor;return e||r("An `itemView` must be specified","NoItemViewError"),e},serializeData:function(){var e={};return this.model&&(e=this.model.toJSON()),e},render:function(){this.isRendered=!0,this.isClosed=!1,this.resetItemViewContainer(),this.triggerBeforeRender();var e=this.renderModel();return this.$el.html(e),this.bindUIElements(),this.triggerMethod("composite:model:rendered"),this._renderChildren(),this.triggerMethod("composite:rendered"),this.triggerRendered(),this},_renderChildren:function(){this.isRendered&&(o.CollectionView.prototype._renderChildren.call(this),this.triggerMethod("composite:collection:rendered"))},renderModel:function(){var e={};e=this.serializeData(),e=this.mixinTemplateHelpers(e);var t=this.getTemplate();return o.Renderer.render(t,e)},appendHtml:function(e,t){var i=this.getItemViewContainer(e);i.append(t.el)},getItemViewContainer:function(e){if("$itemViewContainer"in e)return e.$itemViewContainer;var t;if(e.itemViewContainer){var n=i.result(e,"itemViewContainer");t=e.$(n),0>=t.length&&r("The specified `itemViewContainer` was not found: "+e.itemViewContainer,"ItemViewContainerMissingError")}else t=e.$el;return e.$itemViewContainer=t,t},resetItemViewContainer:function(){this.$itemViewContainer&&delete this.$itemViewContainer}}),o.Layout=o.ItemView.extend({regionType:o.Region,constructor:function(e){e=e||{},this._firstRender=!0,this._initializeRegions(e),o.ItemView.call(this,e)},render:function(){this._firstRender?this._firstRender=!1:this.isClosed?this._initializeRegions():this._reInitializeRegions();var e=Array.prototype.slice.apply(arguments),t=o.ItemView.prototype.render.apply(this,e);return t},close:function(){if(!this.isClosed){this.regionManager.close();var e=Array.prototype.slice.apply(arguments);o.ItemView.prototype.close.apply(this,e)}},addRegion:function(e,t){var i={};return i[e]=t,this.addRegions(i)[e]},addRegions:function(e){return this.regions=i.extend(this.regions||{},e),this._buildRegions(e)},removeRegion:function(e){return this.regionManager.removeRegion(e)},_buildRegions:function(e){var t=this,i={parentEl:function(){return t.$el}};return this.regionManager.addRegions(e,i)},_initializeRegions:function(e){var t;this._initRegionManager(),t=i.isFunction(this.regions)?this.regions(e):this.regions||{},this.addRegions(t)},_reInitializeRegions:function(){this.regionManager.closeRegions(),this.regionManager.each(function(e){e.reset()})},_initRegionManager:function(){this.regionManager=new o.RegionManager,this.listenTo(this.regionManager,"region:add",function(e,t){this[e]=t,this.trigger("region:add",e,t)}),this.listenTo(this.regionManager,"region:remove",function(e,t){delete this[e],this.trigger("region:remove",e,t)})}}),o.AppRouter=t.Router.extend({constructor:function(e){if(t.Router.prototype.constructor.apply(this,n(arguments)),this.options=e,this.appRoutes){var i=o.getOption(this,"controller");this.processAppRoutes(i,this.appRoutes)}},processAppRoutes:function(e,t){var n=i.keys(t).reverse();i.each(n,function(n){var r=t[n],o=e[r];if(!o)throw Error("Method '"+r+"' was not found on the controller");this.route(n,r,i.bind(o,e))},this)}}),o.Application=function(e){this._initRegionManager(),this._initCallbacks=new o.Callbacks,this.vent=new t.Wreqr.EventAggregator,this.commands=new t.Wreqr.Commands,this.reqres=new t.Wreqr.RequestResponse,this.submodules={},i.extend(this,e),this.triggerMethod=o.triggerMethod},i.extend(o.Application.prototype,t.Events,{execute:function(){var e=Array.prototype.slice.apply(arguments);this.commands.execute.apply(this.commands,e)},request:function(){var e=Array.prototype.slice.apply(arguments);return this.reqres.request.apply(this.reqres,e)},addInitializer:function(e){this._initCallbacks.add(e)},start:function(e){this.triggerMethod("initialize:before",e),this._initCallbacks.run(e,this),this.triggerMethod("initialize:after",e),this.triggerMethod("start",e)},addRegions:function(e){return this._regionManager.addRegions(e)},removeRegion:function(e){this._regionManager.removeRegion(e)},module:function(){var e=n(arguments);return e.unshift(this),o.Module.create.apply(o.Module,e)},_initRegionManager:function(){this._regionManager=new o.RegionManager,this.listenTo(this._regionManager,"region:add",function(e,t){this[e]=t}),this.listenTo(this._regionManager,"region:remove",function(e){delete this[e]})}}),o.Application.extend=o.extend,o.Module=function(e,t){this.moduleName=e,this.submodules={},this._setupInitializersAndFinalizers(),this.app=t,this.startWithParent=!0,this.triggerMethod=o.triggerMethod},i.extend(o.Module.prototype,t.Events,{addInitializer:function(e){this._initializerCallbacks.add(e)},addFinalizer:function(e){this._finalizerCallbacks.add(e)},start:function(e){this._isInitialized||(i.each(this.submodules,function(t){t.startWithParent&&t.start(e)}),this.triggerMethod("before:start",e),this._initializerCallbacks.run(e,this),this._isInitialized=!0,this.triggerMethod("start",e))},stop:function(){this._isInitialized&&(this._isInitialized=!1,o.triggerMethod.call(this,"before:stop"),i.each(this.submodules,function(e){e.stop()}),this._finalizerCallbacks.run(void 0,this),this._initializerCallbacks.reset(),this._finalizerCallbacks.reset(),o.triggerMethod.call(this,"stop"))},addDefinition:function(e,t){this._runModuleDefinition(e,t)},_runModuleDefinition:function(e,n){if(e){var r=i.flatten([this,this.app,t,o,o.$,i,n]);e.apply(this,r)}},_setupInitializersAndFinalizers:function(){this._initializerCallbacks=new o.Callbacks,this._finalizerCallbacks=new o.Callbacks}}),i.extend(o.Module,{create:function(e,t,r){var o=e,s=n(arguments);s.splice(0,3),t=t.split(".");var h=t.length,a=[];return a[h-1]=r,i.each(t,function(t,i){var n=o;o=this._getModule(n,t,e),this._addModuleDefinition(n,o,a[i],s)},this),o},_getModule:function(e,t,i){var n=e[t];return n||(n=new o.Module(t,i),e[t]=n,e.submodules[t]=n),n},_addModuleDefinition:function(e,t,n,r){var o,s;i.isFunction(n)?(o=n,s=!0):i.isObject(n)?(o=n.define,s=n.startWithParent):s=!0,o&&t.addDefinition(o,r),t.startWithParent=t.startWithParent&&s,t.startWithParent&&!t.startWithParentIsConfigured&&(t.startWithParentIsConfigured=!0,e.addInitializer(function(e){t.startWithParent&&t.start(e)}))}}),o}(this,Backbone,_);
|
20
|
+
Backbone.ChildViewContainer=function(e,t){var i=function(e){this._views={},this._indexByModel={},this._indexByCustom={},this._updateLength(),t.each(e,this.add,this)};t.extend(i.prototype,{add:function(e,t){var i=e.cid;this._views[i]=e,e.model&&(this._indexByModel[e.model.cid]=i),t&&(this._indexByCustom[t]=i),this._updateLength()},findByModel:function(e){return this.findByModelCid(e.cid)},findByModelCid:function(e){var t=this._indexByModel[e];return this.findByCid(t)},findByCustom:function(e){var t=this._indexByCustom[e];return this.findByCid(t)},findByIndex:function(e){return t.values(this._views)[e]},findByCid:function(e){return this._views[e]},remove:function(e){var i=e.cid;e.model&&delete this._indexByModel[e.model.cid],t.any(this._indexByCustom,function(e,t){return e===i?(delete this._indexByCustom[t],!0):void 0},this),delete this._views[i],this._updateLength()},call:function(e){this.apply(e,t.tail(arguments))},apply:function(e,i){t.each(this._views,function(n){t.isFunction(n[e])&&n[e].apply(n,i||[])})},_updateLength:function(){this.length=t.size(this._views)}});var n=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];return t.each(n,function(e){i.prototype[e]=function(){var i=t.values(this._views),n=[i].concat(t.toArray(arguments));return t[e].apply(t,n)}}),i}(Backbone,_),Backbone.Wreqr=function(e,t,i){"use strict";var n={};return n.Handlers=function(e,t){var i=function(e){this.options=e,this._wreqrHandlers={},t.isFunction(this.initialize)&&this.initialize(e)};return i.extend=e.Model.extend,t.extend(i.prototype,e.Events,{setHandlers:function(e){t.each(e,function(e,i){var n=null;t.isObject(e)&&!t.isFunction(e)&&(n=e.context,e=e.callback),this.setHandler(i,e,n)},this)},setHandler:function(e,t,i){var n={callback:t,context:i};this._wreqrHandlers[e]=n,this.trigger("handler:add",e,t,i)},hasHandler:function(e){return!!this._wreqrHandlers[e]},getHandler:function(e){var t=this._wreqrHandlers[e];if(!t)throw Error("Handler not found for '"+e+"'");return function(){var e=Array.prototype.slice.apply(arguments);return t.callback.apply(t.context,e)}},removeHandler:function(e){delete this._wreqrHandlers[e]},removeAllHandlers:function(){this._wreqrHandlers={}}}),i}(e,i),n.CommandStorage=function(){var t=function(e){this.options=e,this._commands={},i.isFunction(this.initialize)&&this.initialize(e)};return i.extend(t.prototype,e.Events,{getCommands:function(e){var t=this._commands[e];return t||(t={command:e,instances:[]},this._commands[e]=t),t},addCommand:function(e,t){var i=this.getCommands(e);i.instances.push(t)},clearCommands:function(e){var t=this.getCommands(e);t.instances=[]}}),t}(),n.Commands=function(e){return e.Handlers.extend({storageType:e.CommandStorage,constructor:function(t){this.options=t||{},this._initializeStorage(this.options),this.on("handler:add",this._executeCommands,this);var i=Array.prototype.slice.call(arguments);e.Handlers.prototype.constructor.apply(this,i)},execute:function(e,t){e=arguments[0],t=Array.prototype.slice.call(arguments,1),this.hasHandler(e)?this.getHandler(e).apply(this,t):this.storage.addCommand(e,t)},_executeCommands:function(e,t,n){var r=this.storage.getCommands(e);i.each(r.instances,function(e){t.apply(n,e)}),this.storage.clearCommands(e)},_initializeStorage:function(e){var t,n=e.storageType||this.storageType;t=i.isFunction(n)?new n:n,this.storage=t}})}(n),n.RequestResponse=function(e){return e.Handlers.extend({request:function(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);return this.getHandler(e).apply(this,t)}})}(n),n.EventAggregator=function(e,t){var i=function(){};return i.extend=e.Model.extend,t.extend(i.prototype,e.Events),i}(e,i),n}(Backbone,Backbone.Marionette,_);var Marionette=function(e,t,i){"use strict";function n(e){return s.call(e)}function r(e,t){var i=Error(e);throw i.name=t||"Error",i}var o={};t.Marionette=o,o.$=t.$;var s=Array.prototype.slice;return o.extend=t.Model.extend,o.getOption=function(e,t){if(e&&t){var i;return i=e.options&&t in e.options&&void 0!==e.options[t]?e.options[t]:e[t]}},o.triggerMethod=function(){function e(e,t,i){return i.toUpperCase()}var t=/(^|:)(\w)/gi,n=function(n){var r="on"+n.replace(t,e),o=this[r];return this.trigger.apply(this,arguments),i.isFunction(o)?o.apply(this,i.tail(arguments)):void 0};return n}(),o.MonitorDOMRefresh=function(){function e(e){e._isShown=!0,n(e)}function t(e){e._isRendered=!0,n(e)}function n(e){e._isShown&&e._isRendered&&i.isFunction(e.triggerMethod)&&e.triggerMethod("dom:refresh")}return function(i){i.listenTo(i,"show",function(){e(i)}),i.listenTo(i,"render",function(){t(i)})}}(),function(e){function t(e,t,n,o){var s=o.split(/\s+/);i.each(s,function(i){var o=e[i];o||r("Method '"+i+"' was configured as an event handler, but does not exist."),e.listenTo(t,n,o,e)})}function n(e,t,i,n){e.listenTo(t,i,n,e)}function o(e,t,n,r){var o=r.split(/\s+/);i.each(o,function(i){var r=e[i];e.stopListening(t,n,r,e)})}function s(e,t,i,n){e.stopListening(t,i,n,e)}function h(e,t,n,r,o){t&&n&&(i.isFunction(n)&&(n=n.call(e)),i.each(n,function(n,s){i.isFunction(n)?r(e,t,s,n):o(e,t,s,n)}))}e.bindEntityEvents=function(e,i,r){h(e,i,r,n,t)},e.unbindEntityEvents=function(e,t,i){h(e,t,i,s,o)}}(o),o.Callbacks=function(){this._deferred=o.$.Deferred(),this._callbacks=[]},i.extend(o.Callbacks.prototype,{add:function(e,t){this._callbacks.push({cb:e,ctx:t}),this._deferred.done(function(i,n){t&&(i=t),e.call(i,n)})},run:function(e,t){this._deferred.resolve(t,e)},reset:function(){var e=this._callbacks;this._deferred=o.$.Deferred(),this._callbacks=[],i.each(e,function(e){this.add(e.cb,e.ctx)},this)}}),o.Controller=function(e){this.triggerMethod=o.triggerMethod,this.options=e||{},i.isFunction(this.initialize)&&this.initialize(this.options)},o.Controller.extend=o.extend,i.extend(o.Controller.prototype,t.Events,{close:function(){this.stopListening(),this.triggerMethod("close"),this.unbind()}}),o.Region=function(e){if(this.options=e||{},this.el=o.getOption(this,"el"),!this.el){var t=Error("An 'el' must be specified for a region.");throw t.name="NoElError",t}if(this.initialize){var i=Array.prototype.slice.apply(arguments);this.initialize.apply(this,i)}},i.extend(o.Region,{buildRegion:function(e,t){var n="string"==typeof e,r="string"==typeof e.selector,o=e.regionType===void 0,s="function"==typeof e;if(!s&&!n&&!r)throw Error("Region must be specified as a Region type, a selector string or an object with selector property");var h,a;n&&(h=e),e.selector&&(h=e.selector),s&&(a=e),!s&&o&&(a=t),e.regionType&&(a=e.regionType);var l=new a({el:h});return e.parentEl&&(l.getEl=function(t){var n=e.parentEl;return i.isFunction(n)&&(n=n()),n.find(t)}),l}}),i.extend(o.Region.prototype,t.Events,{show:function(e){this.ensureEl();var t=e.isClosed||i.isUndefined(e.$el),n=e!==this.currentView;n&&this.close(),e.render(),(n||t)&&this.open(e),this.currentView=e,o.triggerMethod.call(this,"show",e),o.triggerMethod.call(e,"show")},ensureEl:function(){this.$el&&0!==this.$el.length||(this.$el=this.getEl(this.el))},getEl:function(e){return o.$(e)},open:function(e){this.$el.empty().append(e.el)},close:function(){var e=this.currentView;e&&!e.isClosed&&(e.close?e.close():e.remove&&e.remove(),o.triggerMethod.call(this,"close"),delete this.currentView)},attachView:function(e){this.currentView=e},reset:function(){this.close(),delete this.$el}}),o.Region.extend=o.extend,o.RegionManager=function(e){var t=e.Controller.extend({constructor:function(t){this._regions={},e.Controller.prototype.constructor.call(this,t)},addRegions:function(e,t){var n={};return i.each(e,function(e,r){"string"==typeof e&&(e={selector:e}),e.selector&&(e=i.defaults({},e,t));var o=this.addRegion(r,e);n[r]=o},this),n},addRegion:function(t,n){var r,o=i.isObject(n),s=i.isString(n),h=!!n.selector;return r=s||o&&h?e.Region.buildRegion(n,e.Region):i.isFunction(n)?e.Region.buildRegion(n,e.Region):n,this._store(t,r),this.triggerMethod("region:add",t,r),r},get:function(e){return this._regions[e]},removeRegion:function(e){var t=this._regions[e];this._remove(e,t)},removeRegions:function(){i.each(this._regions,function(e,t){this._remove(t,e)},this)},closeRegions:function(){i.each(this._regions,function(e){e.close()},this)},close:function(){this.removeRegions();var t=Array.prototype.slice.call(arguments);e.Controller.prototype.close.apply(this,t)},_store:function(e,t){this._regions[e]=t,this._setLength()},_remove:function(e,t){t.close(),delete this._regions[e],this._setLength(),this.triggerMethod("region:remove",e,t)},_setLength:function(){this.length=i.size(this._regions)}}),n=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];return i.each(n,function(e){t.prototype[e]=function(){var t=i.values(this._regions),n=[t].concat(i.toArray(arguments));return i[e].apply(i,n)}}),t}(o),o.TemplateCache=function(e){this.templateId=e},i.extend(o.TemplateCache,{templateCaches:{},get:function(e){var t=this.templateCaches[e];return t||(t=new o.TemplateCache(e),this.templateCaches[e]=t),t.load()},clear:function(){var e,t=n(arguments),i=t.length;if(i>0)for(e=0;i>e;e++)delete this.templateCaches[t[e]];else this.templateCaches={}}}),i.extend(o.TemplateCache.prototype,{load:function(){if(this.compiledTemplate)return this.compiledTemplate;var e=this.loadTemplate(this.templateId);return this.compiledTemplate=this.compileTemplate(e),this.compiledTemplate},loadTemplate:function(e){var t=o.$(e).html();return t&&0!==t.length||r("Could not find template: '"+e+"'","NoTemplateError"),t},compileTemplate:function(e){return i.template(e)}}),o.Renderer={render:function(e,t){if(!e){var i=Error("Cannot render the template since it's false, null or undefined.");throw i.name="TemplateNotFoundError",i}var n;return n="function"==typeof e?e:o.TemplateCache.get(e),n(t)}},o.View=t.View.extend({constructor:function(){i.bindAll(this,"render");var e=Array.prototype.slice.apply(arguments);t.View.prototype.constructor.apply(this,e),o.MonitorDOMRefresh(this),this.listenTo(this,"show",this.onShowCalled,this)},triggerMethod:o.triggerMethod,getTemplate:function(){return o.getOption(this,"template")},mixinTemplateHelpers:function(e){e=e||{};var t=this.templateHelpers;return i.isFunction(t)&&(t=t.call(this)),i.extend(e,t)},configureTriggers:function(){if(this.triggers){var e={},t=i.result(this,"triggers");return i.each(t,function(t,i){e[i]=function(e){e&&e.preventDefault&&e.preventDefault(),e&&e.stopPropagation&&e.stopPropagation();var i={view:this,model:this.model,collection:this.collection};this.triggerMethod(t,i)}},this),e}},delegateEvents:function(e){this._delegateDOMEvents(e),o.bindEntityEvents(this,this.model,o.getOption(this,"modelEvents")),o.bindEntityEvents(this,this.collection,o.getOption(this,"collectionEvents"))},_delegateDOMEvents:function(e){e=e||this.events,i.isFunction(e)&&(e=e.call(this));var n={},r=this.configureTriggers();i.extend(n,e,r),t.View.prototype.delegateEvents.call(this,n)},undelegateEvents:function(){var e=Array.prototype.slice.call(arguments);t.View.prototype.undelegateEvents.apply(this,e),o.unbindEntityEvents(this,this.model,o.getOption(this,"modelEvents")),o.unbindEntityEvents(this,this.collection,o.getOption(this,"collectionEvents"))},onShowCalled:function(){},close:function(){if(!this.isClosed){var e=this.triggerMethod("before:close");e!==!1&&(this.isClosed=!0,this.triggerMethod("close"),this.unbindUIElements(),this.remove())}},bindUIElements:function(){if(this.ui){this._uiBindings||(this._uiBindings=this.ui);var e=i.result(this,"_uiBindings");this.ui={},i.each(i.keys(e),function(t){var i=e[t];this.ui[t]=this.$(i)},this)}},unbindUIElements:function(){this.ui&&(i.each(this.ui,function(e,t){delete this.ui[t]},this),this.ui=this._uiBindings,delete this._uiBindings)}}),o.ItemView=o.View.extend({constructor:function(){o.View.prototype.constructor.apply(this,n(arguments))},serializeData:function(){var e={};return this.model?e=this.model.toJSON():this.collection&&(e={items:this.collection.toJSON()}),e},render:function(){this.isClosed=!1,this.triggerMethod("before:render",this),this.triggerMethod("item:before:render",this);var e=this.serializeData();e=this.mixinTemplateHelpers(e);var t=this.getTemplate(),i=o.Renderer.render(t,e);return this.$el.html(i),this.bindUIElements(),this.triggerMethod("render",this),this.triggerMethod("item:rendered",this),this},close:function(){this.isClosed||(this.triggerMethod("item:before:close"),o.View.prototype.close.apply(this,n(arguments)),this.triggerMethod("item:closed"))}}),o.CollectionView=o.View.extend({itemViewEventPrefix:"itemview",constructor:function(){this._initChildViewStorage(),o.View.prototype.constructor.apply(this,n(arguments)),this._initialEvents()},_initialEvents:function(){this.collection&&(this.listenTo(this.collection,"add",this.addChildView,this),this.listenTo(this.collection,"remove",this.removeItemView,this),this.listenTo(this.collection,"reset",this.render,this))},addChildView:function(e){this.closeEmptyView();var t=this.getItemView(e),i=this.collection.indexOf(e);this.addItemView(e,t,i)},onShowCalled:function(){this.children.each(function(e){o.triggerMethod.call(e,"show")})},triggerBeforeRender:function(){this.triggerMethod("before:render",this),this.triggerMethod("collection:before:render",this)},triggerRendered:function(){this.triggerMethod("render",this),this.triggerMethod("collection:rendered",this)},render:function(){return this.isClosed=!1,this.triggerBeforeRender(),this._renderChildren(),this.triggerRendered(),this},_renderChildren:function(){this.closeEmptyView(),this.closeChildren(),this.collection&&this.collection.length>0?this.showCollection():this.showEmptyView()},showCollection:function(){var e;this.collection.each(function(t,i){e=this.getItemView(t),this.addItemView(t,e,i)},this)},showEmptyView:function(){var e=o.getOption(this,"emptyView");if(e&&!this._showingEmptyView){this._showingEmptyView=!0;var i=new t.Model;this.addItemView(i,e,0)}},closeEmptyView:function(){this._showingEmptyView&&(this.closeChildren(),delete this._showingEmptyView)},getItemView:function(){var e=o.getOption(this,"itemView");return e||r("An `itemView` must be specified","NoItemViewError"),e},addItemView:function(e,t,n){var r=o.getOption(this,"itemViewOptions");i.isFunction(r)&&(r=r.call(this,e,n));var s=this.buildItemView(e,t,r);this.addChildViewEventForwarding(s),this.triggerMethod("before:item:added",s),this.children.add(s),this.renderItemView(s,n),this._isShown&&o.triggerMethod.call(s,"show"),this.triggerMethod("after:item:added",s)},addChildViewEventForwarding:function(e){var t=o.getOption(this,"itemViewEventPrefix");this.listenTo(e,"all",function(){var i=n(arguments);i[0]=t+":"+i[0],i.splice(1,0,e),o.triggerMethod.apply(this,i)},this)},renderItemView:function(e,t){e.render(),this.appendHtml(this,e,t)},buildItemView:function(e,t,n){var r=i.extend({model:e},n);return new t(r)},removeItemView:function(e){var t=this.children.findByModel(e);this.removeChildView(t),this.checkEmpty()},removeChildView:function(e){e&&(this.stopListening(e),e.close?e.close():e.remove&&e.remove(),this.children.remove(e)),this.triggerMethod("item:removed",e)},checkEmpty:function(){this.collection&&0!==this.collection.length||this.showEmptyView()},appendHtml:function(e,t){e.$el.append(t.el)},_initChildViewStorage:function(){this.children=new t.ChildViewContainer},close:function(){this.isClosed||(this.triggerMethod("collection:before:close"),this.closeChildren(),this.triggerMethod("collection:closed"),o.View.prototype.close.apply(this,n(arguments)))},closeChildren:function(){this.children.each(function(e){this.removeChildView(e)},this),this.checkEmpty()}}),o.CompositeView=o.CollectionView.extend({constructor:function(){o.CollectionView.prototype.constructor.apply(this,n(arguments))},_initialEvents:function(){this.collection&&(this.listenTo(this.collection,"add",this.addChildView,this),this.listenTo(this.collection,"remove",this.removeItemView,this),this.listenTo(this.collection,"reset",this._renderChildren,this))},getItemView:function(){var e=o.getOption(this,"itemView")||this.constructor;return e||r("An `itemView` must be specified","NoItemViewError"),e},serializeData:function(){var e={};return this.model&&(e=this.model.toJSON()),e},render:function(){this.isRendered=!0,this.isClosed=!1,this.resetItemViewContainer(),this.triggerBeforeRender();var e=this.renderModel();return this.$el.html(e),this.bindUIElements(),this.triggerMethod("composite:model:rendered"),this._renderChildren(),this.triggerMethod("composite:rendered"),this.triggerRendered(),this},_renderChildren:function(){this.isRendered&&(o.CollectionView.prototype._renderChildren.call(this),this.triggerMethod("composite:collection:rendered"))},renderModel:function(){var e={};e=this.serializeData(),e=this.mixinTemplateHelpers(e);var t=this.getTemplate();return o.Renderer.render(t,e)},appendHtml:function(e,t){var i=this.getItemViewContainer(e);i.append(t.el)},getItemViewContainer:function(e){if("$itemViewContainer"in e)return e.$itemViewContainer;var t;if(e.itemViewContainer){var n=i.result(e,"itemViewContainer");t=e.$(n),0>=t.length&&r("The specified `itemViewContainer` was not found: "+e.itemViewContainer,"ItemViewContainerMissingError")}else t=e.$el;return e.$itemViewContainer=t,t},resetItemViewContainer:function(){this.$itemViewContainer&&delete this.$itemViewContainer}}),o.Layout=o.ItemView.extend({regionType:o.Region,constructor:function(e){e=e||{},this._firstRender=!0,this._initializeRegions(e),o.ItemView.prototype.constructor.call(this,e)},render:function(){this._firstRender?this._firstRender=!1:this.isClosed?this._initializeRegions():this._reInitializeRegions();var e=Array.prototype.slice.apply(arguments),t=o.ItemView.prototype.render.apply(this,e);return t},close:function(){if(!this.isClosed){this.regionManager.close();var e=Array.prototype.slice.apply(arguments);o.ItemView.prototype.close.apply(this,e)}},addRegion:function(e,t){var i={};return i[e]=t,this.addRegions(i)[e]},addRegions:function(e){return this.regions=i.extend(this.regions||{},e),this._buildRegions(e)},removeRegion:function(e){return this.regionManager.removeRegion(e)},_buildRegions:function(e){var t=this,i={parentEl:function(){return t.$el}};return this.regionManager.addRegions(e,i)},_initializeRegions:function(e){var t;this._initRegionManager(),t=i.isFunction(this.regions)?this.regions(e):this.regions||{},this.addRegions(t)},_reInitializeRegions:function(){this.regionManager.closeRegions(),this.regionManager.each(function(e){e.reset()})},_initRegionManager:function(){this.regionManager=new o.RegionManager,this.listenTo(this.regionManager,"region:add",function(e,t){this[e]=t,this.trigger("region:add",e,t)}),this.listenTo(this.regionManager,"region:remove",function(e,t){delete this[e],this.trigger("region:remove",e,t)})}}),o.AppRouter=t.Router.extend({constructor:function(e){if(t.Router.prototype.constructor.apply(this,n(arguments)),this.options=e,this.appRoutes){var i=o.getOption(this,"controller");this.processAppRoutes(i,this.appRoutes)}},processAppRoutes:function(e,t){var n=i.keys(t).reverse();i.each(n,function(n){var r=t[n],o=e[r];if(!o)throw Error("Method '"+r+"' was not found on the controller");this.route(n,r,i.bind(o,e))},this)}}),o.Application=function(e){this._initRegionManager(),this._initCallbacks=new o.Callbacks,this.vent=new t.Wreqr.EventAggregator,this.commands=new t.Wreqr.Commands,this.reqres=new t.Wreqr.RequestResponse,this.submodules={},i.extend(this,e),this.triggerMethod=o.triggerMethod},i.extend(o.Application.prototype,t.Events,{execute:function(){var e=Array.prototype.slice.apply(arguments);this.commands.execute.apply(this.commands,e)},request:function(){var e=Array.prototype.slice.apply(arguments);return this.reqres.request.apply(this.reqres,e)},addInitializer:function(e){this._initCallbacks.add(e)},start:function(e){this.triggerMethod("initialize:before",e),this._initCallbacks.run(e,this),this.triggerMethod("initialize:after",e),this.triggerMethod("start",e)},addRegions:function(e){return this._regionManager.addRegions(e)},removeRegion:function(e){this._regionManager.removeRegion(e)},module:function(){var e=n(arguments);return e.unshift(this),o.Module.create.apply(o.Module,e)},_initRegionManager:function(){this._regionManager=new o.RegionManager,this.listenTo(this._regionManager,"region:add",function(e,t){this[e]=t}),this.listenTo(this._regionManager,"region:remove",function(e){delete this[e]})}}),o.Application.extend=o.extend,o.Module=function(e,t){this.moduleName=e,this.submodules={},this._setupInitializersAndFinalizers(),this.app=t,this.startWithParent=!0,this.triggerMethod=o.triggerMethod},i.extend(o.Module.prototype,t.Events,{addInitializer:function(e){this._initializerCallbacks.add(e)},addFinalizer:function(e){this._finalizerCallbacks.add(e)},start:function(e){this._isInitialized||(i.each(this.submodules,function(t){t.startWithParent&&t.start(e)}),this.triggerMethod("before:start",e),this._initializerCallbacks.run(e,this),this._isInitialized=!0,this.triggerMethod("start",e))},stop:function(){this._isInitialized&&(this._isInitialized=!1,o.triggerMethod.call(this,"before:stop"),i.each(this.submodules,function(e){e.stop()}),this._finalizerCallbacks.run(void 0,this),this._initializerCallbacks.reset(),this._finalizerCallbacks.reset(),o.triggerMethod.call(this,"stop"))},addDefinition:function(e,t){this._runModuleDefinition(e,t)},_runModuleDefinition:function(e,n){if(e){var r=i.flatten([this,this.app,t,o,o.$,i,n]);e.apply(this,r)}},_setupInitializersAndFinalizers:function(){this._initializerCallbacks=new o.Callbacks,this._finalizerCallbacks=new o.Callbacks}}),i.extend(o.Module,{create:function(e,t,r){var o=e,s=n(arguments);s.splice(0,3),t=t.split(".");var h=t.length,a=[];return a[h-1]=r,i.each(t,function(t,i){var n=o;o=this._getModule(n,t,e),this._addModuleDefinition(n,o,a[i],s)},this),o},_getModule:function(e,t,i){var n=e[t];return n||(n=new o.Module(t,i),e[t]=n,e.submodules[t]=n),n},_addModuleDefinition:function(e,t,n,r){var o,s;i.isFunction(n)?(o=n,s=!0):i.isObject(n)?(o=n.define,s=n.startWithParent):s=!0,o&&t.addDefinition(o,r),t.startWithParent=t.startWithParent&&s,t.startWithParent&&!t.startWithParentIsConfigured&&(t.startWithParentIsConfigured=!0,e.addInitializer(function(e){t.startWithParent&&t.start(e)}))}}),o}(this,Backbone,_);
|
21
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.0.
|
4
|
+
version: 1.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,24 +10,24 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-07-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
-
|
17
|
-
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
16
|
+
version_requirements: !ruby/object:Gem::Requirement
|
19
17
|
requirements:
|
20
18
|
- - ! '>='
|
21
19
|
- !ruby/object:Gem::Version
|
22
20
|
version: 3.1.0
|
23
|
-
type: :runtime
|
24
|
-
prerelease: false
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
26
21
|
none: false
|
22
|
+
name: rails
|
23
|
+
prerelease: false
|
24
|
+
requirement: !ruby/object:Gem::Requirement
|
27
25
|
requirements:
|
28
26
|
- - ! '>='
|
29
27
|
- !ruby/object:Gem::Version
|
30
28
|
version: 3.1.0
|
29
|
+
none: false
|
30
|
+
type: :runtime
|
31
31
|
description: Vendors Backbone.Marionette for use with the asset pipeline.
|
32
32
|
email:
|
33
33
|
- godfreykfc@gmail.com
|
@@ -36,8 +36,8 @@ executables: []
|
|
36
36
|
extensions: []
|
37
37
|
extra_rdoc_files: []
|
38
38
|
files:
|
39
|
-
- lib/marionette-rails/version.rb
|
40
39
|
- lib/marionette-rails.rb
|
40
|
+
- lib/marionette-rails/version.rb
|
41
41
|
- vendor/assets/javascripts/backbone.marionette.js
|
42
42
|
- vendor/assets/javascripts/backbone.marionette.map
|
43
43
|
- vendor/assets/javascripts/backbone.marionette.min.js
|
@@ -50,22 +50,21 @@ rdoc_options: []
|
|
50
50
|
require_paths:
|
51
51
|
- lib
|
52
52
|
required_ruby_version: !ruby/object:Gem::Requirement
|
53
|
-
none: false
|
54
53
|
requirements:
|
55
54
|
- - ! '>='
|
56
55
|
- !ruby/object:Gem::Version
|
57
56
|
version: '0'
|
58
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
57
|
none: false
|
58
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
59
|
requirements:
|
61
60
|
- - ! '>='
|
62
61
|
- !ruby/object:Gem::Version
|
63
62
|
version: 1.3.6
|
63
|
+
none: false
|
64
64
|
requirements: []
|
65
65
|
rubyforge_project:
|
66
|
-
rubygems_version: 1.8.
|
66
|
+
rubygems_version: 1.8.25
|
67
67
|
signing_key:
|
68
68
|
specification_version: 3
|
69
69
|
summary: Backbone.Marionette for Rails
|
70
70
|
test_files: []
|
71
|
-
has_rdoc:
|