jskit_rails 3.4.4 → 3.5.0

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: 4fcfce94742bf9829dd1e0c517de97146aca4db6
4
- data.tar.gz: cc6d892ae9c929b5a87127ea3c38eecd0dbe2c59
3
+ metadata.gz: 44613ca64096857e6fc670da585ff513e0a42237
4
+ data.tar.gz: 2393a1181c2c5f3a700b088adb65e8a4259b6749
5
5
  SHA512:
6
- metadata.gz: be208d53f297891e9dea46420c375afd7500313ca093b6c681c293f0bba85a6e32bef0e8817eda822f1023bc65cc6b91e359c515e1fe184169bbd060c5acd705
7
- data.tar.gz: 052183c12a892e90a577e65ae03eaa022e9f6df7ac0fb1e05cd0cd51be7ee4a77134ef258b6770f85b099a6b6151970ff19158e6dc8f33ba055c192846582ea0
6
+ metadata.gz: c4e033fb9de9a10a1766cbc2ac81d34456cb5fc38f4ccff64c291dbb93ca253ee109e63b8f4fb03fa3dcaee15c44771dff91b4f844158dbe4e07097aab05dfe5
7
+ data.tar.gz: 8326bef2fce3b5b86c27884ec148eba35c54b1bc892040c91f841f35649ea6d816bc387fc4b18747f5bc92bf884e64e97e70a291d50adc396f18b929031dd62c
@@ -172,7 +172,7 @@ JSKit.Controller = (function() {
172
172
  if (!dispatcher) throw new Error(this.className + ": dispatcher is undefined");
173
173
  assign(this, attrs, this);
174
174
  this.dispatcher = dispatcher;
175
- bindAll(this);
175
+ bindAll.apply(this, [this].concat(functions(this)));
176
176
 
177
177
  setControllerDefaults.call(this);
178
178
  this.actions.unshift("all");
@@ -1 +1 @@
1
- var JSKit={};JSKit.Dispatcher=function(){function t(){this.__events__={}}return _.assign(t.prototype,{on:function(t,n,e){var i={context:e||null,handler:n},r=this.__events__[t]=this.__events__[t]||[];_.contains(_.pluck(r,"handler"),n)||r.push(i)},off:function(t,n){var e=this.__events__[t];this.__events__[t]=n?_.reject(e,function(t){return t.handler!==n}):[]},trigger:function(t){var n=this.__events__[t]||[],e=_.rest(arguments);_.each(n,function(t){var n=t.handler,i=t.context;n.apply(i,e)})}}),t}(),JSKit.TestDispatcher=function(){function t(t){return t.called=!1,t.callCount=0,t.calls=[],t}function n(t){var n,e;return n=h(t)?t:a(l(t)),e=h(t)?t:a(f(t)),{name:n,method:e}}function e(t){var e=n(t);return h(t)?'"'+t+'"':"{ "+e.name+': "'+e.method+'" }'}function i(){this.listeners=[],this.events={},this.shadowDispatcher=new JSKit.Dispatcher}var r=_.assign,s=(_.clone,_.contains),o=_.each,a=_.first,c=_.functions,h=_.isString,l=_.keys,u=_.map,p=(_.rest,_.toArray),f=_.values;return r(i.prototype,{on:function(n,e,i){s(this.listeners,i)||this.spyOnControllerMethods(i);var r=t(e);this.events[n]=this.events[n]||[],this.events[n].push(r),this.shadowDispatcher.on(n,function(){this.trackSpy(r,arguments)},this)},spyOnControllerMethods:function(n){var i=u(n.actions,function(t){return e(t)}),r=this;o(c(n),function(e){if(!s(i,e)){var o=n[e];n[e]=function(){return r.trackSpy(n[e],arguments),o.apply(n,arguments)},t(n[e])}},this),this.listeners.push(n)},trigger:function(t,n,e){this.shadowDispatcher.trigger(t,n,e)},trackSpy:function(t,n){t.callCount+=1,t.called=!0,t.calls.push({args:p(n)})},hasAction:function(t,i){var r=!1;if(t.actions.forEach(function(t){e(t)===e(i)&&(r=!0)}),!r)return!1;var s=n(i),o=t[s.method],a=t.actionEventName(s.name),c=o.callCount;return t.dispatcher.trigger(a),o.callCount>c},off:function(){}}),i}(),JSKit.Controller=function(){function t(t,n){if(!t)throw new Error(this.className+": dispatcher is undefined");u(this,n,this),this.dispatcher=t,a(this),o.call(this),this.actions.unshift("all"),s.call(this),this.initialize()}function n(t){if(t=t||"",t.match(/_|-|\s/)){var n=map(t.split(/_|-|\s/g),function(t,n){return n>0?t.charAt(0).toUpperCase()+t.slice(1):t.toLowerCase()}).join("");t=n}else t=t.toString();return t.charAt(0).toUpperCase()+t.slice(1)}function e(t){return t=t||"",t.replace(/([A-Z])/g," $1").replace(/^\s?/,"").replace(/-|\s/g,"_").toLowerCase()}function i(t){if(!f(this[t.method]))throw new Error(this.className+' action "'+t.name+this.eventSeparator+t.method+'" method is undefined')}function r(t){var n=m(t),e=n?p(d(t)):t,i=n?p(v(t)):t;return{name:i,method:e}}function s(){l(this.actions,function(t){var n=r(t);i.call(this,n),this.dispatcher.on(this.actionEventName(n.name),this[n.method],this)},this)}function o(){this.name=this.name||"Anonymous",h(this,{eventSeparator:":",actions:[],channel:"controller",className:n(this.name)+"Controller",controllerEventName:e(this.name)})}var a=_.bindAll,c=_.compact,h=_.defaults,l=_.each,u=_.assign,p=_.first,f=(_.functions,_.isFunction),m=_.isObject,v=_.keys,d=(_.uniq,_.values);return u(t.prototype,{initialize:function(){},all:function(){},actionEventName:function(t){return c([this.namespace,this.channel,this.controllerEventName,t]).join(this.eventSeparator)}}),t}(),JSKit.Application=function(){function t(){this.Controllers={},this.Dispatcher=new JSKit.Dispatcher}function n(t){if(t=t||"",t.match(/_|-|\s/)){var n=i(t.split(/_|-|\s/g),function(t,n){return n>0?t.charAt(0).toUpperCase()+t.slice(1):t.toLowerCase()}).join("");t=n}else t=t.toString();return t.charAt(0).toUpperCase()+t.slice(1)}var e=(_.clone,_.assign),i=(_.first,_.map);return t.prototype.createController=function(t,i){function r(){JSKit.Controller.apply(this,arguments)}var s=i.dispatcher||this.Dispatcher;return i.dispatcher&&delete i.dispatcher,t=n(t),e(i,{name:t}),e(r.prototype,JSKit.Controller.prototype,i),this[i.name+"Controller"]=r,this.Controllers[t]=new r(s,i),this.Controllers[t]},t}(),JSKit.createApplication=function(){return new JSKit.Application};
1
+ var JSKit={};JSKit.Dispatcher=function(){function t(){this.__events__={}}return _.assign(t.prototype,{on:function(t,n,e){var i={context:e||null,handler:n},r=this.__events__[t]=this.__events__[t]||[];_.contains(_.pluck(r,"handler"),n)||r.push(i)},off:function(t,n){var e=this.__events__[t];this.__events__[t]=n?_.reject(e,function(t){return t.handler!==n}):[]},trigger:function(t){var n=this.__events__[t]||[],e=_.rest(arguments);_.each(n,function(t){var n=t.handler,i=t.context;n.apply(i,e)})}}),t}(),JSKit.TestDispatcher=function(){function t(t){return t.called=!1,t.callCount=0,t.calls=[],t}function n(t){var n,e;return n=h(t)?t:a(l(t)),e=h(t)?t:a(f(t)),{name:n,method:e}}function e(t){var e=n(t);return h(t)?'"'+t+'"':"{ "+e.name+': "'+e.method+'" }'}function i(){this.listeners=[],this.events={},this.shadowDispatcher=new JSKit.Dispatcher}var r=_.assign,s=(_.clone,_.contains),o=_.each,a=_.first,c=_.functions,h=_.isString,l=_.keys,u=_.map,p=(_.rest,_.toArray),f=_.values;return r(i.prototype,{on:function(n,e,i){s(this.listeners,i)||this.spyOnControllerMethods(i);var r=t(e);this.events[n]=this.events[n]||[],this.events[n].push(r),this.shadowDispatcher.on(n,function(){this.trackSpy(r,arguments)},this)},spyOnControllerMethods:function(n){var i=u(n.actions,function(t){return e(t)}),r=this;o(c(n),function(e){if(!s(i,e)){var o=n[e];n[e]=function(){return r.trackSpy(n[e],arguments),o.apply(n,arguments)},t(n[e])}},this),this.listeners.push(n)},trigger:function(t,n,e){this.shadowDispatcher.trigger(t,n,e)},trackSpy:function(t,n){t.callCount+=1,t.called=!0,t.calls.push({args:p(n)})},hasAction:function(t,i){var r=!1;if(t.actions.forEach(function(t){e(t)===e(i)&&(r=!0)}),!r)return!1;var s=n(i),o=t[s.method],a=t.actionEventName(s.name),c=o.callCount;return t.dispatcher.trigger(a),o.callCount>c},off:function(){}}),i}(),JSKit.Controller=function(){function t(t,n){if(!t)throw new Error(this.className+": dispatcher is undefined");u(this,n,this),this.dispatcher=t,a.apply(this,[this].concat(f(this))),o.call(this),this.actions.unshift("all"),s.call(this),this.initialize()}function n(t){if(t=t||"",t.match(/_|-|\s/)){var n=map(t.split(/_|-|\s/g),function(t,n){return n>0?t.charAt(0).toUpperCase()+t.slice(1):t.toLowerCase()}).join("");t=n}else t=t.toString();return t.charAt(0).toUpperCase()+t.slice(1)}function e(t){return t=t||"",t.replace(/([A-Z])/g," $1").replace(/^\s?/,"").replace(/-|\s/g,"_").toLowerCase()}function i(t){if(!m(this[t.method]))throw new Error(this.className+' action "'+t.name+this.eventSeparator+t.method+'" method is undefined')}function r(t){var n=v(t),e=n?p(g(t)):t,i=n?p(d(t)):t;return{name:i,method:e}}function s(){l(this.actions,function(t){var n=r(t);i.call(this,n),this.dispatcher.on(this.actionEventName(n.name),this[n.method],this)},this)}function o(){this.name=this.name||"Anonymous",h(this,{eventSeparator:":",actions:[],channel:"controller",className:n(this.name)+"Controller",controllerEventName:e(this.name)})}var a=_.bindAll,c=_.compact,h=_.defaults,l=_.each,u=_.assign,p=_.first,f=_.functions,m=_.isFunction,v=_.isObject,d=_.keys,g=(_.uniq,_.values);return u(t.prototype,{initialize:function(){},all:function(){},actionEventName:function(t){return c([this.namespace,this.channel,this.controllerEventName,t]).join(this.eventSeparator)}}),t}(),JSKit.Application=function(){function t(){this.Controllers={},this.Dispatcher=new JSKit.Dispatcher}function n(t){if(t=t||"",t.match(/_|-|\s/)){var n=i(t.split(/_|-|\s/g),function(t,n){return n>0?t.charAt(0).toUpperCase()+t.slice(1):t.toLowerCase()}).join("");t=n}else t=t.toString();return t.charAt(0).toUpperCase()+t.slice(1)}var e=(_.clone,_.assign),i=(_.first,_.map);return t.prototype.createController=function(t,i){function r(){JSKit.Controller.apply(this,arguments)}var s=i.dispatcher||this.Dispatcher;return i.dispatcher&&delete i.dispatcher,t=n(t),e(i,{name:t}),e(r.prototype,JSKit.Controller.prototype,i),this[i.name+"Controller"]=r,this.Controllers[t]=new r(s,i),this.Controllers[t]},t}(),JSKit.createApplication=function(){return new JSKit.Application};
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jskit_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.4
4
+ version: 3.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dayton Nolan