From 7c5b25bd351d0d7774dda7dc5fc4a7e10d9d3286 Mon Sep 17 00:00:00 2001 From: gmac Date: Fri, 17 Jan 2014 22:40:00 -0500 Subject: [PATCH] Allowing Epoxy components to reference custom super-classes. --- backbone.epoxy.js | 38 +++++++++++++-------------- backbone.epoxy.min.js | 4 +-- backbone.epoxy.min.map | 2 +- package.json | 2 +- test.js | 58 ++++++++++++++++++++---------------------- 5 files changed, 49 insertions(+), 55 deletions(-) diff --git a/backbone.epoxy.js b/backbone.epoxy.js index cb237a1..90e114b 100644 --- a/backbone.epoxy.js +++ b/backbone.epoxy.js @@ -20,7 +20,7 @@ } }(this, function(_, Backbone) { - + // Epoxy namespace: var Epoxy = Backbone.Epoxy = {}; @@ -49,28 +49,25 @@ return extend; } }; - - // Partial application for calling method implementations of a super-class object: - function superClass(sup) { - return function(instance, method, args) { - return sup.prototype[ method ].apply(instance, args); - }; + + // Calls method implementations of a super-class object: + function _super(instance, method, args) { + return instance._super.prototype[method].apply(instance, args); } - - + // Epoxy.Model // ----------- var modelMap; - var modelSuper = superClass(Backbone.Model); var modelProps = ['computeds']; Epoxy.Model = Backbone.Model.extend({ - + _super: Backbone.Model, + // Backbone.Model constructor override: // configures computed model attributes around the underlying native Backbone model. constructor: function(attributes, options) { _.extend(this, _.pick(options||{}, modelProps)); - modelSuper(this, 'constructor', arguments); + _super(this, 'constructor', arguments); this.initComputeds(attributes, options); }, @@ -95,7 +92,7 @@ } // Default to native Backbone.Model get operation: - return modelSuper(this, 'get', arguments); + return _super(this, 'get', arguments); }, // Backbone.Model.set() override: @@ -124,13 +121,13 @@ } // Pass all resulting set params along to the underlying Backbone Model. - return modelSuper(this, 'set', [params, options]); + return _super(this, 'set', [params, options]); }, // Backbone.Model.toJSON() override: // adds a 'computed' option, specifying to include computed attributes. toJSON: function(options) { - var json = modelSuper(this, 'toJSON', arguments); + var json = _super(this, 'toJSON', arguments); if (options && options.computed) { _.each(this.c(), function(computed, attribute) { @@ -145,7 +142,7 @@ // clears all computed attributes before destroying. destroy: function() { this.clearComputeds(); - return modelSuper(this, 'destroy', arguments); + return _super(this, 'destroy', arguments); }, // Computed namespace manager: @@ -950,17 +947,16 @@ // Epoxy.View // ---------- var viewMap; - var viewSuper = superClass(Backbone.View); var viewProps = ['viewModel', 'bindings', 'bindingFilters', 'bindingHandlers', 'bindingSources', 'computeds']; - Epoxy.View = Backbone.View.extend({ - + _super: Backbone.View, + // Backbone.View constructor override: // sets up binding controls around call to super. constructor: function(options) { _.extend(this, _.pick(options||{}, viewProps)); - viewSuper(this, 'constructor', arguments); + _super(this, 'constructor', arguments); this.applyBindings(); }, @@ -1091,7 +1087,7 @@ // unbinds the view before performing native removal tasks. remove: function() { this.removeBindings(); - viewSuper(this, 'remove', arguments); + _super(this, 'remove', arguments); } }, mixins); diff --git a/backbone.epoxy.min.js b/backbone.epoxy.min.js index 19d1e74..ae03fc9 100644 --- a/backbone.epoxy.min.js +++ b/backbone.epoxy.min.js @@ -1,6 +1,6 @@ -// Backbone.Epoxy 1.0.5 +// Backbone.Epoxy 1.0.6 // (c) 2013 Greg MacWilliam // Freely distributed under the MIT license // http://epoxyjs.org -(function(t,n){"undefined"!=typeof exports?module.exports=n(require("underscore"),require("backbone")):"function"==typeof define&&define.amd?define(["underscore","backbone"],n):n(t._,t.Backbone)})(this,function(t,n){function e(t){return function(n,e,i){return t.prototype[e].apply(n,i)}}function i(n,e,o,r){for(var s in e)if(e.hasOwnProperty(s)){var u=e[s];if(n.hasComputed(s)){if(r.length&&t.contains(r,s))throw"Recursive setter: "+r.join(" > ");u=n.c()[s].set(u),u&&w(u)&&(o=i(n,u,o,r.concat(s)))}else o[s]=u}return o}function o(n,e,i,o){i=i||{},i.get&&b(i.get)&&(i._get=i.get),i.set&&b(i.set)&&(i._set=i.set),delete i.get,delete i.set,t.extend(this,i),this.model=n,this.name=e,this.deps=this.deps||[],o||this.init()}function r(n){return b(n)?n():(w(n)&&(n=t.clone(n),t.each(n,function(t,e){n[e]=r(t)})),n)}function s(t){return b(t)?{set:t}:t}function u(n){return function(){var e=arguments,i=b(n)?n:n.get,o=n.set;return function(n){return y(n)?i.apply(this,t.map(e,r)):e[0]((o?o:i).call(this,n))}}}function c(n,e,i,o,r){return(n=t.result(n,o))?(C(n)?(r=r?r+"_":"",e["$"+o]=function(){return j&&j.push([n,"change"]),n},t.each(n.toJSON({computed:!0}),function(t,o){e[r+o]=function(t){return a(n,o,t,i)}})):x(n)&&(e["$"+o]=function(){return j&&j.push([n,"reset add remove sort update"]),n}),n):void 0}function a(n,e,i,o){if(j&&j.push([n,"change:"+e]),!y(i)){if(!w(i)||_(i)||t.isDate(i)){var r=i;i={},i[e]=r}return o&&o.save?n.save(i,o):n.set(i,o)}return n.get(e)}function h(t,n){if(":el"===n)return t.$el;var e=t.$(n);return t.$el.is(n)&&(e=e.add(t.$el)),e}function l(n,e,i,o,r,s){try{var u=E[i]||(E[i]=Function("$f","$c","with($f){with($c){return{"+i+"}}}")),c=u(s,o)}catch(a){throw'Error parsing bindings: "'+i+'"\n>> '+a}var h=t.map(t.union(c.events||[],["change"]),function(t){return t+".epoxy"}).join(" ");t.each(c,function(t,i){if(r.hasOwnProperty(i))n.b().push(new p(e,r[i],t,h,o,c));else if(!S.hasOwnProperty(i))throw'binding handler "'+i+'" is not defined.'})}function f(t,n,e){return t&&t.hasOwnProperty(n)?y(e)?r(t[n]):t[n](e):void 0}function d(t,n){var e=[];if(n&&t)for(var i=0,o=n.length;o>i;i++)e.push(n[i]in t?t[n[i]]():null);return e}function p(n,e,i,o,s,u){var c=this,a=n[0].tagName.toLowerCase(),h="input"==a||"select"==a||"textarea"==a||"true"==n.prop("contenteditable"),l=[],f=function(t){c.set(c.$el,r(i),t)};if(c.$el=n,c.evt=o,t.extend(c,e),i=c.init(c.$el,r(i),s,u)||i,j=l,f(),j=null,h&&e.get&&b(i)&&c.$el.on(o,function(t){i(c.get(c.$el,r(i),t))}),l.length)for(var d=0,p=l.length;p>d;d++)c.listenTo(l[d][0],l[d][1],f)}var g,v=n.Epoxy={},m=Array.prototype,y=t.isUndefined,b=t.isFunction,w=t.isObject,_=t.isArray,C=function(t){return t instanceof n.Model},x=function(t){return t instanceof n.Collection},$=function(){},O={mixin:function(t){t=t||{};for(var n in this.prototype)this.prototype.hasOwnProperty(n)&&"constructor"!==n&&(t[n]=this.prototype[n]);return t}},k=e(n.Model),P=["computeds"];v.Model=n.Model.extend({constructor:function(n,e){t.extend(this,t.pick(e||{},P)),k(this,"constructor",arguments),this.initComputeds(n,e)},getCopy:function(n){return t.clone(this.get(n))},get:function(t){return g&&g.push(["change:"+t,this]),this.hasComputed(t)?this.c()[t].get():k(this,"get",arguments)},set:function(t,n,e){var o=t;return o&&!w(o)?(o={},o[t]=n):e=n,e=e||{},e.unset||(o=i(this,o,{},[])),k(this,"set",[o,e])},toJSON:function(n){var e=k(this,"toJSON",arguments);return n&&n.computed&&t.each(this.c(),function(t,n){e[n]=t.value}),e},destroy:function(){return this.clearComputeds(),k(this,"destroy",arguments)},c:function(){return this._c||(this._c={})},initComputeds:function(n){this.clearComputeds();var e=t.result(this,"computeds")||{};e=t.extend(e,t.pick(n||{},t.keys(e))),t.each(e,function(t,n){t._init=1,this.addComputed(n,t)},this),t.invoke(this.c(),"init")},addComputed:function(t,n,e){this.removeComputed(t);var i=n,r=i._init;if(b(n)){var s=2;i={},i._get=n,b(e)&&(i._set=e,s++),i.deps=m.slice.call(arguments,s)}return this.c()[t]=new o(this,t,i,r),this},hasComputed:function(t){return this.c().hasOwnProperty(t)},removeComputed:function(t){return this.hasComputed(t)&&(this.c()[t].dispose(),delete this.c()[t]),this},clearComputeds:function(){for(var t in this.c())this.removeComputed(t);return this},modifyArray:function(t,n,e){var i=this.get(t);if(_(i)&&b(m[n])){var o=m.slice.call(arguments,2),r=m[n].apply(i,o);return e=e||{},e.silent||this.trigger("change:"+t+" change",this,m,e),r}return null},modifyObject:function(t,n,e,i){var o=this.get(t),r=!1;return w(o)?(i=i||{},y(e)&&o.hasOwnProperty(n)?(delete o[n],r=!0):o[n]!==e&&(o[n]=e,r=!0),r&&!i.silent&&this.trigger("change:"+t+" change",this,o,i),o):null}},O),t.extend(o.prototype,n.Events,{init:function(){var n={},e=g=[];this.get(!0),g=null,e.length&&(t.each(e,function(e){var i=e[0],o=e[1];n[i]?t.contains(n[i],o)||n[i].push(o):n[i]=[o]}),t.each(n,function(n,e){for(var i=0,o=n.length;o>i;i++)this.listenTo(n[i],e,t.bind(this.get,this,!0))},this))},val:function(t){return this.model.get(t)},get:function(n){if(n===!0&&this._get){var e=this._get.apply(this.model,t.map(this.deps,this.val,this));this.change(e)}return this.value},set:function(t){if(this._get){if(this._set)return this._set.apply(this.model,arguments);throw"Cannot set read-only computed attribute."}return this.change(t),null},change:function(n){t.isEqual(n,this.value)||(this.value=n,this.model.trigger("change:"+this.name+" change",this.model))},dispose:function(){this.stopListening(),this.off(),this.model=this.value=null}});var B={optionText:"label",optionValue:"value"},E={},F={attr:s(function(t,n){t.attr(n)}),checked:s({get:function(n,e){var i=!!n.prop("checked"),o=n.val();if(this.isRadio(n))return o;if(_(e)){e=e.slice();var r=t.indexOf(e,o);return i&&0>r?e.push(o):!i&&r>-1&&e.splice(r,1),e}return i},set:function(n,e){var i=!!e;this.isRadio(n)?i=e==n.val():_(e)&&(i=t.contains(e,n.val())),n.prop("checked",i)},isRadio:function(t){return"radio"===t.attr("type").toLowerCase()}}),classes:s(function(n,e){t.each(e,function(t,e){n.toggleClass(e,!!t)})}),collection:s({init:function(t,n){if(!x(n)||!b(n.view))throw'Binding "collection" requires a Collection with a "view" constructor.';this.v={}},set:function(n,e,i){var o,r=this.v,s=e.models,u=j;if(j=null,i=i||e,C(i))if(r.hasOwnProperty(i.cid))r[i.cid].remove(),delete r[i.cid];else{r[i.cid]=o=new e.view({model:i});var c=t.indexOf(s,i),a=n.children();a.length>c?a.eq(c).before(o.$el):n.append(o.$el)}else if(x(i)){var h=s.length===t.size(r)&&e.every(function(t){return r.hasOwnProperty(t.cid)});n.children().detach();var l=document.createDocumentFragment();h?e.each(function(t){l.appendChild(r[t.cid].el)}):(this.clean(),e.each(function(t){r[t.cid]=o=new e.view({model:t}),l.appendChild(o.el)})),n.append(l)}j=u},clean:function(){for(var t in this.v)this.v.hasOwnProperty(t)&&(this.v[t].remove(),delete this.v[t])}}),css:s(function(t,n){t.css(n)}),disabled:s(function(t,n){t.prop("disabled",!!n)}),enabled:s(function(t,n){t.prop("disabled",!n)}),html:s(function(t,n){t.html(n)}),options:s({init:function(t,n,e,i){this.e=i.optionsEmpty,this.d=i.optionsDefault,this.v=i.value},set:function(n,e){var i=this,o=r(i.e),s=r(i.d),u=r(i.v),c=x(e)?e.models:e,a=c.length,h=!0,l="";a||s||!o?(s&&(c=[s].concat(c)),t.each(c,function(t){l+=i.opt(t,a)})):(l+=i.opt(o,a),h=!1),n.html(l).prop("disabled",!h).val(u);var f=n.val();i.v&&!t.isEqual(u,f)&&i.v(f)},opt:function(t){var n=t,e=t,i=B.optionText,o=B.optionValue;return w(t)&&(n=C(t)?t.get(i):t[i],e=C(t)?t.get(o):t[o]),['"].join("")},clean:function(){this.d=this.e=this.v=0}}),template:s({init:function(n,e,i){var o=n.find("script,template");return this.t=t.template(o.length?o.html():n.html()),_(e)?t.pick(i,e):void 0},set:function(t,n){n=C(n)?n.toJSON({computed:!0}):n,t.html(this.t(n))},clean:function(){this.t=null}}),text:s(function(t,n){t.text(n)}),toggle:s(function(t,n){t.toggle(!!n)}),value:s({get:function(t){return t.val()},set:function(t,n){try{t.val()!=n&&t.val(n)}catch(e){}}})},M={all:u(function(){for(var t=arguments,n=0,e=t.length;e>n;n++)if(!t[n])return!1;return!0}),any:u(function(){for(var t=arguments,n=0,e=t.length;e>n;n++)if(t[n])return!0;return!1}),length:u(function(t){return t.length||0}),none:u(function(){for(var t=arguments,n=0,e=t.length;e>n;n++)if(t[n])return!1;return!0}),not:u(function(t){return!t}),format:u(function(t){for(var n=arguments,e=1,i=n.length;i>e;e++)t=t.replace(RegExp("\\$"+e,"g"),n[e]);return t}),select:u(function(t,n,e){return t?n:e}),csv:u({get:function(t){return t+="",t?t.split(","):[]},set:function(t){return _(t)?t.join(","):t}}),integer:u(function(t){return t?parseInt(t,10):0}),decimal:u(function(t){return t?parseFloat(t):0})},S={events:1,optionsDefault:1,optionsEmpty:1};v.binding={allowedParams:S,addHandler:function(t,n){F[t]=s(n)},addFilter:function(t,n){M[t]=u(n)},config:function(n){t.extend(B,n)},emptyCache:function(){E={}}};var j,q=e(n.View),N=["viewModel","bindings","bindingFilters","bindingHandlers","bindingSources","computeds"];return v.View=n.View.extend({constructor:function(n){t.extend(this,t.pick(n||{},N)),q(this,"constructor",arguments),this.applyBindings()},b:function(){return this._b||(this._b=[])},bindings:"data-bind",setterOptions:null,applyBindings:function(){this.removeBindings();var e=this,i=t.clone(t.result(e,"bindingSources")),o=e.bindings,r=e.setterOptions,a=t.clone(F),f=t.clone(M),p=e._c={};t.each(t.result(e,"bindingHandlers")||{},function(t,n){a[n]=s(t)}),t.each(t.result(e,"bindingFilters")||{},function(t,n){f[n]=u(t)}),e.model=c(e,p,r,"model"),e.viewModel=c(e,p,r,"viewModel"),e.collection=c(e,p,r,"collection"),i&&(t.each(i,function(t,n){i[n]=c(i,p,r,n,n)}),e.bindingSources=i),t.each(t.result(e,"computeds")||{},function(t,n){var i=b(t)?t:t.get,o=t.set,r=t.deps;p[n]=function(t){return!y(t)&&o?o.call(e,t):i.apply(e,d(e._c,r))}}),w(o)?t.each(o,function(t,n){var i=h(e,n);i.length&&l(e,i,t,p,a,f)}):h(e,"["+o+"]").each(function(){var t=n.$(this);l(e,t,t.attr(o),p,a,f)})},getBinding:function(t){return f(this._c,t)},setBinding:function(t,n){return f(this._c,t,n)},removeBindings:function(){if(this._c=null,this._b)for(;this._b.length;)this._b.pop().dispose()},remove:function(){this.removeBindings(),q(this,"remove",arguments)}},O),t.extend(p.prototype,n.Events,{init:$,get:$,set:$,clean:$,dispose:function(){this.clean(),this.stopListening(),this.$el.off(this.evt),this.$el=null}}),v}); +(function(t,e){"undefined"!=typeof exports?module.exports=e(require("underscore"),require("backbone")):"function"==typeof define&&define.amd?define(["underscore","backbone"],e):e(t._,t.Backbone)})(this,function(t,e){function n(t,e,n){return t._super.prototype[e].apply(t,n)}function i(e,n,r,o){for(var s in n)if(n.hasOwnProperty(s)){var u=n[s];if(e.hasComputed(s)){if(o.length&&t.contains(o,s))throw"Recursive setter: "+o.join(" > ");u=e.c()[s].set(u),u&&w(u)&&(r=i(e,u,r,o.concat(s)))}else r[s]=u}return r}function r(e,n,i,r){i=i||{},i.get&&b(i.get)&&(i._get=i.get),i.set&&b(i.set)&&(i._set=i.set),delete i.get,delete i.set,t.extend(this,i),this.model=e,this.name=n,this.deps=this.deps||[],r||this.init()}function o(e){return b(e)?e():(w(e)&&(e=t.clone(e),t.each(e,function(t,n){e[n]=o(t)})),e)}function s(t){return b(t)?{set:t}:t}function u(e){return function(){var n=arguments,i=b(e)?e:e.get,r=e.set;return function(e){return y(e)?i.apply(this,t.map(n,o)):n[0]((r?r:i).call(this,e))}}}function c(e,n,i,r,o){return(e=t.result(e,r))?(C(e)?(o=o?o+"_":"",n["$"+r]=function(){return S&&S.push([e,"change"]),e},t.each(e.toJSON({computed:!0}),function(t,r){n[o+r]=function(t){return a(e,r,t,i)}})):x(e)&&(n["$"+r]=function(){return S&&S.push([e,"reset add remove sort update"]),e}),e):void 0}function a(e,n,i,r){if(S&&S.push([e,"change:"+n]),!y(i)){if(!w(i)||_(i)||t.isDate(i)){var o=i;i={},i[n]=o}return r&&r.save?e.save(i,r):e.set(i,r)}return e.get(n)}function h(t,e){if(":el"===e)return t.$el;var n=t.$(e);return t.$el.is(e)&&(n=n.add(t.$el)),n}function l(e,n,i,r,o,s){try{var u=B[i]||(B[i]=Function("$f","$c","with($f){with($c){return{"+i+"}}}")),c=u(s,r)}catch(a){throw'Error parsing bindings: "'+i+'"\n>> '+a}var h=t.map(t.union(c.events||[],["change"]),function(t){return t+".epoxy"}).join(" ");t.each(c,function(t,i){if(o.hasOwnProperty(i))e.b().push(new p(n,o[i],t,h,r,c));else if(!M.hasOwnProperty(i))throw'binding handler "'+i+'" is not defined.'})}function f(t,e,n){return t&&t.hasOwnProperty(e)?y(n)?o(t[e]):t[e](n):void 0}function d(t,e){var n=[];if(e&&t)for(var i=0,r=e.length;r>i;i++)n.push(e[i]in t?t[e[i]]():null);return n}function p(e,n,i,r,s,u){var c=this,a=e[0].tagName.toLowerCase(),h="input"==a||"select"==a||"textarea"==a||"true"==e.prop("contenteditable"),l=[],f=function(t){c.set(c.$el,o(i),t)};if(c.$el=e,c.evt=r,t.extend(c,n),i=c.init(c.$el,o(i),s,u)||i,S=l,f(),S=null,h&&n.get&&b(i)&&c.$el.on(r,function(t){i(c.get(c.$el,o(i),t))}),l.length)for(var d=0,p=l.length;p>d;d++)c.listenTo(l[d][0],l[d][1],f)}var g,v=e.Epoxy={},m=Array.prototype,y=t.isUndefined,b=t.isFunction,w=t.isObject,_=t.isArray,C=function(t){return t instanceof e.Model},x=function(t){return t instanceof e.Collection},$=function(){},O={mixin:function(t){t=t||{};for(var e in this.prototype)this.prototype.hasOwnProperty(e)&&"constructor"!==e&&(t[e]=this.prototype[e]);return t}},k=["computeds"];v.Model=e.Model.extend({_super:e.Model,constructor:function(e,i){t.extend(this,t.pick(i||{},k)),n(this,"constructor",arguments),this.initComputeds(e,i)},getCopy:function(e){return t.clone(this.get(e))},get:function(t){return g&&g.push(["change:"+t,this]),this.hasComputed(t)?this.c()[t].get():n(this,"get",arguments)},set:function(t,e,r){var o=t;return o&&!w(o)?(o={},o[t]=e):r=e,r=r||{},r.unset||(o=i(this,o,{},[])),n(this,"set",[o,r])},toJSON:function(e){var i=n(this,"toJSON",arguments);return e&&e.computed&&t.each(this.c(),function(t,e){i[e]=t.value}),i},destroy:function(){return this.clearComputeds(),n(this,"destroy",arguments)},c:function(){return this._c||(this._c={})},initComputeds:function(e){this.clearComputeds();var n=t.result(this,"computeds")||{};n=t.extend(n,t.pick(e||{},t.keys(n))),t.each(n,function(t,e){t._init=1,this.addComputed(e,t)},this),t.invoke(this.c(),"init")},addComputed:function(t,e,n){this.removeComputed(t);var i=e,o=i._init;if(b(e)){var s=2;i={},i._get=e,b(n)&&(i._set=n,s++),i.deps=m.slice.call(arguments,s)}return this.c()[t]=new r(this,t,i,o),this},hasComputed:function(t){return this.c().hasOwnProperty(t)},removeComputed:function(t){return this.hasComputed(t)&&(this.c()[t].dispose(),delete this.c()[t]),this},clearComputeds:function(){for(var t in this.c())this.removeComputed(t);return this},modifyArray:function(t,e,n){var i=this.get(t);if(_(i)&&b(m[e])){var r=m.slice.call(arguments,2),o=m[e].apply(i,r);return n=n||{},n.silent||this.trigger("change:"+t+" change",this,m,n),o}return null},modifyObject:function(t,e,n,i){var r=this.get(t),o=!1;return w(r)?(i=i||{},y(n)&&r.hasOwnProperty(e)?(delete r[e],o=!0):r[e]!==n&&(r[e]=n,o=!0),o&&!i.silent&&this.trigger("change:"+t+" change",this,r,i),r):null}},O),t.extend(r.prototype,e.Events,{init:function(){var e={},n=g=[];this.get(!0),g=null,n.length&&(t.each(n,function(n){var i=n[0],r=n[1];e[i]?t.contains(e[i],r)||e[i].push(r):e[i]=[r]}),t.each(e,function(e,n){for(var i=0,r=e.length;r>i;i++)this.listenTo(e[i],n,t.bind(this.get,this,!0))},this))},val:function(t){return this.model.get(t)},get:function(e){if(e===!0&&this._get){var n=this._get.apply(this.model,t.map(this.deps,this.val,this));this.change(n)}return this.value},set:function(t){if(this._get){if(this._set)return this._set.apply(this.model,arguments);throw"Cannot set read-only computed attribute."}return this.change(t),null},change:function(e){t.isEqual(e,this.value)||(this.value=e,this.model.trigger("change:"+this.name+" change",this.model))},dispose:function(){this.stopListening(),this.off(),this.model=this.value=null}});var P={optionText:"label",optionValue:"value"},B={},E={attr:s(function(t,e){t.attr(e)}),checked:s({get:function(e,n){var i=!!e.prop("checked"),r=e.val();if(this.isRadio(e))return r;if(_(n)){n=n.slice();var o=t.indexOf(n,r);return i&&0>o?n.push(r):!i&&o>-1&&n.splice(o,1),n}return i},set:function(e,n){var i=!!n;this.isRadio(e)?i=n==e.val():_(n)&&(i=t.contains(n,e.val())),e.prop("checked",i)},isRadio:function(t){return"radio"===t.attr("type").toLowerCase()}}),classes:s(function(e,n){t.each(n,function(t,n){e.toggleClass(n,!!t)})}),collection:s({init:function(t,e){if(!x(e)||!b(e.view))throw'Binding "collection" requires a Collection with a "view" constructor.';this.v={}},set:function(e,n,i){var r,o=this.v,s=n.models,u=S;if(S=null,i=i||n,C(i))if(o.hasOwnProperty(i.cid))o[i.cid].remove(),delete o[i.cid];else{o[i.cid]=r=new n.view({model:i});var c=t.indexOf(s,i),a=e.children();a.length>c?a.eq(c).before(r.$el):e.append(r.$el)}else if(x(i)){var h=s.length===t.size(o)&&n.every(function(t){return o.hasOwnProperty(t.cid)});e.children().detach();var l=document.createDocumentFragment();h?n.each(function(t){l.appendChild(o[t.cid].el)}):(this.clean(),n.each(function(t){o[t.cid]=r=new n.view({model:t}),l.appendChild(r.el)})),e.append(l)}S=u},clean:function(){for(var t in this.v)this.v.hasOwnProperty(t)&&(this.v[t].remove(),delete this.v[t])}}),css:s(function(t,e){t.css(e)}),disabled:s(function(t,e){t.prop("disabled",!!e)}),enabled:s(function(t,e){t.prop("disabled",!e)}),html:s(function(t,e){t.html(e)}),options:s({init:function(t,e,n,i){this.e=i.optionsEmpty,this.d=i.optionsDefault,this.v=i.value},set:function(e,n){var i=this,r=o(i.e),s=o(i.d),u=o(i.v),c=x(n)?n.models:n,a=c.length,h=!0,l="";a||s||!r?(s&&(c=[s].concat(c)),t.each(c,function(t){l+=i.opt(t,a)})):(l+=i.opt(r,a),h=!1),e.html(l).prop("disabled",!h).val(u);var f=e.val();i.v&&!t.isEqual(u,f)&&i.v(f)},opt:function(t){var e=t,n=t,i=P.optionText,r=P.optionValue;return w(t)&&(e=C(t)?t.get(i):t[i],n=C(t)?t.get(r):t[r]),['"].join("")},clean:function(){this.d=this.e=this.v=0}}),template:s({init:function(e,n,i){var r=e.find("script,template");return this.t=t.template(r.length?r.html():e.html()),_(n)?t.pick(i,n):void 0},set:function(t,e){e=C(e)?e.toJSON({computed:!0}):e,t.html(this.t(e))},clean:function(){this.t=null}}),text:s(function(t,e){t.text(e)}),toggle:s(function(t,e){t.toggle(!!e)}),value:s({get:function(t){return t.val()},set:function(t,e){try{t.val()!=e&&t.val(e)}catch(n){}}})},F={all:u(function(){for(var t=arguments,e=0,n=t.length;n>e;e++)if(!t[e])return!1;return!0}),any:u(function(){for(var t=arguments,e=0,n=t.length;n>e;e++)if(t[e])return!0;return!1}),length:u(function(t){return t.length||0}),none:u(function(){for(var t=arguments,e=0,n=t.length;n>e;e++)if(t[e])return!1;return!0}),not:u(function(t){return!t}),format:u(function(t){for(var e=arguments,n=1,i=e.length;i>n;n++)t=t.replace(RegExp("\\$"+n,"g"),e[n]);return t}),select:u(function(t,e,n){return t?e:n}),csv:u({get:function(t){return t+="",t?t.split(","):[]},set:function(t){return _(t)?t.join(","):t}}),integer:u(function(t){return t?parseInt(t,10):0}),decimal:u(function(t){return t?parseFloat(t):0})},M={events:1,optionsDefault:1,optionsEmpty:1};v.binding={allowedParams:M,addHandler:function(t,e){E[t]=s(e)},addFilter:function(t,e){F[t]=u(e)},config:function(e){t.extend(P,e)},emptyCache:function(){B={}}};var S,j=["viewModel","bindings","bindingFilters","bindingHandlers","bindingSources","computeds"];return v.View=e.View.extend({_super:e.View,constructor:function(e){t.extend(this,t.pick(e||{},j)),n(this,"constructor",arguments),this.applyBindings()},b:function(){return this._b||(this._b=[])},bindings:"data-bind",setterOptions:null,applyBindings:function(){this.removeBindings();var n=this,i=t.clone(t.result(n,"bindingSources")),r=n.bindings,o=n.setterOptions,a=t.clone(E),f=t.clone(F),p=n._c={};t.each(t.result(n,"bindingHandlers")||{},function(t,e){a[e]=s(t)}),t.each(t.result(n,"bindingFilters")||{},function(t,e){f[e]=u(t)}),n.model=c(n,p,o,"model"),n.viewModel=c(n,p,o,"viewModel"),n.collection=c(n,p,o,"collection"),i&&(t.each(i,function(t,e){i[e]=c(i,p,o,e,e)}),n.bindingSources=i),t.each(t.result(n,"computeds")||{},function(t,e){var i=b(t)?t:t.get,r=t.set,o=t.deps;p[e]=function(t){return!y(t)&&r?r.call(n,t):i.apply(n,d(n._c,o))}}),w(r)?t.each(r,function(t,e){var i=h(n,e);i.length&&l(n,i,t,p,a,f)}):h(n,"["+r+"]").each(function(){var t=e.$(this);l(n,t,t.attr(r),p,a,f)})},getBinding:function(t){return f(this._c,t)},setBinding:function(t,e){return f(this._c,t,e)},removeBindings:function(){if(this._c=null,this._b)for(;this._b.length;)this._b.pop().dispose()},remove:function(){this.removeBindings(),n(this,"remove",arguments)}},O),t.extend(p.prototype,e.Events,{init:$,get:$,set:$,clean:$,dispose:function(){this.clean(),this.stopListening(),this.$el.off(this.evt),this.$el=null}}),v}); //@ sourceMappingURL=backbone.epoxy.min.map \ No newline at end of file diff --git a/backbone.epoxy.min.map b/backbone.epoxy.min.map index e36bc94..cc580c7 100644 --- a/backbone.epoxy.min.map +++ b/backbone.epoxy.min.map @@ -1 +1 @@ -{"version":3,"file":"backbone.epoxy.min.js","sources":["backbone.epoxy.js"],"names":["root","factory","exports","module","require","define","amd","_","Backbone","this","superClass","sup","instance","method","args","prototype","apply","deepModelSet","model","toSet","toReturn","stack","attribute","hasOwnProperty","value","hasComputed","length","contains","join","c","set","isObject","concat","EpoxyComputedModel","name","params","delayInit","get","isFunction","_get","_set","extend","deps","init","readAccessor","accessor","clone","each","key","makeHandler","handler","makeFilter","arguments","read","write","isUndefined","map","call","addSourceToViewContext","source","context","options","prefix","result","isModel","viewMap","push","toJSON","computed","accessViewDataAttribute","isCollection","isArray","isDate","val","save","queryViewForSelector","view","selector","$el","$elements","$","is","add","bindElementToView","$element","declarations","handlers","filters","parserFunct","bindingCache","Function","bindings","error","events","union","handlerName","b","EpoxyBinding","allowedParams","accessViewContext","getDepsFromViewContext","attributes","values","i","len","self","tag","toLowerCase","changable","prop","triggers","reset","target","evt","on","listenTo","modelMap","Epoxy","array","Array","obj","Model","Collection","blankMethod","mixins","mixin","modelSuper","modelProps","constructor","pick","initComputeds","getCopy","unset","json","destroy","clearComputeds","_c","computeds","keys","_init","addComputed","invoke","getter","setter","removeComputed","depsIndex","slice","dispose","modifyArray","silent","trigger","modifyObject","property","change","Events","targets","binding","bind","update","isEqual","stopListening","off","bindingSettings","optionText","optionValue","bindingHandlers","attr","checked","currentValue","isRadio","index","indexOf","splice","classes","enabled","className","toggleClass","collection","v","views","models","mapCache","cid","remove","$children","children","eq","before","append","sort","size","every","detach","frag","document","createDocumentFragment","appendChild","el","clean","id","css","disabled","html","e","optionsEmpty","d","optionsDefault","numOptions","option","opt","revisedValue","label","textAttr","valueAttr","template","raw","find","t","text","toggle","bindingFilters","all","any","none","not","format","str","replace","RegExp","select","condition","truthy","falsey","csv","String","split","integer","parseInt","decimal","parseFloat","addHandler","addFilter","config","settings","emptyCache","viewSuper","View","viewProps","applyBindings","_b","setterOptions","removeBindings","sources","filter","viewModel","sourceName","bindingSources","elementDecs","getBinding","setBinding","pop"],"mappings":"CAOC,SAASA,EAAMC,GAGQ,mBAAZC,SAEVC,OAAOD,QAAUD,EAAQG,QAAQ,cAAeA,QAAQ,aAC5B,kBAAXC,SAAyBA,OAAOC,IAEjDD,QAAQ,aAAc,YAAaJ,GAGnCA,EAAQD,EAAKO,EAAGP,EAAKQ,YAGrBC,KAAM,SAASF,EAAGC,GAgCnB,QAASE,GAAWC,GACnB,MAAO,UAASC,EAAUC,EAAQC,GACjC,MAAOH,GAAII,UAAWF,GAASG,MAAMJ,EAAUE,IAsPjD,QAASG,GAAaC,EAAOC,EAAOC,EAAUC,GAG7C,IAAK,GAAIC,KAAaH,GACrB,GAAIA,EAAMI,eAAeD,GAAY,CAGpC,GAAIE,GAAQL,EAAOG,EAEnB,IAAIJ,EAAMO,YAAYH,GAAY,CAIjC,GAAKD,EAAMK,QAAWnB,EAAEoB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,GAAGW,MAAMjH,WAOjBoC,OAAQ,WACP9K,KAAKkP,iBACLN,EAAU5O,KAAM,SAAU2C,aAGzBwE,GA+MHrH,EAAEkC,OAAOwD,EAAalF,UAAWP,EAASkJ,QAIzC/G,KAAMgF,EACNtF,IAAKsF,EACL7F,IAAK6F,EACL2E,MAAO3E,EAIPwB,QAAS,WACR1I,KAAK6L,QACL7L,KAAKuJ,gBACLvJ,KAAKqE,IAAImF,IAAIxJ,KAAKwG,KAClBxG,KAAKqE,IAAM,QAINuC","sourceRoot":"./"} \ No newline at end of file +{"version":3,"file":"backbone.epoxy.min.js","sources":["backbone.epoxy.js"],"names":["root","factory","exports","module","require","define","amd","_","Backbone","this","_super","instance","method","args","prototype","apply","deepModelSet","model","toSet","toReturn","stack","attribute","hasOwnProperty","value","hasComputed","length","contains","join","c","set","isObject","concat","EpoxyComputedModel","name","params","delayInit","get","isFunction","_get","_set","extend","deps","init","readAccessor","accessor","clone","each","key","makeHandler","handler","makeFilter","arguments","read","write","isUndefined","map","call","addSourceToViewContext","source","context","options","prefix","result","isModel","viewMap","push","toJSON","computed","accessViewDataAttribute","isCollection","isArray","isDate","val","save","queryViewForSelector","view","selector","$el","$elements","$","is","add","bindElementToView","$element","declarations","handlers","filters","parserFunct","bindingCache","Function","bindings","error","events","union","handlerName","b","EpoxyBinding","allowedParams","accessViewContext","getDepsFromViewContext","attributes","values","i","len","self","tag","toLowerCase","changable","prop","triggers","reset","target","evt","on","listenTo","modelMap","Epoxy","array","Array","obj","Model","Collection","blankMethod","mixins","mixin","modelProps","constructor","pick","initComputeds","getCopy","unset","json","destroy","clearComputeds","_c","computeds","keys","_init","addComputed","invoke","getter","setter","removeComputed","depsIndex","slice","dispose","modifyArray","silent","trigger","modifyObject","property","change","Events","targets","binding","bind","update","isEqual","stopListening","off","bindingSettings","optionText","optionValue","bindingHandlers","attr","checked","currentValue","isRadio","index","indexOf","splice","classes","enabled","className","toggleClass","collection","v","views","models","mapCache","cid","remove","$children","children","eq","before","append","sort","size","every","detach","frag","document","createDocumentFragment","appendChild","el","clean","id","css","disabled","html","e","optionsEmpty","d","optionsDefault","numOptions","option","opt","revisedValue","label","textAttr","valueAttr","template","raw","find","t","text","toggle","bindingFilters","all","any","none","not","format","str","replace","RegExp","select","condition","truthy","falsey","csv","String","split","integer","parseInt","decimal","parseFloat","addHandler","addFilter","config","settings","emptyCache","viewProps","View","applyBindings","_b","setterOptions","removeBindings","sources","filter","viewModel","sourceName","bindingSources","elementDecs","getBinding","setBinding","pop"],"mappings":"CAOC,SAASA,EAAMC,GAGQ,mBAAZC,SAEVC,OAAOD,QAAUD,EAAQG,QAAQ,cAAeA,QAAQ,aAC5B,kBAAXC,SAAyBA,OAAOC,IAEjDD,QAAQ,aAAc,YAAaJ,GAGnCA,EAAQD,EAAKO,EAAGP,EAAKQ,YAGrBC,KAAM,SAASF,EAAGC,GAgCnB,QAASE,GAAOC,EAAUC,EAAQC,GACjC,MAAOF,GAASD,OAAOI,UAAUF,GAAQG,MAAMJ,EAAUE,GAoP1D,QAASG,GAAaC,EAAOC,EAAOC,EAAUC,GAG7C,IAAK,GAAIC,KAAaH,GACrB,GAAIA,EAAMI,eAAeD,GAAY,CAGpC,GAAIE,GAAQL,EAAOG,EAEnB,IAAIJ,EAAMO,YAAYH,GAAY,CAIjC,GAAKD,EAAMK,QAAWlB,EAAEmB,SAASN,EAAOC,GAevC,KAAM,qBAAqBD,EAAMO,KAAK,MAXtCJ,GAAQN,EAAMW,IAAIP,GAAWQ,IAAIN,GAI7BA,GAASO,EAASP,KACrBJ,EAAWH,EAAaC,EAAOM,EAAOJ,EAAUC,EAAMW,OAAOV,SAY/DF,GAAUE,GAAcE,EAK3B,MAAOJ,GASR,QAASa,GAAmBf,EAAOgB,EAAMC,EAAQC,GAChDD,EAASA,MAGLA,EAAOE,KAAOC,EAAWH,EAAOE,OACnCF,EAAOI,KAAOJ,EAAOE,KAIlBF,EAAOL,KAAOQ,EAAWH,EAAOL,OACnCK,EAAOK,K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- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "jQuery": "~1.7.4" }, "main": "backbone.epoxy.js", - "version": "1.0.5", + "version": "1.0.6", "devDependencies": { "grunt": "~0.4.1", "grunt-contrib-uglify": "~0.1.2", diff --git a/test.js b/test.js index 3dfdd49..5d0dc66 100644 --- a/test.js +++ b/test.js @@ -64,25 +64,6 @@ describe("Backbone.Epoxy.Model", function() { } }); - var MixinModel = Backbone.Model.extend({ - defaults: { - avgPayment: 500 - }, - - initialize: function() { - this.initComputeds(); - }, - - computeds: { - avgPaymentDsp: function() { - return "$"+this.get( "avgPayment" ); - } - } - }); - - Backbone.Epoxy.Model.mixin( MixinModel.prototype ); - - // Setup beforeEach(function() { model = new TestModel(); @@ -116,7 +97,25 @@ describe("Backbone.Epoxy.Model", function() { }); it("should allow Epoxy model configuration to mixin with another Backbone Model.", function() { + var MixinModel = Backbone.Model.extend({ + defaults: { + avgPayment: 500 + }, + + initialize: function() { + this.initComputeds(); + }, + + computeds: { + avgPaymentDsp: function() { + return "$"+this.get( "avgPayment" ); + } + } + }); + + Backbone.Epoxy.Model.mixin( MixinModel.prototype ); var model = new MixinModel(); + expect( model.get("avgPaymentDsp") ).to.equal( "$500" ); }); @@ -502,17 +501,6 @@ describe("Backbone.Epoxy.View", function() { })); - var MixinView = Backbone.View.extend({ - el: "
", - model: new Backbone.Model({ship:"Deathstar"}), - initialize: function() { - this.applyBindings(); - } - }); - - Backbone.Epoxy.View.mixin( MixinView.prototype ); - - // Setup beforeEach(function() { @@ -561,7 +549,17 @@ describe("Backbone.Epoxy.View", function() { it("should allow Epoxy view configuration to mixin with another Backbone View.", function() { + var MixinView = Backbone.View.extend({ + el: "
", + model: new Backbone.Model({ship:"Deathstar"}), + initialize: function() { + this.applyBindings(); + } + }); + + Backbone.Epoxy.View.mixin( MixinView.prototype ); var view = new MixinView(); + expect( view.$el.text() ).to.equal( "Deathstar" ); });