dou-rails 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -3
- data/lib/dou/version.rb +1 -1
- data/vendor/assets/javascripts/dou-min.js +2 -1
- data/vendor/assets/javascripts/dou.js +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 033740aad93c74718fc2d9460fbb42f2b1e1d8ca
|
4
|
+
data.tar.gz: 1bf4cc27abefe419108cf3fcd80f0daf69a0fa54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcdd3059e9a5406418473856b7692bbeb339d12479ff3c9b8b270384cf579ad0b56067e9b9d4b6cad41c3c6b9289d45e20df02f8661778ea005a40994feee83f
|
7
|
+
data.tar.gz: 89d6f3d03bd778442c6859691e274e82a7bb54fa0eb4958b8cf9834cf5baf729d34972d8775373e3e550c1de8310d193c10ce40ca34312426400e3651f6a09c6
|
data/README.md
CHANGED
@@ -1,10 +1,13 @@
|
|
1
|
-
dou
|
2
|
-
|
3
|
-
|
1
|
+
dou
|
2
|
+
===========================
|
4
3
|
Light-weight javascript module framework
|
5
4
|
(Inspired by flight - A component-based, event-driven JavaScript framework from Twitter
|
6
5
|
http://flightjs.github.io/)
|
7
6
|
|
7
|
+
## dou means
|
8
|
+
都 (together) - Chinese
|
9
|
+
Do you .. - English
|
10
|
+
|
8
11
|
## Features
|
9
12
|
* Mixin base
|
10
13
|
|
data/lib/dou/version.rb
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
(function(){define(["./compose"],function(a){"use strict";var b;return b={around:function(a,b){return function(){var c,d,e,f,g,h;for(f=arguments.length,c=new Array(f+1),c[0]=a.bind(this),e=g=0,h=c.length;h>g;e=++g)d=c[e],c[e+1]=arguments[e];return b.apply(this,c)}},before:function(a,b){var c;return c="function"==typeof b?b:b.obj[b.fnName],function(){return c.apply(this,arguments),a.apply(this,arguments)}},after:function(a,b){var c;return c="function"==typeof b?b:b.obj[b.fnName],function(){var b;return b=(a.unbound||a).apply(this,arguments),c.apply(this,arguments),b}},withAdvice:function(){return["before","after","around"].forEach(function(c){return this[c]=function(d,e){return a.unlockProperty(this,d,function(){return this[d]="function"==typeof this[d]?b[c](this[d],e):e,this[d]})}},this)}}})}).call(this),function(){var a={}.hasOwnProperty;define(["./utils","./debug"],function(b,c){"use strict";var d,e,f,g,h,i;if(d=c.enabled&&!b.isEnumerable(Object,"getOwnPropertyDescriptor"),e=["mixedIn","mixingIn"],d)try{Object.getOwnPropertyDescriptor(Object,"keys")}catch(j){f=j,d=!1}return h=function(b,c){var f,g,h;if(d){h=Object.create(null);for(g in b)a.call(b,g)&&e.indexOf(0>g)&&(f=Object.getOwnPropertyDescriptor(b,g),f.writable=c,h[g]=f);return Object.defineProperties(b,h)}},i=function(a,b,c){var e;return d&&a.hasOwnProperty(b)?(e=Object.getOwnPropertyDescriptor(a,b).writable,Object.defineProperties(a,b,{writable:!0}),c.call(a),Object.defineProperties(a,b,{writable:e})):c.call(a)},g=function(a,b){var c,d;if(!(b instanceof Array))return this.mixin(a,[b]);for(a.mixedIn=a.hasOwnProperty("mixedIn")?a.mixedIn:[],a.mixingIn=a.hasOwnProperty("mixingIn")?a.mixingIn:[],h(a,!1),c=0,d=b.length;d>c;c++)if(g=b[c],-1===a.mixedIn.indexOf(g)){if(a.mixingIn.indexOf(g)>-1)throw new Error("found cyclic dependencies between "+a.mixingIn);a.mixingIn.push(g),g.call(a),a.mixingIn.pop(),a.mixedIn.push(g)}return h(a,!0)},{mixin:g,unlockProperty:i}})}.call(this),function(){var a={}.hasOwnProperty;define([],function(){"use strict";var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return m="undefined"==typeof window?{}:window,u=function(b,c,d){var e,f,g,h;d=d||{},e=d.obj||m,f=d.path||(e===m?"global":""),h=[];for(g in e)a.call(e,g)&&((t[b]||b)(c,e,g)&&console.log(""+f+"."+g+" -> ("+typeof e[g]+")",e[g]),h.push(e[g]&&"object"==typeof e[g]&&e[g]!==e?u(b,c,{obj:e[g],path:""+f+"."+g}):void 0));return h},r=function(a,b,c,d){return b&&typeof c!==b?console.error(""+c+" must be "+b):u(a,c,d)},t={name:function(a,b,c){return a===c},nameContains:function(a,b,c){return c.indexOf(a)>-1},type:function(a,b,c){return b[c]instanceof a},value:function(a,b,c){return b[c]===a},valueCoerced:function(a,b,c){return b[c]==a}},c=function(a,b){return r("name","string",a,b)},d=function(a,b){return r("nameContains","string",a,b)},e=function(a,b){return r("type","function",a,b)},f=function(a,b){return r("value",null,a,b)},g=function(a,b){return r("valueCoerced",null,a,b)},h=function(a,b){return u(a,null,b)},k=function(){var a;return a=[].slice.call(arguments),o.eventNames.length||(o.eventNames=b),o.actions=a.length?a:b,q()},l=function(){var a;return a=[].slice.call(arguments),o.actions.length||(o.actions=b),o.eventNames=a.length?a:b,q()},n=function(){return o.actions=[],o.eventNames=[],q()},s=function(){return o.actions=b,o.eventNames=b,q()},q=function(){return m.localStorage?(m.localStorage.setItem("logFilter_eventNames",o.eventNames),m.localStorage.setItem("logFilter_actions",o.actions)):void 0},p=function(){var c,d,e;d={eventNames:m.localStorage&&m.localStorage.getItem("logFilter_eventNames")||j,actions:m.localStorage&&m.localStorage.getItem("logFilter_actions")||i};for(c in d)a.call(d,c)&&(e=d[c],"string"==typeof e&&e!==b&&(d[c]=e.split(".")));return d},b="all",j=[],i=[],o=p(),{enable:function(a){return this.enabled=!!a,a&&m.console&&(console.info("Booting in DEBUG mode"),console.info("You can configure event logging with DEBUG.events.logAll()/logNone()/logByName()/logByAction()")),m.DEBUG=this},find:{byName:c,byNameContains:d,byType:e,byValue:f,byValueCoerced:g,custom:h},events:{logFilter:o,logByAction:k,logByName:l,logAll:s,logNone:n}}})}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};define(["./compose"],function(a){"use strict";var c;return c=function(c){var d;return d=c["extends"]?function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c}(c["extends"]):function(){function a(){}return a}(),c.mixins&&a.mixin(d.prototype,c.mixins),c.name&&(d.name=c.name),d},{define:c}})}.call(this),function(){define(["./utils"],function(a){"use strict";var b,c,d,e,f,g,h,i;h=[].slice,b={withEvent:function(){var a,c,d,e,f;for(e=["on","off","once","trigger"],f=[],c=0,d=e.length;d>c;c++)a=e[c],f.push(this[a]=b[a]);return f},on:function(a,b,c){var e;return d(this,"on",a,[b,c])&&b?(this._events||(this._events={}),e=this._events[a]||(this._events[a]=[]),e.push({callback:b,context:c,ctx:c||this}),this):this},once:function(b,c,e){var f,g;return d(this,"once",b,[c,e])&&c?(g=this,f=a.once(function(){return g.off(b,f),c.apply(this,arguments)}),f._callback=c,this.on(b,f,e)):this},off:function(a,b,c){var e,f,g,h,i,j,k,l,m,n;if(!this._events||!d(this,"off",a,[b,c]))return this;if(!a&&!b&&!c)return this._events=void 0,this;for(i=a?[a]:Object.keys(this._events),g=k=0,m=i.length;m>k;g=++k)if(a=i[g],f=this._events[a]){if(this._events[a]=j=[],b||c)for(h=l=0,n=f.length;n>l;h=++l)e=f[h],(b&&b!==e.callback&&b!==e.callback._callback||c&&c!==e.context)&&j.push(e);j.length||delete this._events[a]}return this},trigger:function(a){var b,c,e;return this._events?(c=h.call(arguments,1),d(this,"trigger",a,c)?(e=this._events[a],b=this._events.all,e&&i(e,c),b&&i(b,arguments),this):this):this},stopListening:function(a,b,c){var d,e,f;if(e=this._listeningTo,!e)return this;f=!b&&!c,c||"object"!=typeof b||(c=this),a&&((e={})[a._listenId]=a);for(d in e)a=e[d],a.off(b,c,this),(f||_.isEmpty(a._events))&&delete this._listeningTo[d];return this}},c=/\s+/,d=function(a,b,d,e){var f,g,h,i,j;if(!d)return!0;if("object"==typeof d){for(f in d)h=d[f],a[b].apply(a,[f,h].concat(e));return!1}if(c.test(d)){for(g=d.split(c),i=0,j=g.length;j>i;i++)h=g[i],a[b].apply(a,[h].concat(e));return!1}return!0},i=function(a,b){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(c.callback.apply(c.ctx,b));return f},f={listenTo:"on",listenToOnce:"once"};for(g in f)e=f[g],b[g]=function(b,c,d){var f,g;return g=this._listeningTo||(this._listeningTo={}),f=b._listenId||(b._listenId=a.uniqueId("l")),g[f]=b,d||"object"!=typeof c||(d=this),b[e](c,d,this),this};return b})}.call(this),function(){define(["./advice","./compose","./debug","./event","./lifecycle","./property","./serialize","./utils","./dou"],function(a,b,c,d,e,f,g,h,i){"use strict";return{advice:a,compose:b,debug:c,event:d,lifecycle:e,property:f,serialize:g,utils:h,dou:i}})}.call(this),function(){var a={}.hasOwnProperty;define(["./compose","./property"],function(b,c){"use strict";return function(){return b.mixin(this,c),this.initialize=function(b){var c,d,e,f;b||(b={}),c={};for(d in b)a.call(b,d)&&(e=b[d],c[d]=e);f=this.defaults;for(d in f)a.call(f,d)&&(e=f[d],c.hasOwnProperty(d)||(c[d]=e));return this.set(c),this},this.despose=function(){}}})}.call(this),function(){var a={}.hasOwnProperty;define(["./utils","./compose","./event"],function(b,c,d){"use strict";return function(){return c.mixin(this,d.withEvent),this.set=function(c,d){var e,f,g,h,i;if(!c)return this;if(arguments.length>1&&"string"==typeof arguments[0])return f={},f[c]=d,this.set(f);this.attrs||(this.attrs={}),f=c,e={},g={},h=this.attrs;for(c in h)a.call(h,c)&&(d=h[c],g[c]=d);b.push(this.attrs,f),i=this.attrs;for(c in i)a.call(i,c)&&(d=i[c],d!==g[c]?e[c]=d:delete g[c]);return 0!==Object.keys(e).length&&this.trigger("change",{before:g,after:e},!0),this},this.get=function(a){return this.attrs&&this.attrs[a]}}})}.call(this),function(){define(["./compose","./property"],function(a,b){"use strict";return function(){return a.mixin(this,b),this.serialize=function(){return["type: "+this.name,"id: "+this.id,"props: "+JSON.stringify(this.attrs)].join(",")},this.deserialize=function(){}}})}.call(this),function(){var a=[].slice,b={}.hasOwnProperty;define([],function(){"use strict";var c,d;return c=100,d=0,{merge:function(){var c,d,e,f,g,h,i;for(f=arguments[0],c=2<=arguments.length?a.call(arguments,1):[],f&&typeof f!==!1||(f={}),h=0,i=c.length;i>h;h++){e=c[h];for(d in e)b.call(e,d)&&(g=e[d],f[d]="object"!=typeof g?g:this.merge(f[d],g))}return f},push:function(a,c,d){var e,f;if(!a||!c)return a;for(e in c)if(b.call(c,e)){if(f=c[e],a[e]&&d)throw new Error('utils.push attempted to overwrite "'+e+'" while running in protected mode');"object"==typeof a[e]&&"object"==typeof c[e]?this.push(a[e],c[e]):a[e]=c[e]}return a},isEnumerable:function(a,b){return Object.keys(a).indexOf(b)>-1},compose:function(){var a;return a=arguments,function(){var b,c,d,e;for(b=arguments,c=d=e=a.length-1;0>=e?0>=d:d>=0;c=0>=e?++d:--d)b=a[c].apply(this,b);return b[0]}},uniqueArray:function(a){var b,c,d,e,f;for(d={},b=[],e=0,f=a.length;f>e;e++)c=a[e],d.hasOwnProperty(c)||(b.push(c),d[c]=1);return b},debounce:function(a,b,d){var e,f;return"number"!=typeof b&&(b=c),f=0,e=null,function(){var c,g,h,i;return h=this,c=arguments,i=function(){return f=null,d?void 0:e=a.apply(h,c)},g=d&&!f,clearTimeout(f),f=setTimeout(i,b),g&&(e=a.apply(h,c)),e}},throttle:function(a,b){var d,e,f,g,h,i,j;return"number"!=typeof b&&(b=c),e=d=i=h=f=g=null,j=this.debounce(function(){return f=h=!1},b),function(){var c;return e=this,d=arguments,c=function(){return i=null,f&&(g=a.apply(e,d)),j()},i||(i=setTimeout(c,b)),h?f=!0:(h=!0,g=a.apply(e,d)),j(),g}},countThen:function(a,b){return function(){return--a?void 0:b.apply(this,arguments)}},delegate:function(a){return function(c,d){var e,f,g;g=$(c.target),e=null;for(f in a)if(b.call(a,f)&&!c.isPropagationStopped()&&(e=g.closest(f)).length)return d=d||{},d.el=e[0],a[f].apply(this,[c,d])}},once:function(a){var b,c;return b=!1,c=null,function(){return b?c:(c=a.apply(this,arguments),b=!0,c)}},uniqueId:function(a){var b;return b=++d+"",a?a+b:b}}})}.call(this);
|
1
|
+
/*! Dou v0.0.4 | (c) Hatio, Lab. | MIT License */
|
2
|
+
!function(t){function n(){var t,n,e=Array.prototype.slice.call(arguments),i=[];"string"==typeof e[0]&&(t=e.shift()),o(e[0])&&(i=e.shift()),n=e.shift(),r[t]=[i,n]}function e(t){function n(n){var e=t.split("/"),r=n.split("/"),i=!1;for(e.pop();".."==r[0]&&e.length;)e.pop(),r.shift(),i=!0;return"."==r[0]&&(r.shift(),i=!0),i&&(r=e.concat(r)),r.join("/")}var o,s,c;return"undefined"==typeof i[t]&&(o=r[t],o&&(c=o[0],s=o[1],i[t]=s.apply(void 0,u(c,function(t){return e(n(t))})))),i[t]}var r={},i={},o=Array.isArray||function(t){return t.constructor==Array},u=Array.map||function(t,n,e){for(var r=0,i=t.length,o=[];i>r;r++)o.push(n.call(e,t[r]));return o};!function(){var t=[].slice,e={}.hasOwnProperty;n("build/js/utils",[],function(){"use strict";var n,r;return n=100,r=0,{merge:function(){var n,r,i,o,u,s,c;for(o=arguments[0],n=2<=arguments.length?t.call(arguments,1):[],o&&typeof o!==!1||(o={}),s=0,c=n.length;c>s;s++){i=n[s];for(r in i)e.call(i,r)&&(u=i[r],o[r]="object"!=typeof u?u:this.merge(o[r],u))}return o},push:function(t,n,r){var i,o;if(!t||!n)return t;for(i in n)if(e.call(n,i)){if(o=n[i],t[i]&&r)throw new Error('utils.push attempted to overwrite "'+i+'" while running in protected mode');"object"==typeof t[i]&&"object"==typeof n[i]?this.push(t[i],n[i]):t[i]=n[i]}return t},isEnumerable:function(t,n){return Object.keys(t).indexOf(n)>-1},compose:function(){var t;return t=arguments,function(){var n,e,r,i;for(n=arguments,e=r=i=t.length-1;0>=i?0>=r:r>=0;e=0>=i?++r:--r)n=t[e].apply(this,n);return n[0]}},uniqueArray:function(t){var n,e,r,i,o;for(r={},n=[],i=0,o=t.length;o>i;i++)e=t[i],r.hasOwnProperty(e)||(n.push(e),r[e]=1);return n},debounce:function(t,e,r){var i,o;return"number"!=typeof e&&(e=n),o=0,i=null,function(){var n,u,s,c;return s=this,n=arguments,c=function(){return o=null,r?void 0:i=t.apply(s,n)},u=r&&!o,clearTimeout(o),o=setTimeout(c,e),u&&(i=t.apply(s,n)),i}},throttle:function(t,e){var r,i,o,u,s,c,a;return"number"!=typeof e&&(e=n),i=r=c=s=o=u=null,a=this.debounce(function(){return o=s=!1},e),function(){var n;return i=this,r=arguments,n=function(){return c=null,o&&(u=t.apply(i,r)),a()},c||(c=setTimeout(n,e)),s?o=!0:(s=!0,u=t.apply(i,r)),a(),u}},countThen:function(t,n){return function(){return--t?void 0:n.apply(this,arguments)}},delegate:function(t){return function(n,r){var i,o,u;u=$(n.target),i=null;for(o in t)if(e.call(t,o)&&!n.isPropagationStopped()&&(i=u.closest(o)).length)return r=r||{},r.el=i[0],t[o].apply(this,[n,r])}},once:function(t){var n,e;return n=!1,e=null,function(){return n?e:(e=t.apply(this,arguments),n=!0,e)}},uniqueId:function(t){var n;return n=++r+"",t?t+n:n}}})}.call(this),function(){var t={}.hasOwnProperty;n("build/js/debug",[],function(){"use strict";var n,e,r,i,o,u,s,c,a,l,f,h,p,g,v,y,m,d,b,w;return h="undefined"==typeof window?{}:window,w=function(n,e,r){var i,o,u,s;r=r||{},i=r.obj||h,o=r.path||(i===h?"global":""),s=[];for(u in i)t.call(i,u)&&((b[n]||n)(e,i,u)&&console.log(""+o+"."+u+" -> ("+typeof i[u]+")",i[u]),i[u]&&"object"==typeof i[u]&&i[u]!==i?s.push(w(n,e,{obj:i[u],path:""+o+"."+u})):s.push(void 0));return s},m=function(t,n,e,r){return n&&typeof e!==n?console.error(""+e+" must be "+n):w(t,e,r)},b={name:function(t,n,e){return t===e},nameContains:function(t,n,e){return e.indexOf(t)>-1},type:function(t,n,e){return n[e]instanceof t},value:function(t,n,e){return n[e]===t},valueCoerced:function(t,n,e){return n[e]==t}},e=function(t,n){return m("name","string",t,n)},r=function(t,n){return m("nameContains","string",t,n)},i=function(t,n){return m("type","function",t,n)},o=function(t,n){return m("value",null,t,n)},u=function(t,n){return m("valueCoerced",null,t,n)},s=function(t,n){return w(t,null,n)},l=function(){var t;return t=[].slice.call(arguments),g.eventNames.length||(g.eventNames=n),g.actions=t.length?t:n,y()},f=function(){var t;return t=[].slice.call(arguments),g.actions.length||(g.actions=n),g.eventNames=t.length?t:n,y()},p=function(){return g.actions=[],g.eventNames=[],y()},d=function(){return g.actions=n,g.eventNames=n,y()},y=function(){return h.localStorage?(h.localStorage.setItem("logFilter_eventNames",g.eventNames),h.localStorage.setItem("logFilter_actions",g.actions)):void 0},v=function(){var e,r,i;r={eventNames:h.localStorage&&h.localStorage.getItem("logFilter_eventNames")||a,actions:h.localStorage&&h.localStorage.getItem("logFilter_actions")||c};for(e in r)t.call(r,e)&&(i=r[e],"string"==typeof i&&i!==n&&(r[e]=i.split(".")));return r},n="all",a=[],c=[],g=v(),{enable:function(t){return this.enabled=!!t,t&&h.console&&(console.info("Booting in DEBUG mode"),console.info("You can configure event logging with DEBUG.events.logAll()/logNone()/logByName()/logByAction()")),h.DEBUG=this},find:{byName:e,byNameContains:r,byType:i,byValue:o,byValueCoerced:u,custom:s},events:{logFilter:g,logByAction:l,logByName:f,logAll:d,logNone:p}}})}.call(this),function(){var t={}.hasOwnProperty;n("build/js/compose",["./utils","./debug"],function(n,e){"use strict";var r,i,o,u,s,c;if(r=e.enabled&&!n.isEnumerable(Object,"getOwnPropertyDescriptor"),i=["mixedIn","mixingIn"],r)try{Object.getOwnPropertyDescriptor(Object,"keys")}catch(a){o=a,r=!1}return s=function(n,e){var o,u,s;if(r){s=Object.create(null);for(u in n)t.call(n,u)&&i.indexOf(0>u)&&(o=Object.getOwnPropertyDescriptor(n,u),o.writable=e,s[u]=o);return Object.defineProperties(n,s)}},c=function(t,n,e){var i;return r&&t.hasOwnProperty(n)?(i=Object.getOwnPropertyDescriptor(t,n).writable,Object.defineProperties(t,n,{writable:!0}),e.call(t),Object.defineProperties(t,n,{writable:i})):e.call(t)},u=function(t,n){var e,r;if(!(n instanceof Array))return this.mixin(t,[n]);for(t.mixedIn=t.hasOwnProperty("mixedIn")?t.mixedIn:[],t.mixingIn=t.hasOwnProperty("mixingIn")?t.mixingIn:[],s(t,!1),e=0,r=n.length;r>e;e++)if(u=n[e],-1===t.mixedIn.indexOf(u)){if(t.mixingIn.indexOf(u)>-1)throw new Error("found cyclic dependencies between "+t.mixingIn);t.mixingIn.push(u),u.call(t),t.mixingIn.pop(),t.mixedIn.push(u)}return s(t,!0)},{mixin:u,unlockProperty:c}})}.call(this),function(){n("build/js/advice",["./compose"],function(t){"use strict";var n;return n={around:function(t,n){return function(){var e,r,i,o,u,s;for(o=arguments.length,e=new Array(o+1),e[0]=t.bind(this),i=u=0,s=e.length;s>u;i=++u)r=e[i],e[i+1]=arguments[i];return n.apply(this,e)}},before:function(t,n){var e;return e="function"==typeof n?n:n.obj[n.fnName],function(){return e.apply(this,arguments),t.apply(this,arguments)}},after:function(t,n){var e;return e="function"==typeof n?n:n.obj[n.fnName],function(){var n;return n=(t.unbound||t).apply(this,arguments),e.apply(this,arguments),n}},withAdvice:function(){return["before","after","around"].forEach(function(e){return this[e]=function(r,i){return t.unlockProperty(this,r,function(){return this[r]="function"==typeof this[r]?n[e](this[r],i):i,this[r]})}},this)}}})}.call(this),function(){n("build/js/event",["./utils"],function(t){"use strict";var n,e,r,i,o,u,s,c;s=[].slice,n={withEvent:function(){var t,e,r,i,o;for(i=["on","off","once","trigger"],o=[],e=0,r=i.length;r>e;e++)t=i[e],o.push(this[t]=n[t]);return o},on:function(t,n,e){var i;return r(this,"on",t,[n,e])&&n?(this._events||(this._events={}),i=this._events[t]||(this._events[t]=[]),i.push({callback:n,context:e,ctx:e||this}),this):this},once:function(n,e,i){var o,u;return r(this,"once",n,[e,i])&&e?(u=this,o=t.once(function(){return u.off(n,o),e.apply(this,arguments)}),o._callback=e,this.on(n,o,i)):this},off:function(t,n,e){var i,o,u,s,c,a,l,f,h,p;if(!this._events||!r(this,"off",t,[n,e]))return this;if(!t&&!n&&!e)return this._events=void 0,this;for(c=t?[t]:Object.keys(this._events),u=l=0,h=c.length;h>l;u=++l)if(t=c[u],o=this._events[t]){if(this._events[t]=a=[],n||e)for(s=f=0,p=o.length;p>f;s=++f)i=o[s],(n&&n!==i.callback&&n!==i.callback._callback||e&&e!==i.context)&&a.push(i);a.length||delete this._events[t]}return this},trigger:function(t){var n,e,i;return this._events?(e=s.call(arguments,1),r(this,"trigger",t,e)?(i=this._events[t],n=this._events.all,i&&c(i,e),n&&c(n,arguments),this):this):this},stopListening:function(t,n,e){var r,i,o;if(i=this._listeningTo,!i)return this;o=!n&&!e,e||"object"!=typeof n||(e=this),t&&((i={})[t._listenId]=t);for(r in i)t=i[r],t.off(n,e,this),(o||_.isEmpty(t._events))&&delete this._listeningTo[r];return this}},e=/\s+/,r=function(t,n,r,i){var o,u,s,c,a;if(!r)return!0;if("object"==typeof r){for(o in r)s=r[o],t[n].apply(t,[o,s].concat(i));return!1}if(e.test(r)){for(u=r.split(e),c=0,a=u.length;a>c;c++)s=u[c],t[n].apply(t,[s].concat(i));return!1}return!0},c=function(t,n){var e,r,i,o;for(o=[],r=0,i=t.length;i>r;r++)e=t[r],o.push(e.callback.apply(e.ctx,n));return o},o={listenTo:"on",listenToOnce:"once"};for(u in o)i=o[u],n[u]=function(n,e,r){var o,u;return u=this._listeningTo||(this._listeningTo={}),o=n._listenId||(n._listenId=t.uniqueId("l")),u[o]=n,r||"object"!=typeof e||(r=this),n[i](e,r,this),this};return n})}.call(this),function(){var t={}.hasOwnProperty;n("build/js/property",["./utils","./compose","./event"],function(n,e,r){"use strict";return function(){return e.mixin(this,r.withEvent),this.set=function(e,r){var i,o,u,s,c;if(!e)return this;if(arguments.length>1&&"string"==typeof arguments[0])return o={},o[e]=r,this.set(o);this.attrs||(this.attrs={}),o=e,i={},u={},s=this.attrs;for(e in s)t.call(s,e)&&(r=s[e],u[e]=r);n.push(this.attrs,o),c=this.attrs;for(e in c)t.call(c,e)&&(r=c[e],r!==u[e]?i[e]=r:delete u[e]);return 0!==Object.keys(i).length&&this.trigger("change",{before:u,after:i},!0),this},this.get=function(t){return this.attrs&&this.attrs[t]}}})}.call(this),function(){var t={}.hasOwnProperty;n("build/js/lifecycle",["./compose","./property"],function(n,e){"use strict";return function(){return n.mixin(this,e),this.initialize=function(n){var e,r,i,o;n||(n={}),e={};for(r in n)t.call(n,r)&&(i=n[r],e[r]=i);o=this.defaults;for(r in o)t.call(o,r)&&(i=o[r],e.hasOwnProperty(r)||(e[r]=i));return this.set(e),this},this.despose=function(){}}})}.call(this),function(){n("build/js/serialize",["./compose","./property"],function(t,n){"use strict";return function(){return t.mixin(this,n),this.serialize=function(){return["type: "+this.name,"id: "+this.id,"props: "+JSON.stringify(this.attrs)].join(",")},this.deserialize=function(){}}})}.call(this),function(){var t={}.hasOwnProperty,e=function(n,e){function r(){this.constructor=n}for(var i in e)t.call(e,i)&&(n[i]=e[i]);return r.prototype=e.prototype,n.prototype=new r,n.__super__=e.prototype,n};n("build/js/dou",["./compose"],function(t){"use strict";var n;return n=function(n){var r;return r=n["extends"]?function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n}(n["extends"]):function(){function t(){}return t}(),n.mixins&&t.mixin(r.prototype,n.mixins),n.name&&(r.name=n.name),r},{define:n}})}.call(this),function(){n("build/js/index",["./advice","./compose","./debug","./event","./lifecycle","./property","./serialize","./utils","./dou"],function(t,n,e,r,i,o,u,s,c){"use strict";return{advice:t,compose:n,debug:e,event:r,lifecycle:i,property:o,serialize:u,utils:s,dou:c}})}.call(this),t.dou=e("lib/index")}(this);
|