flight-for-rails 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,6 +3,6 @@ define("lib/registry",["./utils"],function(a){function b(a,b){var c,d,e,f=b.leng
3
3
  define("tools/debug/debug",["../../lib/registry","../../lib/utils"],function(a,b){function d(a,b,c){var c=c||{},e=c.obj||window,g=c.path||(e==window?"window":""),h=Object.keys(e);h.forEach(function(c){(f[a]||a)(b,e,c)&&console.log([g,".",c].join(""),"->",["(",typeof e[c],")"].join(""),e[c]),Object.prototype.toString.call(e[c])=="[object Object]"&&e[c]!=e&&g.split(".").indexOf(c)==-1&&d(a,b,{obj:e[c],path:[g,c].join(".")})})}function e(a,b,c,e){!b||typeof c==b?d(a,c,e):console.error([c,"must be",b].join(" "))}function g(a,b){e("name","string",a,b)}function h(a,b){e("nameContains","string",a,b)}function i(a,b){e("type","function",a,b)}function j(a,b){e("value",null,a,b)}function k(a,b){e("valueCoerced",null,a,b)}function l(a,b){d(a,null,b)}function p(){var a=[].slice.call(arguments);c.eventNames.length||(c.eventNames=m),c.actions=a.length?a:m,t()}function q(){var a=[].slice.call(arguments);c.actions.length||(c.actions=m),c.eventNames=a.length?a:m,t()}function r(){c.actions=[],c.eventNames=[],t()}function s(){c.actions=m,c.eventNames=m,t()}function t(){window.localStorage&&(localStorage.setItem("logFilter_eventNames",c.eventNames),localStorage.setItem("logFilter_actions",c.actions))}function u(){var a={eventNames:window.localStorage&&localStorage.getItem("logFilter_eventNames")||n,actions:window.localStorage&&localStorage.getItem("logFilter_actions")||o};return Object.keys(a).forEach(function(b){var c=a[b];typeof c=="string"&&c!==m&&(a[b]=c.split(","))}),a}var c,f={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}},m="all",n=[],o=[],c=u();return{enable:function(a){this.enabled=!!a,a&&window.console&&(console.info("Booting in DEBUG mode"),console.info("You can configure event logging with DEBUG.events.logAll()/logNone()/logByName()/logByAction()")),window.DEBUG=this},find:{byName:g,byNameContains:h,byType:i,byValue:j,byValueCoerced:k,custom:l},events:{logFilter:c,logByAction:p,logByName:q,logAll:s,logNone:r}}})
4
4
  define("lib/compose",["./utils","../tools/debug/debug"],function(a,b){function f(a,b){if(!c)return;var e=Object.create(null);Object.keys(a).forEach(function(c){if(d.indexOf(c)<0){var f=Object.getOwnPropertyDescriptor(a,c);f.writable=b,e[c]=f}}),Object.defineProperties(a,e)}function g(a,b,d){var e;if(!c||!a.hasOwnProperty(b)){d.call(a);return}e=Object.getOwnPropertyDescriptor(a,b).writable,Object.defineProperty(a,b,{writable:!0}),d.call(a),Object.defineProperty(a,b,{writable:e})}function h(a,b){a.mixedIn=a.hasOwnProperty("mixedIn")?a.mixedIn:[],b.forEach(function(b){a.mixedIn.indexOf(b)==-1&&(f(a,!1),b.call(a),a.mixedIn.push(b))}),f(a,!0)}var c=b.enabled&&!a.isEnumerable(Object,"getOwnPropertyDescriptor"),d=["mixedIn"];if(c)try{Object.getOwnPropertyDescriptor(Object,"keys")}catch(e){c=!1}return{mixin:h,unlockProperty:g}})
5
5
  define("lib/advice",["./utils","./compose"],function(a,b){var c={around:function(a,b){return function(){var d=0,e=arguments.length,f=new Array(e+1);f[0]=a.bind(this);for(;d<e;d++)f[d+1]=arguments[d];return b.apply(this,f)}},before:function(a,b){var c=typeof b=="function"?b:b.obj[b.fnName];return function(){return c.apply(this,arguments),a.apply(this,arguments)}},after:function(a,b){var c=typeof b=="function"?b:b.obj[b.fnName];return function(){var d=(a.unbound||a).apply(this,arguments);return c.apply(this,arguments),d}},withAdvice:function(){["before","after","around"].forEach(function(a){this[a]=function(d,e){b.unlockProperty(this,d,function(){return typeof this[d]=="function"?this[d]=c[a](this[d],e):this[d]=e})}},this)}};return c})
6
- define("lib/component",["./advice","./utils","./compose","./registry"],function(a,b,c,d){function g(a){a.events.slice().forEach(function(a){var b=[a.type];a.element&&b.unshift(a.element),typeof a.callback=="function"&&b.push(a.callback),this.off.apply(this,b)},a.instance)}function h(){g(d.findInstanceInfo(this))}function i(){var a=d.findComponentInfo(this);a&&Object.keys(a.instances).forEach(function(b){var c=a.instances[b];c.instance.teardown()})}function j(a,b){try{window.postMessage(b,"*")}catch(c){throw console.log("unserializable data for event",a,":",b),new Error(["The event",a,"on component",this.toString(),"was triggered with non-serializable data"].join(" "))}}function k(){this.trigger=function(){var a,b,c,d,e,f=arguments.length-1,g=arguments[f];return typeof g!="string"&&(!g||!g.defaultBehavior)&&(f--,c=g),f==1?(a=$(arguments[0]),d=arguments[1]):(a=this.$node,d=arguments[0]),d.defaultBehavior&&(e=d.defaultBehavior,d=$.Event(d.type)),b=d.type||d,window.DEBUG&&window.DEBUG.enabled&&window.postMessage&&j.call(this,b,c),typeof this.attr.eventData=="object"&&(c=$.extend(!0,{},this.attr.eventData,c)),a.trigger(d||b,c),e&&!d.isDefaultPrevented()&&(this[e]||e).call(this),a},this.on=function(){var a,c,d,e,f=arguments.length-1,g=arguments[f];typeof g=="object"?e=b.delegate(this.resolveDelegateRules(g)):e=g,f==2?(a=$(arguments[0]),c=arguments[1]):(a=this.$node,c=arguments[0]);if(typeof e!="function"&&typeof e!="object")throw new Error("Unable to bind to '"+c+"' because the given callback is not a function or an object");return d=e.bind(this),d.target=e,e.guid&&(d.guid=e.guid),a.on(c,d),e.guid=d.guid,d},this.off=function(){var a,b,c,d=arguments.length-1;return typeof arguments[d]=="function"&&(c=arguments[d],d-=1),d==1?(a=$(arguments[0]),b=arguments[1]):(a=this.$node,b=arguments[0]),a.off(b,c)},this.resolveDelegateRules=function(a){var b={};return Object.keys(a).forEach(function(c){if(!c in this.attr)throw new Error('Component "'+this.toString()+'" wants to listen on "'+c+'" but no such attribute was defined.');b[this.attr[c]]=a[c]},this),b},this.defaultAttrs=function(a){b.push(this.defaults,a,!0)||(this.defaults=a)},this.select=function(a){return this.$node.find(this.attr[a])},this.initialize=$.noop,this.teardown=h}function l(a){var c=arguments.length,e=new Array(c-1);for(var f=1;f<c;f++)e[f-1]=arguments[f];if(!a)throw new Error("Component needs to be attachTo'd a jQuery object, native node or selector string");var g=b.merge.apply(b,e);$(a).each(function(a,b){var c=b.jQuery?b[0]:b,e=d.findComponentInfo(this);if(e&&e.isAttachedTo(c))return;new this(b,g)}.bind(this))}function m(){function j(a,b){b=b||{},this.identity=f++;if(!a)throw new Error("Component needs a node");a.jquery?(this.node=a[0],this.$node=a):(this.node=a,this.$node=$(a)),this.toString=j.toString,window.DEBUG&&window.DEBUG.enabled&&(this.describe=this.toString());var c=Object.create(b);for(var d in this.defaults)b.hasOwnProperty(d)||(c[d]=this.defaults[d]);this.attr=c,Object.keys(this.defaults||{}).forEach(function(a){if(this.defaults[a]===null&&this.attr[a]===null)throw new Error('Required attribute "'+a+'" not specified in attachTo for component "'+this.toString()+'".')},this),this.initialize.call(this,b)}var b=arguments.length,g=new Array(b);for(var h=0;h<b;h++)g[h]=arguments[h];return j.toString=function(){var a=g.map(function(a){if(a.name==null){var b=a.toString().match(e);return b&&b[1]?b[1]:""}return a.name!="withBaseComponent"?a.name:""}).filter(Boolean).join(", ");return a},window.DEBUG&&window.DEBUG.enabled&&(j.describe=j.toString()),j.attachTo=l,j.teardownAll=i,g.unshift(k,a.withAdvice,d.withRegistration),c.mixin(j.prototype,g),j}var e=/function (.*?)\s?\(/,f=0;return m.teardownAll=function(){d.components.slice().forEach(function(a){a.component.teardownAll()}),d.reset()},m})
7
- define("lib/logger",["./compose","./utils"],function(a,b){function d(a){var b=a.tagName?a.tagName.toLowerCase():a.toString(),c=a.className?"."+a.className:"",d=b+c;return a.tagName?["'","'"].join(d):d}function e(a,b,e){var f,g,h,i,j,k,l,m;typeof e[e.length-1]=="function"&&(h=e.pop(),h=h.unbound||h),typeof e[e.length-1]=="object"&&e.pop(),e.length==2?(g=e[0],f=e[1]):(g=b.$node[0],f=e[0]),window.DEBUG&&window.DEBUG.enabled&&(j=DEBUG.events.logFilter,l=j.actions=="all"||j.actions.indexOf(a)>-1,k=function(a){return a.test?a:new RegExp("^"+a.replace(/\*/g,".*")+"$")},m=j.eventNames=="all"||j.eventNames.some(function(a){return k(a).test(f)}),l&&m&&console.info(c[a],a,"["+f+"]",d(g),b.constructor.toString(),h&&(i=h.name||h.displayName)&&"-> "+i))}function f(){this.before("trigger",function(){e("trigger",this,b.toArray(arguments))}),this.before("on",function(){e("on",this,b.toArray(arguments))}),this.before("off",function(a){e("off",this,b.toArray(arguments))})}var c={on:"<-",trigger:"->",off:"x "};return f})
6
+ define("lib/logger",["./compose","./utils"],function(a,b){function d(a){var b=a.tagName?a.tagName.toLowerCase():a.toString(),c=a.className?"."+a.className:"",d=b+c;return a.tagName?["'","'"].join(d):d}function e(a,b,e){var f,g,h,i,j,k,l,m;typeof e[e.length-1]=="function"&&(h=e.pop(),h=h.unbound||h),typeof e[e.length-1]=="object"&&e.pop(),e.length==2?(g=e[0],f=e[1]):(g=b.$node[0],f=e[0]),window.DEBUG&&window.DEBUG.enabled&&(j=DEBUG.events.logFilter,l=j.actions=="all"||j.actions.indexOf(a)>-1,k=function(a){return a.test?a:new RegExp("^"+a.replace(/\*/g,".*")+"$")},m=j.eventNames=="all"||j.eventNames.some(function(a){return k(a).test(f)}),l&&m&&console.info(c[a],a,"["+f+"]",d(g),b.constructor.describe.split(" ").slice(0,3).join(" ")))}function f(){this.before("trigger",function(){e("trigger",this,b.toArray(arguments))}),this.before("on",function(){e("on",this,b.toArray(arguments))}),this.before("off",function(a){e("off",this,b.toArray(arguments))})}var c={on:"<-",trigger:"->",off:"x "};return f})
7
+ define("lib/component",["./advice","./utils","./compose","./registry","./logger","../tools/debug/debug"],function(a,b,c,d,e,f){function i(a){a.events.slice().forEach(function(a){var b=[a.type];a.element&&b.unshift(a.element),typeof a.callback=="function"&&b.push(a.callback),this.off.apply(this,b)},a.instance)}function j(){i(d.findInstanceInfo(this))}function k(){var a=d.findComponentInfo(this);a&&Object.keys(a.instances).forEach(function(b){var c=a.instances[b];c.instance.teardown()})}function l(a,b){try{window.postMessage(b,"*")}catch(c){throw console.log("unserializable data for event",a,":",b),new Error(["The event",a,"on component",this.toString(),"was triggered with non-serializable data"].join(" "))}}function m(){this.trigger=function(){var a,b,c,d,e,g=arguments.length-1,h=arguments[g];return typeof h!="string"&&(!h||!h.defaultBehavior)&&(g--,c=h),g==1?(a=$(arguments[0]),d=arguments[1]):(a=this.$node,d=arguments[0]),d.defaultBehavior&&(e=d.defaultBehavior,d=$.Event(d.type)),b=d.type||d,f.enabled&&window.postMessage&&l.call(this,b,c),typeof this.attr.eventData=="object"&&(c=$.extend(!0,{},this.attr.eventData,c)),a.trigger(d||b,c),e&&!d.isDefaultPrevented()&&(this[e]||e).call(this),a},this.on=function(){var a,c,d,e,f=arguments.length-1,g=arguments[f];typeof g=="object"?e=b.delegate(this.resolveDelegateRules(g)):e=g,f==2?(a=$(arguments[0]),c=arguments[1]):(a=this.$node,c=arguments[0]);if(typeof e!="function"&&typeof e!="object")throw new Error("Unable to bind to '"+c+"' because the given callback is not a function or an object");return d=e.bind(this),d.target=e,e.guid&&(d.guid=e.guid),a.on(c,d),e.guid=d.guid,d},this.off=function(){var a,b,c,d=arguments.length-1;return typeof arguments[d]=="function"&&(c=arguments[d],d-=1),d==1?(a=$(arguments[0]),b=arguments[1]):(a=this.$node,b=arguments[0]),a.off(b,c)},this.resolveDelegateRules=function(a){var b={};return Object.keys(a).forEach(function(c){if(!c in this.attr)throw new Error('Component "'+this.toString()+'" wants to listen on "'+c+'" but no such attribute was defined.');b[this.attr[c]]=a[c]},this),b},this.defaultAttrs=function(a){b.push(this.defaults,a,!0)||(this.defaults=a)},this.select=function(a){return this.$node.find(this.attr[a])},this.initialize=$.noop,this.teardown=j}function n(a){var c=arguments.length,e=new Array(c-1);for(var f=1;f<c;f++)e[f-1]=arguments[f];if(!a)throw new Error("Component needs to be attachTo'd a jQuery object, native node or selector string");var g=b.merge.apply(b,e);$(a).each(function(a,b){var c=b.jQuery?b[0]:b,e=d.findComponentInfo(this);if(e&&e.isAttachedTo(c))return;new this(b,g)}.bind(this))}function o(){function l(a,b){b=b||{},this.identity=h++;if(!a)throw new Error("Component needs a node");a.jquery?(this.node=a[0],this.$node=a):(this.node=a,this.$node=$(a)),this.toString=l.toString,f.enabled&&(this.describe=this.toString());var c=Object.create(b);for(var d in this.defaults)b.hasOwnProperty(d)||(c[d]=this.defaults[d]);this.attr=c,Object.keys(this.defaults||{}).forEach(function(a){if(this.defaults[a]===null&&this.attr[a]===null)throw new Error('Required attribute "'+a+'" not specified in attachTo for component "'+this.toString()+'".')},this),this.initialize.call(this,b)}var b=arguments.length,i=new Array(b+3);for(var j=0;j<b;j++)i[j]=arguments[j];return l.toString=function(){var a=i.map(function(a){if(a.name==null){var b=a.toString().match(g);return b&&b[1]?b[1]:""}return a.name!="withBaseComponent"?a.name:""}).filter(Boolean).join(", ");return a},f.enabled&&(l.describe=l.toString()),l.attachTo=n,l.teardownAll=k,f.enabled&&i.unshift(e),i.unshift(m,a.withAdvice,d.withRegistration),c.mixin(l.prototype,i),l}var g=/function (.*?)\s?\(/,h=0;return o.teardownAll=function(){d.components.slice().forEach(function(a){a.component.teardownAll()}),d.reset()},o})
8
8
  define("lib/index",["./advice","./component","./compose","./logger","./registry","./utils"],function(a,b,c,d,e,f){return{advice:a,component:b,compose:c,logger:d,registry:e,utils:f}});context.flight=require("lib/index")})(this);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flight-for-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-24 00:00:00.000000000 Z
12
+ date: 2013-05-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails