js_stack 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71219299a332d408c37bc2e88f96e248d756f33f
|
4
|
+
data.tar.gz: 092c76d417560a4d394e8be1fc762cc75ddf5c07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d2c8fddb222803d7ed51098728d25fe0f308d277b61a477c31d24b2bfa62dc3042d716eb73e11553d931789c1533a2ea9785f2682c5f38e9e7e81f91505cd04
|
7
|
+
data.tar.gz: 3ff6affc6ad629d39470e8eaffea250be399a12debf5a697a6f767749b30912bd2d7a3dae5681e09a26150f3a0706ab155dbe59e18cea021d60faa7940493a3e
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -50,10 +50,10 @@ Examples:
|
|
50
50
|
|
51
51
|
### Base
|
52
52
|
|
53
|
-
| Library | Versions | Changelog | Homepage |
|
53
|
+
| Library | Versions | Changelog | Homepage |
|
54
54
|
| :-----: | :------: | :-------: | :------: |
|
55
55
|
| backbone | **1.1.2**, 1.0.0 | [changelog](http://backbonejs.org/#changelog) | [homepage](http://backbonejs.org/) |
|
56
|
-
| marionette | **1.8.
|
56
|
+
| marionette | **1.8.4**, 1.7.4, 1.6.4, 1.5.1, 1.4.1, 1.1.0 | [changelog](https://github.com/marionettejs/backbone.marionette/blob/master/changelog.md) | [homepage](http://marionettejs.com/) |
|
57
57
|
| underscore | **1.6.0**, 1.5.2 | [changelog](http://underscorejs.org/#changelog) | [homepage](http://underscorejs.org/) |
|
58
58
|
| hamlcoffee | **1.16** | [changelog](https://github.com/netzpirat/haml_coffee_assets/blob/master/CHANGELOG.md) | [homepage](https://github.com/netzpirat/haml_coffee_assets) |
|
59
59
|
| js-routes | **0.9.7** | none | [homepage](https://github.com/railsware/js-routes) |
|
data/lib/js_stack/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
// MarionetteJS (Backbone.Marionette)
|
2
2
|
// ----------------------------------
|
3
|
-
// v1.8.
|
3
|
+
// v1.8.4
|
4
4
|
//
|
5
5
|
// Copyright (c)2014 Derick Bailey, Muted Solutions, LLC.
|
6
6
|
// Distributed under MIT license
|
@@ -19,167 +19,197 @@
|
|
19
19
|
|
20
20
|
// Backbone.BabySitter
|
21
21
|
// -------------------
|
22
|
-
// v0.1.
|
22
|
+
// v0.1.2
|
23
23
|
//
|
24
24
|
// Copyright (c)2014 Derick Bailey, Muted Solutions, LLC.
|
25
25
|
// Distributed under MIT license
|
26
26
|
//
|
27
27
|
// http://github.com/marionettejs/backbone.babysitter
|
28
28
|
|
29
|
-
|
30
|
-
// ---------------------------
|
31
|
-
//
|
32
|
-
// Provide a container to store, retrieve and
|
33
|
-
// shut down child views.
|
34
|
-
|
35
|
-
Backbone.ChildViewContainer = (function(Backbone, _){
|
36
|
-
|
37
|
-
// Container Constructor
|
38
|
-
// ---------------------
|
39
|
-
|
40
|
-
var Container = function(views){
|
41
|
-
this._views = {};
|
42
|
-
this._indexByModel = {};
|
43
|
-
this._indexByCustom = {};
|
44
|
-
this._updateLength();
|
29
|
+
(function(root, factory) {
|
45
30
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
31
|
+
if (typeof define === 'function' && define.amd) {
|
32
|
+
define(['exports', 'backbone', 'underscore'], function(exports, Backbone, _) {
|
33
|
+
return factory(Backbone, _);
|
34
|
+
});
|
35
|
+
} else if (typeof exports !== 'undefined') {
|
36
|
+
var Backbone = require('backbone');
|
37
|
+
var _ = require('underscore');
|
38
|
+
module.exports = factory(Backbone, _);
|
39
|
+
} else {
|
40
|
+
factory(root.Backbone, root._);
|
41
|
+
}
|
51
42
|
|
52
|
-
|
43
|
+
}(this, function(Backbone, _) {
|
44
|
+
"use strict";
|
53
45
|
|
54
|
-
|
55
|
-
// by `cid` and makes it searchable by the model
|
56
|
-
// cid (and model itself). Optionally specify
|
57
|
-
// a custom key to store an retrieve the view.
|
58
|
-
add: function(view, customIndex){
|
59
|
-
var viewCid = view.cid;
|
46
|
+
var previousChildViewContainer = Backbone.ChildViewContainer;
|
60
47
|
|
61
|
-
|
62
|
-
|
48
|
+
// BabySitter.ChildViewContainer
|
49
|
+
// -----------------------------
|
50
|
+
//
|
51
|
+
// Provide a container to store, retrieve and
|
52
|
+
// shut down child views.
|
63
53
|
|
64
|
-
|
65
|
-
if (view.model){
|
66
|
-
this._indexByModel[view.model.cid] = viewCid;
|
67
|
-
}
|
54
|
+
Backbone.ChildViewContainer = (function (Backbone, _) {
|
68
55
|
|
69
|
-
|
70
|
-
|
71
|
-
this._indexByCustom[customIndex] = viewCid;
|
72
|
-
}
|
56
|
+
// Container Constructor
|
57
|
+
// ---------------------
|
73
58
|
|
59
|
+
var Container = function(views){
|
60
|
+
this._views = {};
|
61
|
+
this._indexByModel = {};
|
62
|
+
this._indexByCustom = {};
|
74
63
|
this._updateLength();
|
75
|
-
return this;
|
76
|
-
},
|
77
64
|
|
78
|
-
|
79
|
-
|
80
|
-
findByModel: function(model){
|
81
|
-
return this.findByModelCid(model.cid);
|
82
|
-
},
|
65
|
+
_.each(views, this.add, this);
|
66
|
+
};
|
83
67
|
|
84
|
-
//
|
85
|
-
//
|
86
|
-
// retrieve the view using it.
|
87
|
-
findByModelCid: function(modelCid){
|
88
|
-
var viewCid = this._indexByModel[modelCid];
|
89
|
-
return this.findByCid(viewCid);
|
90
|
-
},
|
68
|
+
// Container Methods
|
69
|
+
// -----------------
|
91
70
|
|
92
|
-
|
93
|
-
findByCustom: function(index){
|
94
|
-
var viewCid = this._indexByCustom[index];
|
95
|
-
return this.findByCid(viewCid);
|
96
|
-
},
|
71
|
+
_.extend(Container.prototype, {
|
97
72
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
73
|
+
// Add a view to this container. Stores the view
|
74
|
+
// by `cid` and makes it searchable by the model
|
75
|
+
// cid (and model itself). Optionally specify
|
76
|
+
// a custom key to store an retrieve the view.
|
77
|
+
add: function(view, customIndex){
|
78
|
+
var viewCid = view.cid;
|
103
79
|
|
104
|
-
|
105
|
-
|
106
|
-
return this._views[cid];
|
107
|
-
},
|
80
|
+
// store the view
|
81
|
+
this._views[viewCid] = view;
|
108
82
|
|
109
|
-
|
110
|
-
|
111
|
-
|
83
|
+
// index it by model
|
84
|
+
if (view.model){
|
85
|
+
this._indexByModel[view.model.cid] = viewCid;
|
86
|
+
}
|
112
87
|
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
88
|
+
// index by custom
|
89
|
+
if (customIndex){
|
90
|
+
this._indexByCustom[customIndex] = viewCid;
|
91
|
+
}
|
117
92
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
93
|
+
this._updateLength();
|
94
|
+
return this;
|
95
|
+
},
|
96
|
+
|
97
|
+
// Find a view by the model that was attached to
|
98
|
+
// it. Uses the model's `cid` to find it.
|
99
|
+
findByModel: function(model){
|
100
|
+
return this.findByModelCid(model.cid);
|
101
|
+
},
|
102
|
+
|
103
|
+
// Find a view by the `cid` of the model that was attached to
|
104
|
+
// it. Uses the model's `cid` to find the view `cid` and
|
105
|
+
// retrieve the view using it.
|
106
|
+
findByModelCid: function(modelCid){
|
107
|
+
var viewCid = this._indexByModel[modelCid];
|
108
|
+
return this.findByCid(viewCid);
|
109
|
+
},
|
110
|
+
|
111
|
+
// Find a view by a custom indexer.
|
112
|
+
findByCustom: function(index){
|
113
|
+
var viewCid = this._indexByCustom[index];
|
114
|
+
return this.findByCid(viewCid);
|
115
|
+
},
|
116
|
+
|
117
|
+
// Find by index. This is not guaranteed to be a
|
118
|
+
// stable index.
|
119
|
+
findByIndex: function(index){
|
120
|
+
return _.values(this._views)[index];
|
121
|
+
},
|
122
|
+
|
123
|
+
// retrieve a view by its `cid` directly
|
124
|
+
findByCid: function(cid){
|
125
|
+
return this._views[cid];
|
126
|
+
},
|
127
|
+
|
128
|
+
// Remove a view
|
129
|
+
remove: function(view){
|
130
|
+
var viewCid = view.cid;
|
131
|
+
|
132
|
+
// delete model index
|
133
|
+
if (view.model){
|
134
|
+
delete this._indexByModel[view.model.cid];
|
123
135
|
}
|
124
|
-
}, this);
|
125
136
|
|
126
|
-
|
127
|
-
|
137
|
+
// delete custom index
|
138
|
+
_.any(this._indexByCustom, function(cid, key) {
|
139
|
+
if (cid === viewCid) {
|
140
|
+
delete this._indexByCustom[key];
|
141
|
+
return true;
|
142
|
+
}
|
143
|
+
}, this);
|
128
144
|
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
145
|
+
// remove the view from the container
|
146
|
+
delete this._views[viewCid];
|
147
|
+
|
148
|
+
// update the length
|
149
|
+
this._updateLength();
|
150
|
+
return this;
|
151
|
+
},
|
152
|
+
|
153
|
+
// Call a method on every view in the container,
|
154
|
+
// passing parameters to the call method one at a
|
155
|
+
// time, like `function.call`.
|
156
|
+
call: function(method){
|
157
|
+
this.apply(method, _.tail(arguments));
|
158
|
+
},
|
159
|
+
|
160
|
+
// Apply a method on every view in the container,
|
161
|
+
// passing parameters to the call method one at a
|
162
|
+
// time, like `function.apply`.
|
163
|
+
apply: function(method, args){
|
164
|
+
_.each(this._views, function(view){
|
165
|
+
if (_.isFunction(view[method])){
|
166
|
+
view[method].apply(view, args || []);
|
167
|
+
}
|
168
|
+
});
|
169
|
+
},
|
133
170
|
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
},
|
171
|
+
// Update the `.length` attribute on this container
|
172
|
+
_updateLength: function(){
|
173
|
+
this.length = _.size(this._views);
|
174
|
+
}
|
175
|
+
});
|
140
176
|
|
141
|
-
//
|
142
|
-
//
|
143
|
-
//
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
177
|
+
// Borrowing this code from Backbone.Collection:
|
178
|
+
// http://backbonejs.org/docs/backbone.html#section-106
|
179
|
+
//
|
180
|
+
// Mix in methods from Underscore, for iteration, and other
|
181
|
+
// collection related features.
|
182
|
+
var methods = ['forEach', 'each', 'map', 'find', 'detect', 'filter',
|
183
|
+
'select', 'reject', 'every', 'all', 'some', 'any', 'include',
|
184
|
+
'contains', 'invoke', 'toArray', 'first', 'initial', 'rest',
|
185
|
+
'last', 'without', 'isEmpty', 'pluck'];
|
186
|
+
|
187
|
+
_.each(methods, function(method) {
|
188
|
+
Container.prototype[method] = function() {
|
189
|
+
var views = _.values(this._views);
|
190
|
+
var args = [views].concat(_.toArray(arguments));
|
191
|
+
return _[method].apply(_, args);
|
192
|
+
};
|
193
|
+
});
|
151
194
|
|
152
|
-
//
|
153
|
-
|
154
|
-
|
155
|
-
}
|
156
|
-
});
|
195
|
+
// return the public API
|
196
|
+
return Container;
|
197
|
+
})(Backbone, _);
|
157
198
|
|
158
|
-
|
159
|
-
// http://backbonejs.org/docs/backbone.html#section-106
|
160
|
-
//
|
161
|
-
// Mix in methods from Underscore, for iteration, and other
|
162
|
-
// collection related features.
|
163
|
-
var methods = ['forEach', 'each', 'map', 'find', 'detect', 'filter',
|
164
|
-
'select', 'reject', 'every', 'all', 'some', 'any', 'include',
|
165
|
-
'contains', 'invoke', 'toArray', 'first', 'initial', 'rest',
|
166
|
-
'last', 'without', 'isEmpty', 'pluck'];
|
199
|
+
Backbone.ChildViewContainer.VERSION = '0.1.2';
|
167
200
|
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
return _[method].apply(_, args);
|
173
|
-
};
|
174
|
-
});
|
201
|
+
Backbone.ChildViewContainer.noConflict = function () {
|
202
|
+
Backbone.ChildViewContainer = previousChildViewContainer;
|
203
|
+
return this;
|
204
|
+
};
|
175
205
|
|
176
|
-
|
177
|
-
|
178
|
-
})
|
206
|
+
return Backbone.ChildViewContainer;
|
207
|
+
|
208
|
+
}));
|
179
209
|
|
180
210
|
// Backbone.Wreqr (Backbone.Marionette)
|
181
211
|
// ----------------------------------
|
182
|
-
// v1.
|
212
|
+
// v1.3.0
|
183
213
|
//
|
184
214
|
// Copyright (c)2014 Derick Bailey, Muted Solutions, LLC.
|
185
215
|
// Distributed under MIT license
|
@@ -187,9 +217,33 @@ Backbone.ChildViewContainer = (function(Backbone, _){
|
|
187
217
|
// http://github.com/marionettejs/backbone.wreqr
|
188
218
|
|
189
219
|
|
190
|
-
|
220
|
+
(function(root, factory) {
|
221
|
+
|
222
|
+
if (typeof define === 'function' && define.amd) {
|
223
|
+
define(['exports', 'backbone', 'underscore'], function(exports, Backbone, _) {
|
224
|
+
factory(exports, Backbone, _);
|
225
|
+
});
|
226
|
+
} else if (typeof exports !== 'undefined') {
|
227
|
+
var Backbone = require('backbone');
|
228
|
+
var _ = require('underscore');
|
229
|
+
factory(exports, Backbone, _);
|
230
|
+
} else {
|
231
|
+
factory({}, root.Backbone, root._);
|
232
|
+
}
|
233
|
+
|
234
|
+
}(this, function(Wreqr, Backbone, _) {
|
191
235
|
"use strict";
|
192
|
-
|
236
|
+
|
237
|
+
var previousWreqr = Backbone.Wreqr;
|
238
|
+
|
239
|
+
Backbone.Wreqr = Wreqr;
|
240
|
+
|
241
|
+
Backbone.Wreqr.VERSION = '1.3.0';
|
242
|
+
|
243
|
+
Backbone.Wreqr.noConflict = function () {
|
244
|
+
Backbone.Wreqr = previousWreqr;
|
245
|
+
return this;
|
246
|
+
};
|
193
247
|
|
194
248
|
// Handlers
|
195
249
|
// --------
|
@@ -581,7 +635,7 @@ Wreqr.radio = (function(Wreqr){
|
|
581
635
|
var messageSystem = radio._getChannel(channelName)[system];
|
582
636
|
var args = Array.prototype.slice.call(arguments, 1);
|
583
637
|
|
584
|
-
messageSystem[method].apply(messageSystem, args);
|
638
|
+
return messageSystem[method].apply(messageSystem, args);
|
585
639
|
};
|
586
640
|
};
|
587
641
|
|
@@ -590,8 +644,7 @@ Wreqr.radio = (function(Wreqr){
|
|
590
644
|
})(Wreqr);
|
591
645
|
|
592
646
|
|
593
|
-
|
594
|
-
})(Backbone, Backbone.Marionette, _);
|
647
|
+
}));
|
595
648
|
|
596
649
|
var Marionette = (function(global, Backbone, _){
|
597
650
|
"use strict";
|
@@ -1 +1 @@
|
|
1
|
-
//= require js_stack/base/marionette/1.8.
|
1
|
+
//= require js_stack/base/marionette/1.8.4
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: js_stack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomasz Pewiński
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-05-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: haml_coffee_assets
|
@@ -112,7 +112,7 @@ files:
|
|
112
112
|
- vendor/assets/javascripts/js_stack/base/marionette/1.5.1.js
|
113
113
|
- vendor/assets/javascripts/js_stack/base/marionette/1.6.4.js
|
114
114
|
- vendor/assets/javascripts/js_stack/base/marionette/1.7.4.js
|
115
|
-
- vendor/assets/javascripts/js_stack/base/marionette/1.8.
|
115
|
+
- vendor/assets/javascripts/js_stack/base/marionette/1.8.4.js
|
116
116
|
- vendor/assets/javascripts/js_stack/base/underscore.js
|
117
117
|
- vendor/assets/javascripts/js_stack/base/underscore/1.5.2.js
|
118
118
|
- vendor/assets/javascripts/js_stack/base/underscore/1.6.0.js
|