From 0666c5e2b6af5c453b225f3df89f6a5294f2a8b2 Mon Sep 17 00:00:00 2001 From: Jackson Ray Hamilton Date: Wed, 8 Feb 2017 15:56:49 -0800 Subject: [PATCH 1/2] Remove debug comment from source. --- src/backbone.courier.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/backbone.courier.js b/src/backbone.courier.js index 26d4a83..f6af4d9 100755 --- a/src/backbone.courier.js +++ b/src/backbone.courier.js @@ -44,8 +44,6 @@ var curParent = this._getParentView(); var messageShouldBePassed; var value; - - if( message.name === 'removeButtonClicked' ) console.log( 'gotit' ); // REMOVEME while( curParent ) { // check to see if curParent has an action to perform when this message is received. From 741910b2586d88701d74a3881dc6765d3309dfa9 Mon Sep 17 00:00:00 2001 From: Jackson Ray Hamilton Date: Wed, 8 Feb 2017 15:57:06 -0800 Subject: [PATCH 2/2] Rebuild (updating version in dist). --- dist/backbone.courier.js | 2 +- dist/backbone.courier.min.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/backbone.courier.js b/dist/backbone.courier.js index afa9bd1..5e76221 100644 --- a/dist/backbone.courier.js +++ b/dist/backbone.courier.js @@ -1,5 +1,5 @@ /* - * Backbone.Courier, v2.0.0 + * Backbone.Courier, v3.0.1 * Copyright (c)2013 Rotunda Software, LLC. * Distributed under MIT license * http://github.com/rotundasoftware/backbone.courier diff --git a/dist/backbone.courier.min.js b/dist/backbone.courier.min.js index a9692d9..82d58ce 100644 --- a/dist/backbone.courier.min.js +++ b/dist/backbone.courier.min.js @@ -1,7 +1,7 @@ /* - * Backbone.Courier, v2.0.0 + * Backbone.Courier, v3.0.1 * Copyright (c)2013 Rotunda Software, LLC. * Distributed under MIT license * http://github.com/rotundasoftware/backbone.courier */ -(function(e,n){"function"==typeof define&&define.amd?define(["underscore","backbone","jquery"],n):"undefined"!=typeof exports?module.exports=n(require("underscore"),require("backbone"),require("backbone").$):n(e._,e.Backbone,e.jQuery||e.Zepto||e.$)})(this,function(e,n,t){var r=/^(\S+)\s*(.*)$/,i=e.isFunction(t)?t("body")[0]:null;return n.Courier={},n.Courier.add=function(n){function t(n){e.isFunction(n.$el.data)&&!n.$el.data("view")&&n.$el.data("view",n)}function a(n,t,i){var a=[];for(var s in n){var o=s.match(r),u=o[1],l=o[2],d=RegExp("^"+u.replace(/\*/g,"[\\w]*")+"$");d.test(t.name)&&(""===l||i._getChildViewNamed(l)===t.source)&&a.push({eventName:u,subviewName:l,value:n[s]})}return a.length>1&&(a=e.sortBy(a,function(e){var n=e.eventName.replace("*",""),t=""!==e.subviewName,r=(t?1e3:0)+n.length;return-r})),a.length?a[0].value:null}var s={setElement:n.setElement};n.spawn=function(t,r){if(e.isString(t))t={name:t,data:r};else if(e.isUndefined(t.name))throw Error("Undefined message name.");t.source=n,t.data=e.isUndefined(t.data)?{}:t.data,this.trigger(t.name,t.data);var i,s,o="!"===t.name.charAt(t.name.length-1),u=this._getParentView();for("removeButtonClicked"===t.name&&console.log("gotit");u;){if(e.isObject(u.onMessages)&&(s=a(u.onMessages,t,u),null!==s)){var l=s;if(e.isFunction(l)||(l=u[s]),!l)throw Error('Method "'+s+'" does not exist');var d=l.call(u,t.data,t.source,t.name);if(o)return d}i=o;var c=e.result(u,"passMessages");if(e.isObject(c)&&(s=a(c,t,u),null!==s)){if("."===s);else{if(!e.isString(s))throw new TypeError("Values of passMessages hash should be strings.");t.name=s}i=!0}if(!i)break;t.source=u,u=u._getParentView()}return o?void 0:void 0},e.isFunction(n._getParentView)||(n._getParentView=function(){for(var n=null,t=this.$el.parent();t.length>0&&t[0]!==i;){var r=t.data("view");if(r&&e.isFunction(r.render)){n=r;break}t=t.parent()}return n}),e.isFunction(n._getChildViewNamed)||(n._getChildViewNamed=function(n){return e.isObject(this.subviews)?this.subviews[n]:null}),n.setElement=function(e,r){var i=s.setElement.call(this,e,r);return t(n),i},n.$el&&t(n)},n.Courier}); \ No newline at end of file +!function(a,b){"function"==typeof define&&define.amd?define(["underscore","backbone","jquery"],b):"undefined"!=typeof exports?module.exports=b(require("underscore"),require("backbone"),require("backbone").$):b(a._,a.Backbone,a.jQuery||a.Zepto||a.$)}(this,function(a,b,c){var d=/^(\S+)\s*(.*)$/,e=a.isFunction(c)?c("body")[0]:null;return b.Courier={},b.Courier.add=function(b){function c(b){a.isFunction(b.$el.data)&&!b.$el.data("view")&&b.$el.data("view",b)}function f(b,c,e){var f=[];for(var g in b){var h=g.match(d),i=h[1],j=h[2],k=new RegExp("^"+i.replace(/\*/g,"[\\w]*")+"$");k.test(c.name)&&(""===j||e._getChildViewNamed(j)===c.source)&&f.push({eventName:i,subviewName:j,value:b[g]})}return f.length>1&&(f=a.sortBy(f,function(a){var b=a.eventName.replace("*",""),c=""!==a.subviewName,d=(c?1e3:0)+b.length;return-d})),f.length?f[0].value:null}var g={setElement:b.setElement};b.spawn=function(c,d){if(a.isString(c))c={name:c,data:d};else if(a.isUndefined(c.name))throw new Error("Undefined message name.");c.source=b,c.data=a.isUndefined(c.data)?{}:c.data,this.trigger(c.name,c.data);for(var e,g,h="!"===c.name.charAt(c.name.length-1),i=this._getParentView();i;){if(a.isObject(i.onMessages)&&(g=f(i.onMessages,c,i),null!==g)){var j=g;if(a.isFunction(j)||(j=i[g]),!j)throw new Error('Method "'+g+'" does not exist');var k=j.call(i,c.data,c.source,c.name);if(h)return k}e=h;var l=a.result(i,"passMessages");if(a.isObject(l)&&(g=f(l,c,i),null!==g)){if("."===g);else{if(!a.isString(g))throw new TypeError("Values of passMessages hash should be strings.");c.name=g}e=!0}if(!e)break;c.source=i,i=i._getParentView()}return void 0},a.isFunction(b._getParentView)||(b._getParentView=function(){for(var b=null,c=this.$el.parent();c.length>0&&c[0]!==e;){var d=c.data("view");if(d&&a.isFunction(d.render)){b=d;break}c=c.parent()}return b}),a.isFunction(b._getChildViewNamed)||(b._getChildViewNamed=function(b){return a.isObject(this.subviews)?this.subviews[b]:null}),b.setElement=function(a,d){var e=g.setElement.call(this,a,d);return c(b),e},b.$el&&c(b)},b.Courier}); \ No newline at end of file