Skip to content

Commit

Permalink
bump and build [v1.6.2]
Browse files Browse the repository at this point in the history
  • Loading branch information
samccone committed Feb 7, 2014
1 parent 671339f commit 77755a8
Show file tree
Hide file tree
Showing 36 changed files with 347 additions and 207 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description" : "Make your Backbone.js apps dance with a composite application architecture!",
"homepage" : "http://marionettejs.org",
"main" : ["./lib/backbone.marionette.js", "./lib/core/amd/backbone.marionette.js"],
"version" : "1.6.1",
"version" : "1.6.2",

"keywords" : [
"backbone",
Expand Down
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
### v1.6.2 [view commit logs](https://github.com/marionettejs/backbone.marionette/compare/v1.6.1...v1.6.2)
* CollectionView/CompositeView
* allow `itemEvents` to use string based method names [PR 875](https://github.com/marionettejs/backbone.marionette/pull/875)
* Modules
* update module initialize to include moduleName and app [PR 898](https://github.com/marionettejs/backbone.marionette/pull/898)
* General
* significantly improve module documentation [PR 897](https://github.com/marionettejs/backbone.marionette/pull/897)

### v1.6.1 [view commit logs](https://github.com/marionettejs/backbone.marionette/compare/v1.6.0...v1.6.1)
* Modules
* Fix a bug where a module would not start by default when defined as an object literal
Expand Down
32 changes: 27 additions & 5 deletions lib/backbone.marionette.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// MarionetteJS (Backbone.Marionette)
// ----------------------------------
// v1.6.1
// v1.6.2
//
// Copyright (c)2014 Derick Bailey, Muted Solutions, LLC.
// Distributed under MIT license
Expand Down Expand Up @@ -491,6 +491,25 @@ Marionette.getOption = function(target, optionName){
return value;
};

// Marionette.normalizeMethods
// ----------------------

// Pass in a mapping of events => functions or function names
// and return a mapping of events => functions
Marionette.normalizeMethods = function(hash) {
var normalizedHash = {}, method;
_.each(hash, function(fn, name) {
method = fn;
if (!_.isFunction(method)) {
method = this[method];
}
if (!method) {
return;
}
normalizedHash[name] = method;
}, this);
return normalizedHash;
};
// Trigger an event and/or a corresponding method name. Examples:
//
// `this.triggerMethod("foo")` will trigger the "foo" event and
Expand Down Expand Up @@ -1230,6 +1249,10 @@ Marionette.View = Backbone.View.extend({
// methods if the method exists
triggerMethod: Marionette.triggerMethod,

// Imports the "normalizeMethods" to transform hashes of
// events=>function references/names to a hash of events=>function references
normalizeMethods: Marionette.normalizeMethods,

// Get the template for this view
// instance. You can set a `template` attribute in the view
// definition or pass a `template: "whatever"` parameter in
Expand Down Expand Up @@ -1540,8 +1563,7 @@ Marionette.CollectionView = Marionette.View.extend({
},

// Configured the initial events that the collection view
// binds to. Override this method to prevent the initial
// events, or to add your own initial events.
// binds to.
_initialEvents: function(){
if (this.collection){
this.listenTo(this.collection, "add", this.addChildView, this);
Expand Down Expand Up @@ -1707,7 +1729,7 @@ Marionette.CollectionView = Marionette.View.extend({
this.listenTo(view, "all", function(){
var args = slice(arguments);
var rootEvent = args[0];
var itemEvents = this.getItemEvents();
var itemEvents = this.normalizeMethods(this.getItemEvents());

args[0] = prefix + ":" + rootEvent;
args.splice(1, 0, view);
Expand Down Expand Up @@ -2324,7 +2346,7 @@ Marionette.Module = function(moduleName, app, options){
this.triggerMethod = Marionette.triggerMethod;

if (_.isFunction(this.initialize)){
this.initialize(this.options);
this.initialize(this.options, moduleName, app);
}
};

Expand Down
2 changes: 1 addition & 1 deletion lib/backbone.marionette.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/backbone.marionette.min.js

Large diffs are not rendered by default.

32 changes: 27 additions & 5 deletions lib/core/amd/backbone.marionette.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// MarionetteJS (Backbone.Marionette)
// ----------------------------------
// v1.6.1
// v1.6.2
//
// Copyright (c)2014 Derick Bailey, Muted Solutions, LLC.
// Distributed under MIT license
Expand Down Expand Up @@ -83,6 +83,25 @@ Marionette.getOption = function(target, optionName){
return value;
};

// Marionette.normalizeMethods
// ----------------------

// Pass in a mapping of events => functions or function names
// and return a mapping of events => functions
Marionette.normalizeMethods = function(hash) {
var normalizedHash = {}, method;
_.each(hash, function(fn, name) {
method = fn;
if (!_.isFunction(method)) {
method = this[method];
}
if (!method) {
return;
}
normalizedHash[name] = method;
}, this);
return normalizedHash;
};
// Trigger an event and/or a corresponding method name. Examples:
//
// `this.triggerMethod("foo")` will trigger the "foo" event and
Expand Down Expand Up @@ -822,6 +841,10 @@ Marionette.View = Backbone.View.extend({
// methods if the method exists
triggerMethod: Marionette.triggerMethod,

// Imports the "normalizeMethods" to transform hashes of
// events=>function references/names to a hash of events=>function references
normalizeMethods: Marionette.normalizeMethods,

// Get the template for this view
// instance. You can set a `template` attribute in the view
// definition or pass a `template: "whatever"` parameter in
Expand Down Expand Up @@ -1132,8 +1155,7 @@ Marionette.CollectionView = Marionette.View.extend({
},

// Configured the initial events that the collection view
// binds to. Override this method to prevent the initial
// events, or to add your own initial events.
// binds to.
_initialEvents: function(){
if (this.collection){
this.listenTo(this.collection, "add", this.addChildView, this);
Expand Down Expand Up @@ -1299,7 +1321,7 @@ Marionette.CollectionView = Marionette.View.extend({
this.listenTo(view, "all", function(){
var args = slice(arguments);
var rootEvent = args[0];
var itemEvents = this.getItemEvents();
var itemEvents = this.normalizeMethods(this.getItemEvents());

args[0] = prefix + ":" + rootEvent;
args.splice(1, 0, view);
Expand Down Expand Up @@ -1916,7 +1938,7 @@ Marionette.Module = function(moduleName, app, options){
this.triggerMethod = Marionette.triggerMethod;

if (_.isFunction(this.initialize)){
this.initialize(this.options);
this.initialize(this.options, moduleName, app);
}
};

Expand Down
4 changes: 2 additions & 2 deletions lib/core/amd/backbone.marionette.min.js

Large diffs are not rendered by default.

30 changes: 26 additions & 4 deletions lib/core/backbone.marionette.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,25 @@ Marionette.getOption = function(target, optionName){
return value;
};

// Marionette.normalizeMethods
// ----------------------

// Pass in a mapping of events => functions or function names
// and return a mapping of events => functions
Marionette.normalizeMethods = function(hash) {
var normalizedHash = {}, method;
_.each(hash, function(fn, name) {
method = fn;
if (!_.isFunction(method)) {
method = this[method];
}
if (!method) {
return;
}
normalizedHash[name] = method;
}, this);
return normalizedHash;
};
// Trigger an event and/or a corresponding method name. Examples:
//
// `this.triggerMethod("foo")` will trigger the "foo" event and
Expand Down Expand Up @@ -786,6 +805,10 @@ Marionette.View = Backbone.View.extend({
// methods if the method exists
triggerMethod: Marionette.triggerMethod,

// Imports the "normalizeMethods" to transform hashes of
// events=>function references/names to a hash of events=>function references
normalizeMethods: Marionette.normalizeMethods,

// Get the template for this view
// instance. You can set a `template` attribute in the view
// definition or pass a `template: "whatever"` parameter in
Expand Down Expand Up @@ -1096,8 +1119,7 @@ Marionette.CollectionView = Marionette.View.extend({
},

// Configured the initial events that the collection view
// binds to. Override this method to prevent the initial
// events, or to add your own initial events.
// binds to.
_initialEvents: function(){
if (this.collection){
this.listenTo(this.collection, "add", this.addChildView, this);
Expand Down Expand Up @@ -1263,7 +1285,7 @@ Marionette.CollectionView = Marionette.View.extend({
this.listenTo(view, "all", function(){
var args = slice(arguments);
var rootEvent = args[0];
var itemEvents = this.getItemEvents();
var itemEvents = this.normalizeMethods(this.getItemEvents());

args[0] = prefix + ":" + rootEvent;
args.splice(1, 0, view);
Expand Down Expand Up @@ -1880,7 +1902,7 @@ Marionette.Module = function(moduleName, app, options){
this.triggerMethod = Marionette.triggerMethod;

if (_.isFunction(this.initialize)){
this.initialize(this.options);
this.initialize(this.options, moduleName, app);
}
};

Expand Down
2 changes: 1 addition & 1 deletion lib/core/backbone.marionette.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/core/backbone.marionette.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "backbone.marionette",
"description": "Make your Backbone.js apps dance!",
"version": "1.6.1",
"version": "1.6.2",
"homepage": "https://github.com/marionettejs/backbone.marionette",
"main": "lib/core/amd/backbone.marionette.js",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion reports/coverage.json

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions reports/coverage/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,16 @@
<h1>Code coverage report for <span class="entity">All files</span></h1>
<h2>

Statements: <span class="metric">98.2% <small>(709 / 722)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Statements: <span class="metric">98.22% <small>(719 / 732)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;


Branches: <span class="metric">94.72% <small>(269 / 284)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">94.79% <small>(273 / 288)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;


Functions: <span class="metric">98.92% <small>(184 / 186)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">98.94% <small>(186 / 188)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;


Lines: <span class="metric">98.71% <small>(690 / 699)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">98.73% <small>(700 / 709)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;

</h2>
<div class="path"></div>
Expand Down Expand Up @@ -229,15 +229,15 @@ <h2>

<tr>
<td class="file high" data-value="src/"><a href="src/index.html">src/</a></td>
<td data-value="98.18" class="pic high"><span class="cover-fill" style="width: 98px;"></span><span class="cover-empty" style="width:2px;"></span></td>
<td data-value="98.18" class="pct high">98.18%</td>
<td data-value="716" class="abs high">(703&nbsp;/&nbsp;716)</td>
<td data-value="94.72" class="pct high">94.72%</td>
<td data-value="284" class="abs high">(269&nbsp;/&nbsp;284)</td>
<td data-value="98.92" class="pct high">98.92%</td>
<td data-value="185" class="abs high">(183&nbsp;/&nbsp;185)</td>
<td data-value="98.7" class="pct high">98.7%</td>
<td data-value="693" class="abs high">(684&nbsp;/&nbsp;693)</td>
<td data-value="98.21" class="pic high"><span class="cover-fill" style="width: 98px;"></span><span class="cover-empty" style="width:2px;"></span></td>
<td data-value="98.21" class="pct high">98.21%</td>
<td data-value="726" class="abs high">(713&nbsp;/&nbsp;726)</td>
<td data-value="94.79" class="pct high">94.79%</td>
<td data-value="288" class="abs high">(273&nbsp;/&nbsp;288)</td>
<td data-value="98.93" class="pct high">98.93%</td>
<td data-value="187" class="abs high">(185&nbsp;/&nbsp;187)</td>
<td data-value="98.72" class="pct high">98.72%</td>
<td data-value="703" class="abs high">(694&nbsp;/&nbsp;703)</td>
</tr>

<tr>
Expand All @@ -258,7 +258,7 @@ <h2>
</div>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Feb 02 2014 20:35:12 GMT-0500 (EST)</div>
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Feb 07 2014 14:20:45 GMT-0500 (EST)</div>
</div>

<script src="prettify.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion reports/coverage/spec/javascripts/support/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ <h2>
</div>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Feb 02 2014 20:35:12 GMT-0500 (EST)</div>
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Feb 07 2014 14:20:45 GMT-0500 (EST)</div>
</div>

<script src="../../../prettify.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ <h2>

</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Feb 02 2014 20:35:12 GMT-0500 (EST)</div>
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Feb 07 2014 14:20:45 GMT-0500 (EST)</div>
</div>

<script src="../../../prettify.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion reports/coverage/src/build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ <h2>
</div>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Feb 02 2014 20:35:12 GMT-0500 (EST)</div>
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Feb 07 2014 14:20:45 GMT-0500 (EST)</div>
</div>

<script src="../../prettify.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion reports/coverage/src/build/marionette.core.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ <h2>

</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Feb 02 2014 20:35:12 GMT-0500 (EST)</div>
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Feb 07 2014 14:20:45 GMT-0500 (EST)</div>
</div>

<script src="../../prettify.js"></script>
Expand Down
24 changes: 12 additions & 12 deletions reports/coverage/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,16 @@
<h1>Code coverage report for <span class="entity">src/</span></h1>
<h2>

Statements: <span class="metric">98.18% <small>(703 / 716)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Statements: <span class="metric">98.21% <small>(713 / 726)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;


Branches: <span class="metric">94.72% <small>(269 / 284)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Branches: <span class="metric">94.79% <small>(273 / 288)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;


Functions: <span class="metric">98.92% <small>(183 / 185)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Functions: <span class="metric">98.93% <small>(185 / 187)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;


Lines: <span class="metric">98.7% <small>(684 / 693)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
Lines: <span class="metric">98.72% <small>(694 / 703)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;

</h2>
<div class="path"><a href="../index.html">All files</a> &#187; src/</div>
Expand Down Expand Up @@ -320,15 +320,15 @@ <h2>

<tr>
<td class="file high" data-value="marionette.helpers.js"><a href="marionette.helpers.js.html">marionette.helpers.js</a></td>
<td data-value="93.75" class="pic high"><span class="cover-fill" style="width: 93px;"></span><span class="cover-empty" style="width:7px;"></span></td>
<td data-value="93.75" class="pct high">93.75%</td>
<td data-value="16" class="abs high">(15&nbsp;/&nbsp;16)</td>
<td data-value="90.91" class="pct high">90.91%</td>
<td data-value="11" class="abs high">(10&nbsp;/&nbsp;11)</td>
<td data-value="96.15" class="pic high"><span class="cover-fill" style="width: 96px;"></span><span class="cover-empty" style="width:4px;"></span></td>
<td data-value="96.15" class="pct high">96.15%</td>
<td data-value="26" class="abs high">(25&nbsp;/&nbsp;26)</td>
<td data-value="93.33" class="pct high">93.33%</td>
<td data-value="15" class="abs high">(14&nbsp;/&nbsp;15)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="3" class="abs high">(3&nbsp;/&nbsp;3)</td>
<td data-value="5" class="abs high">(5&nbsp;/&nbsp;5)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="15" class="abs high">(15&nbsp;/&nbsp;15)</td>
<td data-value="25" class="abs high">(25&nbsp;/&nbsp;25)</td>
</tr>

<tr>
Expand Down Expand Up @@ -453,7 +453,7 @@ <h2>
</div>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Feb 02 2014 20:35:12 GMT-0500 (EST)</div>
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Feb 07 2014 14:20:45 GMT-0500 (EST)</div>
</div>

<script src="../prettify.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion reports/coverage/src/marionette.application.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ <h2>

</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Feb 02 2014 20:35:12 GMT-0500 (EST)</div>
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Feb 07 2014 14:20:45 GMT-0500 (EST)</div>
</div>

<script src="../prettify.js"></script>
Expand Down
Loading

0 comments on commit 77755a8

Please sign in to comment.