From 7525e7febe9bee87aa25b2c9d7779668cc4d35ea Mon Sep 17 00:00:00 2001 From: Tobias von Klipstein Date: Fri, 26 Oct 2012 18:06:28 +0200 Subject: [PATCH] Update to Bonsai 0.4.1 --- ajax/libs/bonsai/0.4.1/bonsai.min.js | 298 +++++++++++++++ ajax/libs/bonsai/0.4/bonsai.min.js | 522 +++++++++++++-------------- ajax/libs/bonsai/package.json | 2 +- 3 files changed, 559 insertions(+), 263 deletions(-) create mode 100644 ajax/libs/bonsai/0.4.1/bonsai.min.js diff --git a/ajax/libs/bonsai/0.4.1/bonsai.min.js b/ajax/libs/bonsai/0.4.1/bonsai.min.js new file mode 100644 index 000000000..e4a174cb9 --- /dev/null +++ b/ajax/libs/bonsai/0.4.1/bonsai.min.js @@ -0,0 +1,298 @@ +/* +(The MIT License) + +Copyright 2012 uxebu Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. + +External libraries (each with their own license): + + - requirejs: https://github.com/jrburke/requirejs/blob/master/LICENSE + - jasmine: https://github.com/pivotal/jasmine/blob/master/MIT.LICENSE + - phantom-jasmine: Apache 2 - https://github.com/jcarver989/phantom-jasmine/issues/8 + - closure: http://code.google.com/p/closure-compiler/source/browse/trunk/COPYING + - qc.js: https://github.com/darrint/qc.js/blob/master/COPYING + - calc_box: http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html + +External resources (each with their own license): + + - cinematicBoomNorm(ogg/mp3/m4a): http://creativecommons.org/licenses/by/3.0/ + http://www.freesound.org/people/HerbertBoland/sounds/33637/ + +*/ +(function __bonsaiRunnerCode__(){function ta(a){if(!(this instanceof ta))return new ta(a);this.name="ParserError";this.message=a[0]}function $(a,b){this.x=a||0;this.y=b||0}function wd(a,b,c){this.translationData={};this.numericStartValues=c?c.toNumeric.call(this.translationData,a,!1):[a];this.numericEndValues=c?c.toNumeric.call(this.translationData,b,!0):[b];this.length=this.numericStartValues.length;this.translator=c}function Wf(){var a=this.movies=[];this.add=function(b){-1===a.indexOf(b)&&a.push(b)}; +this.remove=function(b){b=a.indexOf(b);delete a[b]}}function Xf(a){var b=this.type,c=Yf[b];do a.emit(b,this),a=a.parent;while(c&&!this._isStopped&&a)}function Zf(){this._isStopped=!0}function xd(a,b){var c,d,e,f=[],g=!0,h=[],k=a&&a.length||0,b=b||P;if(0===k)return[];for(var j,n,l=0;l>24&255,a>>16&255,a>>8&255,(a>>0&255)/255)}function Wb(a,b,c,d){var e,f,g;e=a/255;f=b/255;g=c/255;var h,k,j,n,l=U(e,f,g);k=V(e,f,g);j=(k+l)/2;if(l==k)h=k=0;else{n=l-k;k=0.5c?c+1:16*c?a+6*(b-a)*c:1>2*c?b:2>3*c?a+6*(b-a)*(2/3-c):a}function yd(a,b,c){var b=0.5>=c?c*(b+1):c+b-c*b,d=2*c-b,c=255*Ac(d,b,a+1/3),e=255*Ac(d,b,a),a=255*Ac(d,b,a-1/3);return la(c)<<24|la(e)<<16|la(a)<<8}function Bc(a,b,c){this.context=a;this.listener=b;this.times=c||Infinity}function zd(a){this.pendingAssets=a}function Ad(a,b){this.disconnect=b;this.notifyRenderer= +a}function Bd(a,b){this.runnerUrl=a;this.doc=b}function W(a){return $f.mixin({},a)}function s(a,b,c){a=document.createElementNS("http://www.w3.org/2000/svg",a);if(b)for(var d in b)a.setAttribute(d,b[d]);c&&c.appendChild(a);return a}function Cd(a){for(var a=a||[],b,c=0,d=a.length;ca?b:a}function gg(a){if(Ec(a)){var a=+a%(2*hg)||0,b=this._matrix,c=b.transformPoint(this.origin),d=c.x,c=c.y;b.tx-=d;b.ty-=c;b.rotate(a-this.rotation);b.tx+=d;b.ty+=c;this._owner._mutatedAttributes.matrix=!0}}function ig(){var a,b=this._matrix.clone(),c=this._scaleX,d=this._scaleY;if(1!==c||1!==d)a=b.transformPoint(this._origin),b.tx-=a.x,b.ty-=a.y,b.scale(c,d),b.tx+=a.x,b.ty+=a.y;return b}function jg(a){var b=this._matrix;b.a= +a.a;b.b=a.b;b.c=a.c;b.d=a.d;b.tx=a.tx;b.ty=a.ty}function kg(){return this.matrix.tx}function lg(a){this._matrix.tx=1===this._scaleX?a:this._matrix.tx+(a-this.matrix.tx);this._owner._mutatedAttributes.matrix=!0}function mg(){return this.matrix.ty}function ng(a){this._matrix.ty=1===this._scaleY?a:this._matrix.ty+(a-this.matrix.ty);this._owner._mutatedAttributes.matrix=!0}function og(){return this._scaleX}function pg(a){Ec(a)&&(this._scaleX=+a,this._owner._mutatedAttributes.matrix=!0)}function qg(){return this._scaleY} +function rg(a){Ec(a)&&(this._scaleY=+a,this._owner._mutatedAttributes.matrix=!0)}function sg(){return(this.scaleX+this.scaleY)/2}function tg(a){this.scaleX=this.scaleY=a}function ug(a){this._opacity=1a?0:+a}function vg(){return this._origin.clone()}function wg(a){var b=this._origin;b.x=a.x;b.y=a.y}function xg(){return this._cursor}function yg(a){a?/^(?:default|pointer|wait|progress)$/.test(a)&&(this._cursor=a):this._cursor=null}function zg(){return this._filters.slice(0)}function Ag(a){a?(a= +[].concat(a),this._filters=a=a.map(function(a){return a instanceof Id.BaseFilter?a:new Id[a]})):this._filters.length=0}function Bg(a){var b=this._owner;b._mutatedAttributes.clipId=!0;if(a){if(a.stage&&!a._isOffStage)throw Error("You cannot set a clip that has been previously added to the stage");if(!("composeRenderMessage"in a))throw Error("Not a valid clip element");b.stage&&F.registerOffStageObj(b,a,b.stage,"clip");this._clipId=a.id;this._clip=a}else this._clip&&F.unregisterOffStageObj(b,this._clip), +this._clipId=this._clip=null}function Cg(){return this._clip}function Dg(a){var b=this._owner;b._mutatedAttributes.maskId=!0;if(a){if(a.stage&&!a._isOffStage)throw Error("You cannot set a mask that has been previously added to the stage");if(!("composeRenderMessage"in a))throw Error("Not a valid mask");b.stage&&F.registerOffStageObj(b,a,b.stage,"mask");this._maskId=a.id;this._mask=a}else this._mask&&F.unregisterOffStageObj(b,this._mask),this._maskId=this._mask=null}function Eg(){return this._mask} +function F(){Object.defineProperty(this,"id",{value:Fg++});this._attributes=Object.create(null,{_owner:D(this),_matrix:D(new Gg),matrix:G(ig,jg,!0),_filters:D([],!0),filters:G(zg,Ag,!0),_opacity:D(1,!0),opacity:G(Hg,ug,!0),_origin:D(new Ig),origin:G(vg,wg,!0),rotation:G(fg,gg,!0),_scaleX:D(1,!0),_scaleY:D(1,!0),scale:G(sg,tg,!0),scaleX:G(og,pg,!0),scaleY:G(qg,rg,!0),x:G(kg,lg,!0),y:G(mg,ng,!0),clip:G(Cg,Bg,!0),_clip:D(null,!0),_clipId:D(null,!0),mask:G(Eg,Dg,!0),_mask:D(null,!0),_maskId:D(null,!0), +cursor:G(xg,yg,!0),_cursor:D(null,!0),fillRule:D("inherit",!0),visible:D(!0,!0)});this._isOffStage=!1;this._renderAttributes={matrix:"matrix",filters:"_filters",opacity:"_opacity",clipId:"_clipId",maskId:"_maskId",cursor:"_cursor",fillRule:"fillRule",visible:"visible"};this._mutatedAttributes=ua.mixin({},this._renderAttributes)}function Jg(a){return-1!==this.indexOf(a)}function Jd(a){this.children=[];this.owner=a}function Kd(a){Fc.prototype._activate.call(this,a);for(var b=this.displayList.children, +c=0,d=b.length;ce?(c/=d,e=q+o/J(c,2),d=va(e),c*=d,p=f=0):(o=(f===g?-1:1)*va(e),f=o*c*p/d,p=-o*d*i/c);i=f*n-p*j+(a+h)/2;n=f*j+p*n+(b+k)/2;b=Pd((b-n)/d);k=Pd((k-n)/d);b=ab&&(b=2*ca+b);0>k&&(k=2*ca+k);g&&b>k&&(b-=2*ca);!g&&k>b&&(k-=2*ca);return{cx:i,cy:n,rx:c,ry:d,startAngle:b,endAngle:k}}function Qd(a,b,c,d,e){if(0==e)return{left:[a,a,a,a],right:[a,b,c,d]};if(1==e)return{left:[a,b,c,d],right:[d,d,d,d]};var f=v.lerp(a,b,e),g=v.lerp(b, +c,e),c=v.lerp(c,d,e),b=v.lerp(f,g,e),g=v.lerp(g,c,e),e=v.lerp(b,g,e);return{left:[a,f,b,e],right:[e,g,c,d]}}function Lg(){return this._textFillColor}function Mg(a){this._textFillColor=Rd(a,this._textFillColor)}function Ng(){return this._textFillGradient}function Og(a){a&&(this._textFillGradient=Pg(a))}function Qg(){return this._fontFamily}function Rg(a){this._fontFamily=a?a.fontId||a:null}function Sg(){return this._glyphx}function Tg(a){Ua.isArray(a)&&(this._glyphx=a);a||(this._glyphx=null)}function Ug(){return this._glyphy} +function Vg(a){Ua.isArray(a)&&(this._glyphy=a);a||(this._glyphy=null)}function Wg(a){this._textStrokeColor=Rd(a,this._textStrokeColor)}function Sd(a){Td.call(this);a=""+a;Object.defineProperties(this._attributes,{text:E("",!0,!0),fontSize:E(null,!0,!0),fontFamily:wa(Qg,Rg,!0),_fontFamily:E(null,!0),fontStyle:E(null,!0,!0),fontWeight:E(null,!0,!0),_textFillColor:E(null,!0),textFillColor:wa(Lg,Mg,!0),_textFillGradient:E(null,!0),textFillGradient:wa(Ng,Og,!0),textFillOpacity:E(1,!0,!0),_glyphx:E(null, +!0),_glyphy:E(null,!0),glyphx:wa(Sg,Tg,!0),glyphy:wa(Ug,Vg,!0),textLineOpacity:E(1,!0,!0),_textStrokeColor:E(null,!0),textStrokeColor:wa(Xg,Wg,!0),textStrokeWidth:E(null,!0,!0),selectable:E(!0,!0,!0)});this._renderAttributes={fontSize:"fontSize",fontFamily:"_fontFamily",fontStyle:"fontStyle",fontWeight:"fontWeight",fillColor:"_textFillColor",fillGradient:"_textFillGradient",fillOpacity:"textFillOpacity",filters:"_filters",glyphx:"_glyphx",glyphy:"_glyphy",strokeOpacity:"textLineOpacity",strokeColor:"_textStrokeColor", +strokeWidth:"textStrokeWidth",opacity:"_opacity",text:"text",selectable:"selectable"};null!=a&&this.attr("text",a)}function Yg(){return this._textFillColor}function Zg(a){this._textFillColor=Ud(a,this._textFillColor)}function $g(){return this._textFillGradient}function ah(a){a&&(this._textFillGradient=bh(a))}function ch(){return this._fontFamily}function dh(a){this._fontFamily=a?a.fontId||a:null}function eh(a){this._textStrokeColor=Ud(a,this._textStrokeColor)}function fh(a){if("butt"===a||"round"=== +a||"square"===a)this._cap=""+a}function gh(a){if("miter"===a||"round"===a||"bevel"===a)this._join=""+a}function hh(a){1<=a&&(this._miterLimit=+a)}function ih(a){this._owner.clear();this._owner.addChild(new Jc(a))}function jh(){for(var a=this._owner.children(),b=[],c=0,d=a.length;cd.status||304==d.status?b(this.responseText):c(d.status+" ("+d.statusText+")")};d.onerror=c;d.send(null)}var $a={module$exports:function(a){return{isLoading:!1,isWaiting:0,waitingCallbacks:[],queue:[],load:function(b,c){var d=this,e=this.queue,f= +this.waitingCallbacks;this.isLoading||this.isWaiting?e.push([b,c]):(this.isLoading=!0,a(b,function(a){a?c(a):(c&&(d.isWaiting?f.push(c):c(null)),d.isLoading=!1,e.length&&d.load.apply(d,e.shift()))}))},wait:function(){this.isWaiting++},done:function(){this.isWaiting--;if(!this.isWaiting)for(var a=0,c=this.waitingCallbacks.length;aa?Math.pow(a,2)/2:-1*(--a*(a-2)-1)/2},cubicIn:function(a){return Math.pow(a,3)},cubicOut:function(a){return Math.pow(a-1,3)+1},cubicInOut:function(a){a*=2;return 1>a? +Math.pow(a,3)/2:(Math.pow(a-2,3)+2)/2},quartIn:function(a){return Math.pow(a,4)},quartOut:function(a){return-1*(Math.pow(a-1,4)-1)},quartInOut:function(a){a*=2;return 1>a?Math.pow(a,4)/2:-0.5*(Math.pow(a-2,4)-2)},quintIn:function(a){return Math.pow(a,5)},quintOut:function(a){return Math.pow(a-1,5)+1},quintInOut:function(a){a*=2;return 1>a?Math.pow(a,5)/2:(Math.pow(a-2,5)+2)/2},sineIn:function(a){return-1*Math.cos(a*(Math.PI/2))+1},sineOut:function(a){return Math.sin(a*(Math.PI/2))},sineInOut:function(a){return-1* +(Math.cos(Math.PI*a)-1)/2},expoIn:function(a){return 0===a?0:Math.pow(2,10*(a-1))},expoOut:function(a){return 1===a?1:-1*Math.pow(2,-10*a)+1},expoInOut:function(a){if(0===a)return 0;if(1===a)return 1;a*=2;if(1>a)return Math.pow(2,10*(a-1))/2;--a;return(-1*Math.pow(2,-10*a)+2)/2},circIn:function(a){return-1*(Math.sqrt(1-Math.pow(a,2))-1)},circOut:function(a){return Math.sqrt(1-Math.pow(a-1,2))},circInOut:function(a){a*=2;return 1>a?-0.5*(Math.sqrt(1-Math.pow(a,2))-1):0.5*(Math.sqrt(1-Math.pow(a-2, +2))+1)},backIn:function(a){return Math.pow(a,2)*(2.70158*a-1.70158)},backOut:function(a){a-=1;return Math.pow(a,2)*(2.70158*a+1.70158)+1},backInOut:function(a){a*=2;if(1>a)return Math.pow(a,2)*(3.5949095*a-2.5949095)/2;a-=2;return(Math.pow(a,2)*(3.5949095*a+2.5949095)+2)/2},elasticIn:function(a){if(0===a||1===a)return a;a-=1;return-1*Math.pow(2,10*a)*Math.sin(2*(a-0.075)*Math.PI/0.3)},elasticOut:function(a){return 0===a||1===a?a:Math.pow(2,-10*a)*Math.sin(2*(a-0.075)*Math.PI/0.3)+1},elasticInOut:function(a){if(0=== +a)return 0;a*=2;if(2===a)return 1;var b=0.3*1.5,c=b/4;if(1>a)return a-=1,-0.5*Math.pow(2,10*a)*Math.sin(2*(a-c)*Math.PI/b);a-=1;return 0.5*Math.pow(2,-10*a)*Math.sin(2*(a-c)*Math.PI/b)+1},bounceIn:function(a){return 1-ec.bounceOut(1-a)},bounceOut:function(a){return a<1/2.75?7.5625*Math.pow(a,2):a<2/2.75?7.5625*Math.pow(a-1.5/2.75,2)+0.75:a<2.5/2.75?7.5625*Math.pow(a-2.25/2.75,2)+0.9375:7.5625*Math.pow(a-2.625/2.75,2)+0.984375},bounceInOut:function(a){return 0.5>a?ec.bounceIn(2*a)/2:ec.bounceOut(2* +a-1)/2+0.5}};Ca.module$exports=ec;Ca.module$exports&&(Ca=Ca.module$exports);var db={};wd.prototype.at=function(a){for(var b=this.numericStartValues,c=this.numericEndValues,d=[],e=0,f=this.length;earguments.length,e=a.length;d&&(c=a[0]);for(d=d?1:0;d>24&255;d.g=c>>16&255;d.b=c>>8&255;break;default:throw Error("No support for setting: "+a);}return this};r.get=function(a){var b=this._properties;switch(a){case "r":case "g":case "b":return la(b[a]);case "a":return b[a];case "h":case "s":case "l":return b[a];default:throw Error("No support for getting: "+a);}};r.lighter=function(a){var b=this.clone();b.set("l",b.get("l")+(null==a?0.01:a));return b};r.darker=function(a){var b= +this.clone();b.set("l",b.get("l")-(null==a?0.01:a));return b};r.midpoint=function(a){a=aa(a);return new Wb((this.r()+a.r())/2,(this.g()+a.g())/2,(this.b()+a.b())/2,(this.a()+a.a())/2)};r.setColorMatrix=function(a){for(var b=[],c=this._properties,d=c.r,e=c.g,f=c.b,c=c.a,g=a.length;g--;)b[g]=+a[g];this.set("r",V(255,U(0,d*b[0]+e*b[1]+f*b[2]+c*b[3]+255*b[4])));this.set("g",V(255,U(0,d*b[5]+e*b[6]+f*b[7]+c*b[8]+255*b[9])));this.set("b",V(255,U(0,d*b[10]+e*b[11]+f*b[12]+c*b[13]+255*b[14])));this.set("a", +V(1,U(0,d*b[15]+e*b[16]+f*b[17]+c*b[18]+b[19])));return this};r._setPointAlongRange=function(a,b,c){var a=a.charAt(0),d=this[a]();switch(a){case "r":case "g":case "b":this.set(a,c?U(0,V(255,b*c+(d-c/2))):255*b);break;default:this.set(a,c?U(0,V(1,b*c+d-c/2)):b)}return this};r.randomize=function(a,b){if(!a||"string"==typeof a)a=a?[a]:["r","g","b"];for(var c=this.clone(),d=a.length;d--;)c._setPointAlongRange(a[d],di(),b);return c};r.clone=function(a){return a?aa(+this).set(a):aa(+this)};r.rgba=function(){return"rgba("+ +[this.r(),this.g(),this.b(),this.a()].join()+")"};r.rgb=function(){return"rgb("+[this.r(),this.g(),this.b()].join()+")"};r.hsla=function(){return"hsla("+[la(360*this.h()),la(100*this.s())+"%",la(100*this.l())+"%",this.a()].join()+")"};r.int32=function(){return((this.r()&255)<<24|(this.g()&255)<<16|(this.b()&255)<<8|255*this.a()&255)>>>0};r.toString=function(){return"0x"+("0000000"+(((this.r()&255)<<24|(this.g()&255)<<16|(this.b()&255)<<8|255*this.a()&255)>>>0).toString(16)).slice(-8)};aa.parse=function(a, +b){var c,a=""+a;a in Ne&&(a=Ne[a]);if(/^#[0-9a-f]{6}$/i.test(a))a=(parseInt(a.slice(1),16)<<8|255)>>>0;else if(/^#[0-9a-f]{8}$/i.test(a))a=parseInt(a.slice(1),16)>>>0;else if(/^#[0-9a-f]{3}$/i.test(a))var a=parseInt(a.slice(1),16),d=a&3840,e=a&240,f=a&15,a=(d<<20|d<<16|e<<16|e<<12|f<<12|f<<8|255)>>>0;if(!isNaN(a))return+a;a=a.split("(");if(2==a.length)switch(d=a[1].slice(0,-1).split(","),e=d.length,a[0]){case "rgb":c=255;case "rgba":if(4==e||3==e&&c)return((d[0]&255)<<24|(d[1]&255)<<16|(d[2]&255)<< +8|(c||255*V(1,U(0,d[3]))&255))>>>0;break;case "hsl":c=255;case "hsla":if(4==e||3==e&&c)return a=yd(d[0]%360/360,parseInt(d[1])/100,parseInt(d[2])/100),a|(c||255*d[3]&255)}return null==b?null:aa.parse(b)};A.module$exports=aa;A.module$exports&&(A=A.module$exports);var z={},ei=i,$c="".split,ad={addListener:function(a,b,c){2===arguments.length&&(c=b,b=null);var d=c instanceof Bc,e=typeof c;if("function"!=e&&"string"!=e&&!d)throw TypeError("Expected function or string, instead got "+e+".");d||(c=new Bc(b, +c));for(var d=this._events||(this._events={}),e=-1,f=$c.call(a," "),g=f.length;++e=g&&this.removeListener(a,c,d.listener);return this},listeners:function(a){var b=this._events||(this._events={}),a=":"+a;return b[a]||(b[a]=[])},once:function(a,b,c){2===arguments.length&&(c=b,b=null);return this.addListener(a,new Bc(b,c,1))},removeListener:function(a,b,c){2===arguments.length&&(c=b,b=null);for(var d,e,f,g,h=this._events||{},k=-1,j=$c.call(a," "),n=j.length;++k"+a+"<\/script>")):c.write('