agenda-libre-ruby/public/webshims/1.15.9/shims/FlashCanvas/flashcanvas.js

1 line
11 KiB
JavaScript
Raw Normal View History

window.FlashCanvasOptions=window.FlashCanvasOptions||{},webshims.$.extend(FlashCanvasOptions,{swfPath:webshims.cfg.basePath+"FlashCanvas/"}),window.ActiveXObject&&!window.CanvasRenderingContext2D&&function(i,j,z){function D(a){this.code=a,this.message=R[a]}function S(a){this.width=a}function v(a){this.id=a.C++}function k(a){this.G=a,this.id=a.C++}function m(a,b){this.canvas=a,this.B=b,this.d=b.id.slice(8),this.D(),this.C=0,this.f=this.u="";var c=this;setInterval(function(){0===o[c.d]&&c.e()},30)}function A(){if("complete"===j.readyState){j.detachEvent(E,A);for(var a=j.getElementsByTagName(r),b=0,c=a.length;c>b;++b)B.initElement(a[b])}}function F(){var a=event.srcElement,b=a.parentNode;a.blur(),b.focus()}function G(){var a=event.propertyName;if("width"===a||"height"===a){var b=event.srcElement,c=b[a],d=parseInt(c,10);(isNaN(d)||0>d)&&(d="width"===a?300:150),c===d?(b.style[a]=d+"px",b.getContext("2d").I(b.width,b.height)):b[a]=d}}function H(){i.detachEvent(I,H);for(var a in s){var b,c=s[a],d=c.firstChild;for(b in d)"function"==typeof d[b]&&(d[b]=l);for(b in c)"function"==typeof c[b]&&(c[b]=l);d.detachEvent(J,F),c.detachEvent(K,G)}i[L]=l,i[M]=l,i[N]=l,i[C]=l,i[O]=l}function T(){var a=j.getElementsByTagName("script"),a=a[a.length-1];return j.documentMode>=8?a.src:a.getAttribute("src",4)}function t(a){return(""+a).replace(/&/g,"&amp;").replace(/</g,"&lt;")}function U(a){return a.toLowerCase()}function h(a){throw new D(a)}function P(a){var b=parseInt(a.width,10),c=parseInt(a.height,10);(isNaN(b)||0>b)&&(b=300),(isNaN(c)||0>c)&&(c=150),a.width=b,a.height=c}var l=null,r="canvas",L="CanvasRenderingContext2D",M="CanvasGradient",N="CanvasPattern",C="FlashCanvas",O="G_vmlCanvasManager",J="onfocus",K="onpropertychange",E="onreadystatechange",I="onunload",w=((i[C+"Options"]||{}).swfPath||T().replace(/[^\/]+$/,""))+"flashcanvas.swf",e=new function(a){for(var b=0,c=a.length;c>b;b++)this[a[b]]=b}("toDataURL,save,restore,scale,rotate,translate,transform,setTransform,globalAlpha,globalCompositeOperation,strokeStyle,fillStyle,createLinearGradient,createRadialGradient,createPattern,lineWidth,lineCap,lineJoin,miterLimit,shadowOffsetX,shadowOffsetY,shadowBlur,shadowColor,clearRect,fillRect,strokeRect,beginPath,closePath,moveTo,lineTo,quadraticCurveTo,bezierCurveTo,arcTo,rect,arc,fill,stroke,clip,isPointInPath,font,textAlign,textBaseline,fillText,strokeText,measureText,drawImage,createImageData,getImageData,putImageData,addColorStop,direction,resize".split(",")),u={},p={},o={},x={},s={},y={};m.prototype={save:function(){this.b(),this.c(),this.n(),this.m(),this.z(),this.w(),this.F.push([this.g,this.h,this.A,this.v,this.k,this.i,this.j,this.l,this.q,this.r,this.o,this.p,this.f,this.s,this.t]),this.a.push(e.save)},restore:function(){var a=this.F;a.length&&(a=a.pop(),this.globalAlpha=a[0],this.globalCompositeOperation=a[1],this.strokeStyle=a[2],this.fillStyle=a[3],this.lineWidth=a[4],this.lineCap=a[5],this.lineJoin=a[6],this.miterLimit=a[7],this.shadowOffsetX=a[8],this.shadowOffsetY=a[9],this.shadowBlur=a[10],this.shadowColor=a[11],this.font=a[12],this.textAlign=a[13],this.textBaseline=a[14]),this.a.push(e.restore)},scale:function(a,b){this.a.push(e.scale,a,b)},rotate:function(a){this.a.push(e.rotate,a)},translate:function(a,b){this.a.push(e.translate,a,b)},transform:function(a,b,c,d,f,g){this.a.push(e.transform,a,b,c,d,f,g)},setTransform:function(a,b,c,d,f,g){this.a.push(e.setTransform,a,b,c,d,f,g)},b:function(){var a=this.a;this.g!==this.globalAlpha&&(this.g=this.globalAlpha,a.push(e.globalAlpha,this.g)),this.h!==this.globalCompositeOperation&&(this.h=this.globalCompositeOperation,a.push(e.globalCompositeOperation,this.h))},n:function(){if(this.A!==this.strokeStyle){var a=this.A=this.strokeStyle;if("string"!=typeof a){if(!(a instanceof k||a instanceof v))return;a=a.id}this.a.push(e.strokeStyle,a)}},m:function(){if(this.v!==this.fillStyle){var a=this.v=this.fillStyle;if("string"!=typeof a){if(!(a instanceof k||a instanceof v))return;a=a.id}this.a.push(e.fillStyle,a)}},createLinearGradient:function(a,b,c,d){return!(isFinite(a)&&isFinite(b)&&isFini