dou-rails 0.0.10 → 0.0.11
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/lib/dou/version.rb +1 -1
- data/vendor/assets/javascripts/dou-min.js +2 -2
- data/vendor/assets/javascripts/dou.js +296 -58
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70075d13cb642465f4f88e44cb76aa5ce5304a99
|
4
|
+
data.tar.gz: 3bb56bd1f332d9780c462eac268711425673dbb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3db6aae52c3bb57dacabd7103df7d214c3fd329f6a511f67652aaa227796396d680ca959acc4fe544bbb7a032931783d94770d35451a4918d65e862f87d60cfe
|
7
|
+
data.tar.gz: 7a8319201acbe4149b07ecc00ad52e5f7387525176b0577e0c943ac2beda9a527fe3e5f04fb70c730b3c1208ede1ccbebb5ada10fb2a41ffd2b263be3bd6b776
|
data/lib/dou/version.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
/*! Dou v0.0.
|
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},clone:function(t){var n,e,r;if(null==t||"object"!=typeof t)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return n="",null!=t.global&&(n+="g"),null!=t.ignoreCase&&(n+="i"),null!=t.multiline&&(n+="m"),null!=t.sticky&&(n+="y"),new RegExp(t.source,n);r=new t.constructor;for(e in t)r[e]=this.clone(t[e]);return r}}})}.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),t},{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";var i,o;return o=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},i=function(t){return this.attrs&&this.attrs[t]},function(){return e.mixin(this,r.withEvent),this.set=o,this.get=i}})}.call(this),function(){var t={}.hasOwnProperty;n("build/js/lifecycle",["./compose","./property"],function(n,e){"use strict";var r,i;return i=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},r=function(){},function(){return n.mixin(this,e),this.initialize=i,this.despose=r}})}.call(this),function(){n("build/js/serialize",["./compose","./property"],function(t,n){"use strict";var e,r;return r=function(){return["type: "+this.name,"id: "+this.id,"props: "+JSON.stringify(this.attrs)].join(",")},e=function(){},function(){return t.mixin(this,n),this.serialize||(this.serialize=r),this.deserialize?void 0:this.deserialize=e}})}.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","./advice","./lifecycle","./property","./serialize","./event","./utils"],function(n,r,i,o,u,s,c){"use strict";var a,l;return a=function(r,i,o){var u,s,c,a;if(i||(i=function(){}),u=r["extends"]?function(t){function n(){return r.apply(this,arguments)}var r;return e(n,t),r=i,n}(r["extends"]):function(){function t(){return n.apply(this,arguments)}var n;return n=i,t}(),r.members){a=r.members;for(s in a)t.call(a,s)&&(c=a[s],u.prototype[s]=c)}if(o)for(s in o)t.call(o,s)&&(c=o[s],u.prototype[s]=c);return r.mixins&&n.mixin(u.prototype,r.mixins),r.name&&(u.name=r.name),u},l=function(t,e){return n.mixin("function"==typeof t?t.prototype:t,e),t},{define:a,mixin:l,"with":{advice:r.withAdvice,property:o,lifecycle:i,event:s.withEvent,serialize:u},util:c}})}.call(this),t.dou=e("build/js/dou")}(this);
|
1
|
+
/*! Dou v0.0.11 | (c) Hatio, Lab. | MIT License */
|
2
|
+
!function(t){function n(){var t,n,e=Array.prototype.slice.call(arguments),r=[];"string"==typeof e[0]&&(t=e.shift()),o(e[0])&&(r=e.shift()),n=e.shift(),i[t]=[r,n]}function e(t){function n(n){var e=t.split("/"),i=n.split("/"),r=!1;for(e.pop();".."==i[0]&&e.length;)e.pop(),i.shift(),r=!0;return"."==i[0]&&(i.shift(),r=!0),r&&(i=e.concat(i)),i.join("/")}var o,c,l;return"undefined"==typeof r[t]&&(o=i[t],o&&(l=o[0],c=o[1],r[t]=c.apply(void 0,s(l,function(t){return e(n(t))})))),r[t]}var i={},r={},o=Array.isArray||function(t){return t.constructor==Array},s=Array.map||function(t,n,e){for(var i=0,r=t.length,o=[];r>i;i++)o.push(n.call(e,t[i]));return o};!function(){var t=[].slice,e={}.hasOwnProperty;n("build/js/utils",[],function(){"use strict";var n,i;return n=100,i=0,{merge:function(){var n,i,r,o,s,c,l;for(o=arguments[0],n=2<=arguments.length?t.call(arguments,1):[],o&&typeof o!==!1||(o={}),c=0,l=n.length;l>c;c++){r=n[c];for(i in r)e.call(r,i)&&(s=r[i],o[i]="object"!=typeof s?s:this.merge(o[i],s))}return o},shallow_merge:function(){var n,i,r,o,s,c,l;for(i=1<=arguments.length?t.call(arguments,0):[],o={},c=0,l=i.length;l>c;c++){n=i[c];for(r in n)e.call(n,r)&&(s=n[r],o[r]=s)}return o},push:function(t,n,i){var r,o;if(!t||!n)return t;for(r in n)if(e.call(n,r)){if(o=n[r],t[r]&&i)throw new Error('utils.push attempted to overwrite "'+r+'" while running in protected mode');"object"==typeof t[r]&&"object"==typeof n[r]?this.push(t[r],n[r]):t[r]=n[r]}return t},isEnumerable:function(t,n){return Object.keys(t).indexOf(n)>-1},compose:function(){var t;return t=arguments,function(){var n,e,i,r;for(n=arguments,e=i=r=t.length-1;0>=r?0>=i:i>=0;e=0>=r?++i:--i)n=t[e].apply(this,n);return n[0]}},uniqueArray:function(t){var n,e,i,r,o;for(i={},n=[],r=0,o=t.length;o>r;r++)e=t[r],i.hasOwnProperty(e)||(n.push(e),i[e]=1);return n},debounce:function(t,e,i){var r,o;return"number"!=typeof e&&(e=n),o=0,r=null,function(){var n,s,c,l;return c=this,n=arguments,l=function(){return o=null,i?void 0:r=t.apply(c,n)},s=i&&!o,clearTimeout(o),o=setTimeout(l,e),s&&(r=t.apply(c,n)),r}},throttle:function(t,e){var i,r,o,s,c,l,u;return"number"!=typeof e&&(e=n),r=i=l=c=o=s=null,u=this.debounce(function(){return o=c=!1},e),function(){var n;return r=this,i=arguments,n=function(){return l=null,o&&(s=t.apply(r,i)),u()},l||(l=setTimeout(n,e)),c?o=!0:(c=!0,s=t.apply(r,i)),u(),s}},countThen:function(t,n){return function(){return--t?void 0:n.apply(this,arguments)}},delegate:function(t){return function(n,i){var r,o,s;s=$(n.target),r=null;for(o in t)if(e.call(t,o)&&!n.isPropagationStopped()&&(r=s.closest(o)).length)return i=i||{},i.el=r[0],t[o].apply(this,[n,i])}},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=++i+"",t?t+n:n},clone:function(t){return null==t||"object"!=typeof t?t:t instanceof Array?t.slice():this.shallow_merge(t)}}})}.call(this),function(){var t={}.hasOwnProperty;n("build/js/debug",[],function(){"use strict";var n,e,i,r,o,s,c,l,u,a,h,f,p,_,g,d,m,v,y,b;return f="undefined"==typeof window?{}:window,b=function(n,e,i){var r,o,s,c;i=i||{},r=i.obj||f,o=i.path||(r===f?"global":""),c=[];for(s in r)t.call(r,s)&&((y[n]||n)(e,r,s)&&console.log(""+o+"."+s+" -> ("+typeof r[s]+")",r[s]),r[s]&&"object"==typeof r[s]&&r[s]!==r?c.push(b(n,e,{obj:r[s],path:""+o+"."+s})):c.push(void 0));return c},m=function(t,n,e,i){return n&&typeof e!==n?console.error(""+e+" must be "+n):b(t,e,i)},y={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)},i=function(t,n){return m("nameContains","string",t,n)},r=function(t,n){return m("type","function",t,n)},o=function(t,n){return m("value",null,t,n)},s=function(t,n){return m("valueCoerced",null,t,n)},c=function(t,n){return b(t,null,n)},a=function(){var t;return t=[].slice.call(arguments),_.eventNames.length||(_.eventNames=n),_.actions=t.length?t:n,d()},h=function(){var t;return t=[].slice.call(arguments),_.actions.length||(_.actions=n),_.eventNames=t.length?t:n,d()},p=function(){return _.actions=[],_.eventNames=[],d()},v=function(){return _.actions=n,_.eventNames=n,d()},d=function(){return f.localStorage?(f.localStorage.setItem("logFilter_eventNames",_.eventNames),f.localStorage.setItem("logFilter_actions",_.actions)):void 0},g=function(){var e,i,r;i={eventNames:f.localStorage&&f.localStorage.getItem("logFilter_eventNames")||u,actions:f.localStorage&&f.localStorage.getItem("logFilter_actions")||l};for(e in i)t.call(i,e)&&(r=i[e],"string"==typeof r&&r!==n&&(i[e]=r.split(".")));return i},n="all",u=[],l=[],_=g(),{enable:function(t){return this.enabled=!!t,t&&f.console&&(console.info("Booting in DEBUG mode"),console.info("You can configure event logging with DEBUG.events.logAll()/logNone()/logByName()/logByAction()")),f.DEBUG=this},find:{byName:e,byNameContains:i,byType:r,byValue:o,byValueCoerced:s,custom:c},events:{logFilter:_,logByAction:a,logByName:h,logAll:v,logNone:p}}})}.call(this),function(){var t={}.hasOwnProperty;n("build/js/compose",["./utils","./debug"],function(n,e){"use strict";var i,r,o,s,c,l;if(i=e.enabled&&!n.isEnumerable(Object,"getOwnPropertyDescriptor"),r=["mixedIn","mixingIn"],i)try{Object.getOwnPropertyDescriptor(Object,"keys")}catch(u){o=u,i=!1}return c=function(n,e){var o,s,c;if(i){c=Object.create(null);for(s in n)t.call(n,s)&&r.indexOf(0>s)&&(o=Object.getOwnPropertyDescriptor(n,s),o.writable=e,c[s]=o);return Object.defineProperties(n,c)}},l=function(t,n,e){var r;return i&&t.hasOwnProperty(n)?(r=Object.getOwnPropertyDescriptor(t,n).writable,Object.defineProperties(t,n,{writable:!0}),e.call(t),Object.defineProperties(t,n,{writable:r})):e.call(t)},s=function(t,n){var e,i;if(!(n instanceof Array))return this.mixin(t,[n]);for(t.mixedIn=t.hasOwnProperty("mixedIn")?t.mixedIn:[],t.mixingIn=t.hasOwnProperty("mixingIn")?t.mixingIn:[],c(t,!1),e=0,i=n.length;i>e;e++)if(s=n[e],-1===t.mixedIn.indexOf(s)){if(t.mixingIn.indexOf(s)>-1)throw new Error("found cyclic dependencies between "+t.mixingIn);t.mixingIn.push(s),s.call(t),t.mixingIn.pop(),t.mixedIn.push(s)}return c(t,!0),t},{mixin:s,unlockProperty:l}})}.call(this),function(){n("build/js/advice",["./compose"],function(t){"use strict";var n;return n={around:function(t,n){return function(){var e,i,r,o,s,c;for(o=arguments.length,e=new Array(o+1),e[0]=t.bind(this),r=s=0,c=e.length;c>s;r=++s)i=e[r],e[r+1]=arguments[r];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(i,r){return t.unlockProperty(this,i,function(){return this[i]="function"==typeof this[i]?n[e](this[i],r):r,this[i]})}},this)}}})}.call(this),function(){var t={}.hasOwnProperty;n("build/js/collection",[],function(){"use strict";var n,e,i,r,o;return r={insertAt:function(t,n){return this.__collection__?(t=this.__collection__.indexOf(n),-1===this.__collection__.indexOf(n)&&this.__collection__.splice(t,0,n),this):this},append:function(t){return this.__collection__||(this.__collection__=[]),-1===this.__collection__.indexOf(t)&&this.__collection__.push(t),this},prepend:function(t){return this.__collection__||(this.__collection__=[]),-1===this.__collection__.indexOf(t)&&this.__collection__.unshift(t),this},remove:function(t){var n;return this.__collection__?(n=this.__collection__.indexOf(t),n>-1&&this.__collection__.splice(n,1),this):this},getAt:function(t){return this.__collection__?this.__collection__[t]:void 0},forEach:function(t,n){return this.__collection__?this.__collection__.forEach(t,n):this},indexOf:function(t){return(this.__collection__||[]).indexOf(t)},size:function(){return(this.__collection__||[]).length},clear:function(){return this.__collection__=[]},moveForward:function(t){var n;return n=this.indexOf(t),-1!==n&&0!==n?(this.__collection__[n]=this.__collection__[n-1],this.__collection__[n-1]=t):void 0},moveBackward:function(t){var n;return n=this.indexOf(t),-1!==n&&n!==this.size()-1?(this.__collection__[n]=this.__collection__[n+1],this.__collection__[n+1]=t):void 0},moveToHead:function(t){var n,e,i;return e=this.indexOf(t),-1!==e&&0!==e?(n=this.__collection__.splice(0,e),i=this.__collection__.splice(1),this.__collection__=this.__collection__.concat(n,i)):void 0},moveToTail:function(t){var n,e,i;return e=this.indexOf(t),-1!==e&&e!==this.size()-1?(n=this.__collection__.splice(0,e),i=this.__collection__.splice(1),this.__collection__=n.concat(i,this.__collection__)):void 0}},o={push:function(){throw new Error("Not Implemented Yet")},pop:function(){throw new Error("Not Implemented Yet")}},n=function(){},n.prototype=r,e=function(){},e.prototype=o,i={List:n,Stack:e,withList:function(){var n,e,i;i=[];for(n in r)t.call(r,n)&&(e=r[n],i.push(this[n]=e));return i},withStack:function(){var n,e,i;i=[];for(n in o)t.call(o,n)&&(e=o[n],i.push(this[n]=e));return i}}})}.call(this),function(){n("build/js/event",["./utils","./collection"],function(t,n){"use strict";var e,i,r,o,s,c,l,u;e={withEvent:function(){var t,n,i,r,o;for(r=["on","off","once","delegate_on","delegate_off","trigger"],o=[],n=0,i=r.length;i>n;n++)t=r[n],o.push(this[t]=e[t]);return o},on:function(t,n,e){var i;return o(this,"on",t,[n,e])&&n?(this._listeners||(this._listeners={}),i=this._listeners[t]||(this._listeners[t]=[]),i.push({callback:n,context:e,ctx:e||this}),this):this},once:function(n,e,i){var r,s;return o(this,"once",n,[e,i])&&e?(s=this,r=t.once(function(){return s.off(n,r),e.apply(this,arguments)}),r._callback=e,this.on(n,r,i)):this},off:function(t,n,e){var i,r,s,c,l,u,a,h,f,p;if(!this._listeners||!o(this,"off",t,[n,e]))return this;if(!t&&!n&&!e)return this._listeners=void 0,this;for(l=t?[t]:Object.keys(this._listeners),s=a=0,f=l.length;f>a;s=++a)if(t=l[s],r=this._listeners[t]){if(this._listeners[t]=u=[],n||e)for(c=h=0,p=r.length;p>h;c=++h)i=r[c],(n&&n!==i.callback&&n!==i.callback._callback||e&&e!==i.context)&&u.push(i);u.length||delete this._listeners[t]}return this},delegate_on:function(t){return this._delegators||(this._delegators=new n.List),this._delegators.append(t),this},delegate_off:function(t){return this._delegators?(this._delegators.remove(t),this):this},delegate:function(){var t,n,e;return this._delegators&&this._delegators.size()>0&&i(this._delegators,arguments),this._listeners?(t=arguments[arguments.length-1],t.deliverer=this,n=this._listeners[t.name],e=this._listeners.all,n&&u(n,arguments),e&&u(e,arguments),this):this},trigger:function(t){var n,e,r;return n=[].slice.call(arguments,1),n.push({origin:this,name:t,deliverer:this}),this._delegators&&this._delegators.size()>0&&i(this._delegators,n),this._listeners?o(this,"trigger",t,n)?(e=this._listeners[t],r=this._listeners.all,e&&u(e,n),r&&u(r,n),this):this:this},stopListening:function(t,n,e){var i,r,o;if(r=this._listeningTo,!r)return this;o=!n&&!e,e||"object"!=typeof n||(e=this),t&&((r={})[t._listenId]=t);for(i in r)t=r[i],t.off(n,e,this),(o||_.isEmpty(t._events))&&delete this._listeningTo[i];return this}},r=/\s+/,o=function(t,n,e,i){var o,s,c,l,u;if(!e)return!0;if("object"==typeof e){for(o in e)c=e[o],t[n].apply(t,[o,c].concat(i));return!1}if(r.test(e)){for(s=e.split(r),l=0,u=s.length;u>l;l++)c=s[l],t[n].apply(t,[c].concat(i));return!1}return!0},u=function(t,n){var e,i,r,o;for(o=[],i=0,r=t.length;r>i;i++)e=t[i],o.push(e.callback.apply(e.ctx,n));return o},i=function(t,n){return t.forEach(function(t){return e.delegate.apply(t,n)})},c={listenTo:"on",listenToOnce:"once"};for(l in c)s=c[l],e[l]=function(n,e,i){var r,o;return o=this._listeningTo||(this._listeningTo={}),r=n._listenId||(n._listenId=t.uniqueId("l")),o[r]=n,i||"object"!=typeof e||(i=this),n[s](e,i,this),this};return e})}.call(this),function(){var t={}.hasOwnProperty;n("build/js/property",["./utils","./compose","./event"],function(n,e,i){"use strict";var r,o,s;return s=function(e,i){var r,o,s,c,l;if(!e)return this;if(arguments.length>1&&"string"==typeof arguments[0])return o={},o[e]=i,this.set(o);this.attrs||(this.attrs={}),o=e,r={},s={},c=this.attrs;for(e in c)t.call(c,e)&&(i=c[e],s[e]=i);n.push(this.attrs,o),l=this.attrs;for(e in l)t.call(l,e)&&(i=l[e],i!==s[e]?r[e]=i:delete s[e]);return 0!==Object.keys(r).length&&this.trigger("change",this,s,r),this},r=function(t){return this.attrs?this.attrs[t]:void 0},o=function(){return this.attrs?n.clone(this.attrs):{}},function(){return e.mixin(this,i.withEvent),this.set=s,this.get=r,this.getAll=o}})}.call(this),function(){var t={}.hasOwnProperty;n("build/js/lifecycle",["./compose","./property"],function(n,e){"use strict";var i,r;return r=function(n){var e,i,r,o;n||(n={}),e={};for(i in n)t.call(n,i)&&(r=n[i],e[i]=r);o=this.defaults;for(i in o)t.call(o,i)&&(r=o[i],e.hasOwnProperty(i)||(e[i]=r));return this.set(e),this},i=function(){},function(){return n.mixin(this,e),this.initialize=r,this.despose=i}})}.call(this),function(){n("build/js/serialize",["./compose","./property"],function(t,n){"use strict";var e,i;return i=function(){return["type: "+this.name,"id: "+this.id,"props: "+JSON.stringify(this.attrs)].join(",")},e=function(){},function(){return t.mixin(this,n),this.serialize||(this.serialize=i),this.deserialize?void 0:this.deserialize=e}})}.call(this),function(){n("build/js/disposer",["./compose","./advice"],function(t,n){"use strict";var e,i;return e=function(t){return this.__disposers||(this.__disposers=[]),this.__disposers.push(t)},i=function(){var t,n,e,i,r;if(this.__disposers&&this.__disposers){for(i=this.__disposers,r=[],n=0,e=i.length;e>n;n++)t=i[n],r.push(t.call(this));return r}},function(){return this.addDisposer=e,this.dispose?(t.mixin(this,n.withAdvice),this.after("dispose",i)):this.dispose=i}})}.call(this),function(){var t={}.hasOwnProperty,e=function(n,e){function i(){this.constructor=n}for(var r in e)t.call(e,r)&&(n[r]=e[r]);return i.prototype=e.prototype,n.prototype=new i,n.__super__=e.prototype,n};n("build/js/dou",["./compose","./advice","./lifecycle","./property","./serialize","./event","./utils","./collection","./disposer"],function(n,i,r,o,s,c,l,u,a){"use strict";var h,f;return h=function(i,r,o){var s,c,l,u;if(r||(r=function(){}),s=i["extends"]?function(t){function n(){return i.apply(this,arguments)}var i;return e(n,t),i=r,n}(i["extends"]):function(){function t(){return n.apply(this,arguments)}var n;return n=r,t}(),i.members){u=i.members;for(c in u)t.call(u,c)&&(l=u[c],s.prototype[c]=l)}if(o)for(c in o)t.call(o,c)&&(l=o[c],s.prototype[c]=l);return i.mixins&&n.mixin(s.prototype,i.mixins),i.name&&(s.name=i.name),s},f=function(t,e){return n.mixin("function"==typeof t?t.prototype:t,e),t},{define:h,mixin:f,"with":{advice:i.withAdvice,property:o,disposer:a,lifecycle:r,event:c.withEvent,serialize:s,collection:u},util:l}})}.call(this),t.dou=e("build/js/dou")}(this);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! Dou v0.0.
|
1
|
+
/*! Dou v0.0.11 | (c) Hatio, Lab. | MIT License */
|
2
2
|
(function(context) {
|
3
3
|
var factories = {}, loaded = {};
|
4
4
|
var isArray = Array.isArray || function(obj) {
|
@@ -87,6 +87,21 @@
|
|
87
87
|
}
|
88
88
|
return target;
|
89
89
|
},
|
90
|
+
shallow_merge: function () {
|
91
|
+
var extender, extenders, key, result, val, _i, _len;
|
92
|
+
extenders = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
|
93
|
+
result = {};
|
94
|
+
for (_i = 0, _len = extenders.length; _i < _len; _i++) {
|
95
|
+
extender = extenders[_i];
|
96
|
+
for (key in extender) {
|
97
|
+
if (!__hasProp.call(extender, key))
|
98
|
+
continue;
|
99
|
+
val = extender[key];
|
100
|
+
result[key] = val;
|
101
|
+
}
|
102
|
+
}
|
103
|
+
return result;
|
104
|
+
},
|
90
105
|
push: function (base, extra, protect) {
|
91
106
|
var key, val;
|
92
107
|
if (!base || !extra) {
|
@@ -244,34 +259,13 @@
|
|
244
259
|
}
|
245
260
|
},
|
246
261
|
clone: function (obj) {
|
247
|
-
var flags, key, newInstance;
|
248
262
|
if (obj == null || typeof obj !== 'object') {
|
249
263
|
return obj;
|
250
264
|
}
|
251
|
-
if (obj instanceof
|
252
|
-
return
|
253
|
-
}
|
254
|
-
if (obj instanceof RegExp) {
|
255
|
-
flags = '';
|
256
|
-
if (obj.global != null) {
|
257
|
-
flags += 'g';
|
258
|
-
}
|
259
|
-
if (obj.ignoreCase != null) {
|
260
|
-
flags += 'i';
|
261
|
-
}
|
262
|
-
if (obj.multiline != null) {
|
263
|
-
flags += 'm';
|
264
|
-
}
|
265
|
-
if (obj.sticky != null) {
|
266
|
-
flags += 'y';
|
267
|
-
}
|
268
|
-
return new RegExp(obj.source, flags);
|
269
|
-
}
|
270
|
-
newInstance = new obj.constructor();
|
271
|
-
for (key in obj) {
|
272
|
-
newInstance[key] = this.clone(obj[key]);
|
265
|
+
if (obj instanceof Array) {
|
266
|
+
return obj.slice();
|
273
267
|
}
|
274
|
-
return
|
268
|
+
return this.shallow_merge(obj);
|
275
269
|
}
|
276
270
|
};
|
277
271
|
});
|
@@ -561,10 +555,155 @@
|
|
561
555
|
});
|
562
556
|
}.call(this));
|
563
557
|
(function () {
|
564
|
-
|
558
|
+
var __hasProp = {}.hasOwnProperty;
|
559
|
+
define('build/js/collection', [], function () {
|
560
|
+
'use strict';
|
561
|
+
var List, Stack, collection, list, stack;
|
562
|
+
list = {
|
563
|
+
insertAt: function (index, item) {
|
564
|
+
if (!this.__collection__) {
|
565
|
+
return this;
|
566
|
+
}
|
567
|
+
index = this.__collection__.indexOf(item);
|
568
|
+
if (this.__collection__.indexOf(item) === -1) {
|
569
|
+
this.__collection__.splice(index, 0, item);
|
570
|
+
}
|
571
|
+
return this;
|
572
|
+
},
|
573
|
+
append: function (item) {
|
574
|
+
this.__collection__ || (this.__collection__ = []);
|
575
|
+
if (this.__collection__.indexOf(item) === -1) {
|
576
|
+
this.__collection__.push(item);
|
577
|
+
}
|
578
|
+
return this;
|
579
|
+
},
|
580
|
+
prepend: function (item) {
|
581
|
+
this.__collection__ || (this.__collection__ = []);
|
582
|
+
if (this.__collection__.indexOf(item) === -1) {
|
583
|
+
this.__collection__.unshift(item);
|
584
|
+
}
|
585
|
+
return this;
|
586
|
+
},
|
587
|
+
remove: function (item) {
|
588
|
+
var idx;
|
589
|
+
if (!this.__collection__) {
|
590
|
+
return this;
|
591
|
+
}
|
592
|
+
idx = this.__collection__.indexOf(item);
|
593
|
+
if (idx > -1) {
|
594
|
+
this.__collection__.splice(idx, 1);
|
595
|
+
}
|
596
|
+
return this;
|
597
|
+
},
|
598
|
+
getAt: function (index) {
|
599
|
+
if (this.__collection__) {
|
600
|
+
return this.__collection__[index];
|
601
|
+
}
|
602
|
+
},
|
603
|
+
forEach: function (fn, context) {
|
604
|
+
if (!this.__collection__) {
|
605
|
+
return this;
|
606
|
+
}
|
607
|
+
return this.__collection__.forEach(fn, context);
|
608
|
+
},
|
609
|
+
indexOf: function (item) {
|
610
|
+
return (this.__collection__ || []).indexOf(item);
|
611
|
+
},
|
612
|
+
size: function () {
|
613
|
+
return (this.__collection__ || []).length;
|
614
|
+
},
|
615
|
+
clear: function () {
|
616
|
+
return this.__collection__ = [];
|
617
|
+
},
|
618
|
+
moveForward: function (item) {
|
619
|
+
var index;
|
620
|
+
index = this.indexOf(item);
|
621
|
+
if (index === -1 || index === 0) {
|
622
|
+
return;
|
623
|
+
}
|
624
|
+
this.__collection__[index] = this.__collection__[index - 1];
|
625
|
+
return this.__collection__[index - 1] = item;
|
626
|
+
},
|
627
|
+
moveBackward: function (item) {
|
628
|
+
var index;
|
629
|
+
index = this.indexOf(item);
|
630
|
+
if (index === -1 || index === this.size() - 1) {
|
631
|
+
return;
|
632
|
+
}
|
633
|
+
this.__collection__[index] = this.__collection__[index + 1];
|
634
|
+
return this.__collection__[index + 1] = item;
|
635
|
+
},
|
636
|
+
moveToHead: function (item) {
|
637
|
+
var head, index, tail;
|
638
|
+
index = this.indexOf(item);
|
639
|
+
if (index === -1 || index === 0) {
|
640
|
+
return;
|
641
|
+
}
|
642
|
+
head = this.__collection__.splice(0, index);
|
643
|
+
tail = this.__collection__.splice(1);
|
644
|
+
return this.__collection__ = this.__collection__.concat(head, tail);
|
645
|
+
},
|
646
|
+
moveToTail: function (item) {
|
647
|
+
var head, index, tail;
|
648
|
+
index = this.indexOf(item);
|
649
|
+
if (index === -1 || index === this.size() - 1) {
|
650
|
+
return;
|
651
|
+
}
|
652
|
+
head = this.__collection__.splice(0, index);
|
653
|
+
tail = this.__collection__.splice(1);
|
654
|
+
return this.__collection__ = head.concat(tail, this.__collection__);
|
655
|
+
}
|
656
|
+
};
|
657
|
+
stack = {
|
658
|
+
push: function (item) {
|
659
|
+
throw new Error('Not Implemented Yet');
|
660
|
+
},
|
661
|
+
pop: function () {
|
662
|
+
throw new Error('Not Implemented Yet');
|
663
|
+
}
|
664
|
+
};
|
665
|
+
List = function () {
|
666
|
+
};
|
667
|
+
List.prototype = list;
|
668
|
+
Stack = function () {
|
669
|
+
};
|
670
|
+
Stack.prototype = stack;
|
671
|
+
collection = {
|
672
|
+
List: List,
|
673
|
+
Stack: Stack,
|
674
|
+
withList: function () {
|
675
|
+
var k, v, _results;
|
676
|
+
_results = [];
|
677
|
+
for (k in list) {
|
678
|
+
if (!__hasProp.call(list, k))
|
679
|
+
continue;
|
680
|
+
v = list[k];
|
681
|
+
_results.push(this[k] = v);
|
682
|
+
}
|
683
|
+
return _results;
|
684
|
+
},
|
685
|
+
withStack: function () {
|
686
|
+
var k, v, _results;
|
687
|
+
_results = [];
|
688
|
+
for (k in stack) {
|
689
|
+
if (!__hasProp.call(stack, k))
|
690
|
+
continue;
|
691
|
+
v = stack[k];
|
692
|
+
_results.push(this[k] = v);
|
693
|
+
}
|
694
|
+
return _results;
|
695
|
+
}
|
696
|
+
};
|
697
|
+
return collection;
|
698
|
+
});
|
699
|
+
}.call(this));
|
700
|
+
(function () {
|
701
|
+
define('build/js/event', [
|
702
|
+
'./utils',
|
703
|
+
'./collection'
|
704
|
+
], function (utils, collection) {
|
565
705
|
'use strict';
|
566
|
-
var Event, eventSplitter, eventsApi, implementation, listenMethods, method,
|
567
|
-
slice = [].slice;
|
706
|
+
var Event, delegateEvents, eventSplitter, eventsApi, implementation, listenMethods, method, triggerEvents;
|
568
707
|
Event = {
|
569
708
|
withEvent: function () {
|
570
709
|
var method, _i, _len, _ref, _results;
|
@@ -572,6 +711,8 @@
|
|
572
711
|
'on',
|
573
712
|
'off',
|
574
713
|
'once',
|
714
|
+
'delegate_on',
|
715
|
+
'delegate_off',
|
575
716
|
'trigger'
|
576
717
|
];
|
577
718
|
_results = [];
|
@@ -589,8 +730,8 @@
|
|
589
730
|
]) || !callback) {
|
590
731
|
return this;
|
591
732
|
}
|
592
|
-
this.
|
593
|
-
events = this.
|
733
|
+
this._listeners || (this._listeners = {});
|
734
|
+
events = this._listeners[name] || (this._listeners[name] = []);
|
594
735
|
events.push({
|
595
736
|
callback: callback,
|
596
737
|
context: context,
|
@@ -616,21 +757,21 @@
|
|
616
757
|
},
|
617
758
|
off: function (name, callback, context) {
|
618
759
|
var ev, events, i, j, names, retain, _i, _j, _len, _len1;
|
619
|
-
if (!this.
|
760
|
+
if (!this._listeners || !eventsApi(this, 'off', name, [
|
620
761
|
callback,
|
621
762
|
context
|
622
763
|
])) {
|
623
764
|
return this;
|
624
765
|
}
|
625
766
|
if (!name && !callback && !context) {
|
626
|
-
this.
|
767
|
+
this._listeners = void 0;
|
627
768
|
return this;
|
628
769
|
}
|
629
|
-
names = name ? [name] : Object.keys(this.
|
770
|
+
names = name ? [name] : Object.keys(this._listeners);
|
630
771
|
for (i = _i = 0, _len = names.length; _i < _len; i = ++_i) {
|
631
772
|
name = names[i];
|
632
|
-
if (events = this.
|
633
|
-
this.
|
773
|
+
if (events = this._listeners[name]) {
|
774
|
+
this._listeners[name] = retain = [];
|
634
775
|
if (callback || context) {
|
635
776
|
for (j = _j = 0, _len1 = events.length; _j < _len1; j = ++_j) {
|
636
777
|
ev = events[j];
|
@@ -640,28 +781,68 @@
|
|
640
781
|
}
|
641
782
|
}
|
642
783
|
if (!retain.length) {
|
643
|
-
delete this.
|
784
|
+
delete this._listeners[name];
|
644
785
|
}
|
645
786
|
}
|
646
787
|
}
|
647
788
|
return this;
|
648
789
|
},
|
790
|
+
delegate_on: function (delegator) {
|
791
|
+
this._delegators || (this._delegators = new collection.List());
|
792
|
+
this._delegators.append(delegator);
|
793
|
+
return this;
|
794
|
+
},
|
795
|
+
delegate_off: function (delegator) {
|
796
|
+
if (!this._delegators) {
|
797
|
+
return this;
|
798
|
+
}
|
799
|
+
this._delegators.remove(delegator);
|
800
|
+
return this;
|
801
|
+
},
|
802
|
+
delegate: function () {
|
803
|
+
var event, listeners, listenersForAll;
|
804
|
+
if (this._delegators && this._delegators.size() > 0) {
|
805
|
+
delegateEvents(this._delegators, arguments);
|
806
|
+
}
|
807
|
+
if (!this._listeners) {
|
808
|
+
return this;
|
809
|
+
}
|
810
|
+
event = arguments[arguments.length - 1];
|
811
|
+
event.deliverer = this;
|
812
|
+
listeners = this._listeners[event.name];
|
813
|
+
listenersForAll = this._listeners.all;
|
814
|
+
if (listeners) {
|
815
|
+
triggerEvents(listeners, arguments);
|
816
|
+
}
|
817
|
+
if (listenersForAll) {
|
818
|
+
triggerEvents(listenersForAll, arguments);
|
819
|
+
}
|
820
|
+
return this;
|
821
|
+
},
|
649
822
|
trigger: function (name) {
|
650
|
-
var
|
651
|
-
|
823
|
+
var args, listeners, listenersForAll;
|
824
|
+
args = [].slice.call(arguments, 1);
|
825
|
+
args.push({
|
826
|
+
origin: this,
|
827
|
+
name: name,
|
828
|
+
deliverer: this
|
829
|
+
});
|
830
|
+
if (this._delegators && this._delegators.size() > 0) {
|
831
|
+
delegateEvents(this._delegators, args);
|
832
|
+
}
|
833
|
+
if (!this._listeners) {
|
652
834
|
return this;
|
653
835
|
}
|
654
|
-
args = slice.call(arguments, 1);
|
655
836
|
if (!eventsApi(this, 'trigger', name, args)) {
|
656
837
|
return this;
|
657
838
|
}
|
658
|
-
|
659
|
-
|
660
|
-
if (
|
661
|
-
triggerEvents(
|
839
|
+
listeners = this._listeners[name];
|
840
|
+
listenersForAll = this._listeners.all;
|
841
|
+
if (listeners) {
|
842
|
+
triggerEvents(listeners, args);
|
662
843
|
}
|
663
|
-
if (
|
664
|
-
triggerEvents(
|
844
|
+
if (listenersForAll) {
|
845
|
+
triggerEvents(listenersForAll, args);
|
665
846
|
}
|
666
847
|
return this;
|
667
848
|
},
|
@@ -714,15 +895,20 @@
|
|
714
895
|
}
|
715
896
|
return true;
|
716
897
|
};
|
717
|
-
triggerEvents = function (
|
898
|
+
triggerEvents = function (listeners, args) {
|
718
899
|
var ev, _i, _len, _results;
|
719
900
|
_results = [];
|
720
|
-
for (_i = 0, _len =
|
721
|
-
ev =
|
901
|
+
for (_i = 0, _len = listeners.length; _i < _len; _i++) {
|
902
|
+
ev = listeners[_i];
|
722
903
|
_results.push(ev.callback.apply(ev.ctx, args));
|
723
904
|
}
|
724
905
|
return _results;
|
725
906
|
};
|
907
|
+
delegateEvents = function (delegators, args) {
|
908
|
+
return delegators.forEach(function (delegator) {
|
909
|
+
return Event.delegate.apply(delegator, args);
|
910
|
+
});
|
911
|
+
};
|
726
912
|
listenMethods = {
|
727
913
|
listenTo: 'on',
|
728
914
|
listenToOnce: 'once'
|
@@ -752,7 +938,7 @@
|
|
752
938
|
'./event'
|
753
939
|
], function (utils, compose, event) {
|
754
940
|
'use strict';
|
755
|
-
var get, set;
|
941
|
+
var get, getAll, set;
|
756
942
|
set = function (key, val) {
|
757
943
|
var after, attrs, before, _ref, _ref1;
|
758
944
|
if (!key) {
|
@@ -787,20 +973,29 @@
|
|
787
973
|
}
|
788
974
|
}
|
789
975
|
if (Object.keys(after).length !== 0) {
|
790
|
-
this.trigger('change',
|
791
|
-
before: before,
|
792
|
-
after: after
|
793
|
-
}, true);
|
976
|
+
this.trigger('change', this, before, after);
|
794
977
|
}
|
795
978
|
return this;
|
796
979
|
};
|
797
980
|
get = function (attr) {
|
798
|
-
|
981
|
+
if (this.attrs) {
|
982
|
+
return this.attrs[attr];
|
983
|
+
} else {
|
984
|
+
return void 0;
|
985
|
+
}
|
986
|
+
};
|
987
|
+
getAll = function () {
|
988
|
+
if (this.attrs) {
|
989
|
+
return utils.clone(this.attrs);
|
990
|
+
} else {
|
991
|
+
return {};
|
992
|
+
}
|
799
993
|
};
|
800
994
|
return function () {
|
801
995
|
compose.mixin(this, event.withEvent);
|
802
996
|
this.set = set;
|
803
|
-
|
997
|
+
this.get = get;
|
998
|
+
return this.getAll = getAll;
|
804
999
|
};
|
805
1000
|
});
|
806
1001
|
}.call(this));
|
@@ -870,6 +1065,45 @@
|
|
870
1065
|
};
|
871
1066
|
});
|
872
1067
|
}.call(this));
|
1068
|
+
(function () {
|
1069
|
+
define('build/js/disposer', [
|
1070
|
+
'./compose',
|
1071
|
+
'./advice'
|
1072
|
+
], function (compose, advice) {
|
1073
|
+
'use strict';
|
1074
|
+
var addDisposer, dispose;
|
1075
|
+
addDisposer = function (callback) {
|
1076
|
+
if (!this.__disposers) {
|
1077
|
+
this.__disposers = [];
|
1078
|
+
}
|
1079
|
+
return this.__disposers.push(callback);
|
1080
|
+
};
|
1081
|
+
dispose = function () {
|
1082
|
+
var callback, _i, _len, _ref, _results;
|
1083
|
+
if (!this.__disposers) {
|
1084
|
+
return;
|
1085
|
+
}
|
1086
|
+
if (this.__disposers) {
|
1087
|
+
_ref = this.__disposers;
|
1088
|
+
_results = [];
|
1089
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
1090
|
+
callback = _ref[_i];
|
1091
|
+
_results.push(callback.call(this));
|
1092
|
+
}
|
1093
|
+
return _results;
|
1094
|
+
}
|
1095
|
+
};
|
1096
|
+
return function () {
|
1097
|
+
this.addDisposer = addDisposer;
|
1098
|
+
if (this.dispose) {
|
1099
|
+
compose.mixin(this, advice.withAdvice);
|
1100
|
+
return this.after('dispose', dispose);
|
1101
|
+
} else {
|
1102
|
+
return this.dispose = dispose;
|
1103
|
+
}
|
1104
|
+
};
|
1105
|
+
});
|
1106
|
+
}.call(this));
|
873
1107
|
(function () {
|
874
1108
|
var __hasProp = {}.hasOwnProperty, __extends = function (child, parent) {
|
875
1109
|
for (var key in parent) {
|
@@ -891,8 +1125,10 @@
|
|
891
1125
|
'./property',
|
892
1126
|
'./serialize',
|
893
1127
|
'./event',
|
894
|
-
'./utils'
|
895
|
-
|
1128
|
+
'./utils',
|
1129
|
+
'./collection',
|
1130
|
+
'./disposer'
|
1131
|
+
], function (compose, advice, lifecycle, property, serialize, event, utils, collection, disposer) {
|
896
1132
|
'use strict';
|
897
1133
|
var define, mixin;
|
898
1134
|
define = function (options, constructor, prototype) {
|
@@ -954,9 +1190,11 @@
|
|
954
1190
|
'with': {
|
955
1191
|
advice: advice.withAdvice,
|
956
1192
|
property: property,
|
1193
|
+
disposer: disposer,
|
957
1194
|
lifecycle: lifecycle,
|
958
1195
|
event: event.withEvent,
|
959
|
-
serialize: serialize
|
1196
|
+
serialize: serialize,
|
1197
|
+
collection: collection
|
960
1198
|
},
|
961
1199
|
util: utils
|
962
1200
|
};
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dou-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hearty, Oh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|