webshims-rails 0.3 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. data/lib/webshims-rails.rb +1 -1
  2. data/lib/webshims-rails/version.rb +2 -2
  3. data/readme.textile +5 -3
  4. data/vendor/assets/javascripts/webshims/dev/extras/custom-validity.js +261 -0
  5. data/vendor/assets/javascripts/webshims/dev/extras/modernizr-custom.js +535 -0
  6. data/vendor/assets/javascripts/webshims/dev/extras/mousepress.js +60 -0
  7. data/vendor/assets/javascripts/webshims/dev/polyfiller.js +1171 -0
  8. data/vendor/assets/javascripts/webshims/dev/shims/FlashCanvas/README +62 -0
  9. data/vendor/assets/javascripts/webshims/dev/shims/FlashCanvas/canvas2png.js +42 -0
  10. data/vendor/assets/javascripts/webshims/dev/shims/FlashCanvas/flashcanvas.js +28 -0
  11. data/vendor/assets/javascripts/webshims/dev/shims/FlashCanvas/flashcanvas.swf +0 -0
  12. data/vendor/assets/javascripts/webshims/dev/shims/FlashCanvas/proxy.php +73 -0
  13. data/vendor/assets/javascripts/webshims/dev/shims/FlashCanvas/save.php +49 -0
  14. data/vendor/assets/javascripts/webshims/dev/shims/FlashCanvasPro/README +82 -0
  15. data/vendor/assets/javascripts/webshims/dev/shims/FlashCanvasPro/canvas2png.js +42 -0
  16. data/vendor/assets/javascripts/webshims/dev/shims/FlashCanvasPro/flash10canvas.swf +0 -0
  17. data/vendor/assets/javascripts/webshims/dev/shims/FlashCanvasPro/flash9canvas.swf +0 -0
  18. data/vendor/assets/javascripts/webshims/dev/shims/FlashCanvasPro/flashcanvas.js +31 -0
  19. data/vendor/assets/javascripts/webshims/dev/shims/FlashCanvasPro/proxy.php +73 -0
  20. data/vendor/assets/javascripts/webshims/dev/shims/FlashCanvasPro/save.php +49 -0
  21. data/vendor/assets/javascripts/webshims/dev/shims/combos/1.js +1710 -0
  22. data/vendor/assets/javascripts/webshims/dev/shims/combos/10.js +3317 -0
  23. data/vendor/assets/javascripts/webshims/dev/shims/combos/11.js +1585 -0
  24. data/vendor/assets/javascripts/webshims/dev/shims/combos/12.js +1587 -0
  25. data/vendor/assets/javascripts/webshims/dev/shims/combos/13.js +1054 -0
  26. data/vendor/assets/javascripts/webshims/dev/shims/combos/14.js +476 -0
  27. data/vendor/assets/javascripts/webshims/dev/shims/combos/15.js +314 -0
  28. data/vendor/assets/javascripts/webshims/dev/shims/combos/16.js +2101 -0
  29. data/vendor/assets/javascripts/webshims/dev/shims/combos/17.js +2264 -0
  30. data/vendor/assets/javascripts/webshims/dev/shims/combos/18.js +2161 -0
  31. data/vendor/assets/javascripts/webshims/dev/shims/combos/19.js +2244 -0
  32. data/vendor/assets/javascripts/webshims/dev/shims/combos/2.js +2294 -0
  33. data/vendor/assets/javascripts/webshims/dev/shims/combos/20.js +1607 -0
  34. data/vendor/assets/javascripts/webshims/dev/shims/combos/21.js +1635 -0
  35. data/vendor/assets/javascripts/webshims/dev/shims/combos/22.js +2409 -0
  36. data/vendor/assets/javascripts/webshims/dev/shims/combos/23.js +2168 -0
  37. data/vendor/assets/javascripts/webshims/dev/shims/combos/24.js +2777 -0
  38. data/vendor/assets/javascripts/webshims/dev/shims/combos/25.js +2204 -0
  39. data/vendor/assets/javascripts/webshims/dev/shims/combos/26.js +2863 -0
  40. data/vendor/assets/javascripts/webshims/dev/shims/combos/27.js +4079 -0
  41. data/vendor/assets/javascripts/webshims/dev/shims/combos/3.js +2971 -0
  42. data/vendor/assets/javascripts/webshims/dev/shims/combos/4.js +823 -0
  43. data/vendor/assets/javascripts/webshims/dev/shims/combos/5.js +1078 -0
  44. data/vendor/assets/javascripts/webshims/dev/shims/combos/59.js +1754 -0
  45. data/vendor/assets/javascripts/webshims/dev/shims/combos/6.js +1230 -0
  46. data/vendor/assets/javascripts/webshims/dev/shims/combos/7.js +1485 -0
  47. data/vendor/assets/javascripts/webshims/dev/shims/combos/8.js +1442 -0
  48. data/vendor/assets/javascripts/webshims/dev/shims/combos/9.js +2515 -0
  49. data/vendor/assets/javascripts/webshims/dev/shims/details.js +146 -0
  50. data/vendor/assets/javascripts/webshims/dev/shims/dom-extend.js +908 -0
  51. data/vendor/assets/javascripts/webshims/dev/shims/es5.js +802 -0
  52. data/vendor/assets/javascripts/webshims/dev/shims/excanvas.js +924 -0
  53. data/vendor/assets/javascripts/webshims/dev/shims/form-core.js +660 -0
  54. data/vendor/assets/javascripts/webshims/dev/shims/form-datalist.js +677 -0
  55. data/vendor/assets/javascripts/webshims/dev/shims/form-message.js +164 -0
  56. data/vendor/assets/javascripts/webshims/dev/shims/form-native-extend.js +256 -0
  57. data/vendor/assets/javascripts/webshims/dev/shims/form-native-fix.js +261 -0
  58. data/vendor/assets/javascripts/webshims/dev/shims/form-number-date-api.js +384 -0
  59. data/vendor/assets/javascripts/webshims/dev/shims/form-number-date-ui.js +847 -0
  60. data/vendor/assets/javascripts/webshims/dev/shims/form-shim-extend.js +1472 -0
  61. data/vendor/assets/javascripts/webshims/dev/shims/geolocation.js +168 -0
  62. data/vendor/assets/javascripts/webshims/dev/shims/i18n/errormessages-ar.js +32 -0
  63. data/vendor/assets/javascripts/webshims/dev/shims/i18n/errormessages-ch-ZN.js +32 -0
  64. data/vendor/assets/javascripts/webshims/dev/shims/i18n/errormessages-de.txt +33 -0
  65. data/vendor/assets/javascripts/webshims/dev/shims/i18n/errormessages-el.js +32 -0
  66. data/vendor/assets/javascripts/webshims/dev/shims/i18n/errormessages-en.txt +34 -0
  67. data/vendor/assets/javascripts/webshims/dev/shims/i18n/errormessages-es.js +32 -0
  68. data/vendor/assets/javascripts/webshims/dev/shims/i18n/errormessages-fr.js +32 -0
  69. data/vendor/assets/javascripts/webshims/dev/shims/i18n/errormessages-he.js +32 -0
  70. data/vendor/assets/javascripts/webshims/dev/shims/i18n/errormessages-hi.js +32 -0
  71. data/vendor/assets/javascripts/webshims/dev/shims/i18n/errormessages-hu.js +32 -0
  72. data/vendor/assets/javascripts/webshims/dev/shims/i18n/errormessages-it.js +32 -0
  73. data/vendor/assets/javascripts/webshims/dev/shims/i18n/errormessages-ja.js +32 -0
  74. data/vendor/assets/javascripts/webshims/dev/shims/i18n/errormessages-nl.js +32 -0
  75. data/vendor/assets/javascripts/webshims/dev/shims/i18n/errormessages-pt-PT.js +32 -0
  76. data/vendor/assets/javascripts/webshims/dev/shims/i18n/errormessages-ru.js +32 -0
  77. data/vendor/assets/javascripts/webshims/dev/shims/i18n/errormessages-sv.js +32 -0
  78. data/vendor/assets/javascripts/webshims/dev/shims/json-storage.js +308 -0
  79. data/vendor/assets/javascripts/webshims/dev/shims/jwplayer/license.txt +1 -0
  80. data/vendor/assets/javascripts/webshims/dev/shims/jwplayer/player.swf +0 -0
  81. data/vendor/assets/javascripts/webshims/dev/shims/jwplayer/readme.html +87 -0
  82. data/vendor/assets/javascripts/webshims/dev/shims/mediaelement-core.js +534 -0
  83. data/vendor/assets/javascripts/webshims/dev/shims/mediaelement-native-fix.js +99 -0
  84. data/vendor/assets/javascripts/webshims/dev/shims/mediaelement-swf.js +1074 -0
  85. data/vendor/assets/javascripts/webshims/dev/shims/mediaelement-yt.js +543 -0
  86. data/vendor/assets/javascripts/webshims/dev/shims/styles/details-arrows.png +0 -0
  87. data/vendor/assets/javascripts/webshims/dev/shims/styles/forms.png +0 -0
  88. data/vendor/assets/javascripts/webshims/dev/shims/styles/polyfill-loader.gif +0 -0
  89. data/vendor/assets/javascripts/webshims/dev/shims/styles/shim.css +677 -0
  90. data/vendor/assets/javascripts/webshims/dev/shims/swf/jwwebshims.swf +0 -0
  91. data/vendor/assets/javascripts/webshims/dev/shims/swf/localStorage.swf +0 -0
  92. data/vendor/assets/javascripts/webshims/dev/shims/track-ui.js +292 -0
  93. data/vendor/assets/javascripts/webshims/dev/shims/track.js +763 -0
  94. data/vendor/assets/javascripts/webshims/minified/extras/modernizr-custom.js +20 -20
  95. data/vendor/assets/javascripts/webshims/minified/polyfiller.js +29 -29
  96. data/vendor/assets/javascripts/webshims/minified/shims/combos/1.js +37 -33
  97. data/vendor/assets/javascripts/webshims/minified/shims/combos/10.js +83 -76
  98. data/vendor/assets/javascripts/webshims/minified/shims/combos/11.js +44 -42
  99. data/vendor/assets/javascripts/webshims/minified/shims/combos/12.js +43 -38
  100. data/vendor/assets/javascripts/webshims/minified/shims/combos/13.js +27 -25
  101. data/vendor/assets/javascripts/webshims/minified/shims/combos/16.js +60 -55
  102. data/vendor/assets/javascripts/webshims/minified/shims/combos/17.js +68 -64
  103. data/vendor/assets/javascripts/webshims/minified/shims/combos/18.js +60 -59
  104. data/vendor/assets/javascripts/webshims/minified/shims/combos/19.js +66 -64
  105. data/vendor/assets/javascripts/webshims/minified/shims/combos/2.js +74 -69
  106. data/vendor/assets/javascripts/webshims/minified/shims/combos/20.js +46 -43
  107. data/vendor/assets/javascripts/webshims/minified/shims/combos/21.js +52 -47
  108. data/vendor/assets/javascripts/webshims/minified/shims/combos/22.js +61 -57
  109. data/vendor/assets/javascripts/webshims/minified/shims/combos/23.js +68 -60
  110. data/vendor/assets/javascripts/webshims/minified/shims/combos/24.js +82 -77
  111. data/vendor/assets/javascripts/webshims/minified/shims/combos/25.js +58 -0
  112. data/vendor/assets/javascripts/webshims/minified/shims/combos/26.js +80 -0
  113. data/vendor/assets/javascripts/webshims/minified/shims/combos/27.js +103 -0
  114. data/vendor/assets/javascripts/webshims/minified/shims/combos/3.js +96 -91
  115. data/vendor/assets/javascripts/webshims/minified/shims/combos/4.js +30 -31
  116. data/vendor/assets/javascripts/webshims/minified/shims/combos/5.js +37 -39
  117. data/vendor/assets/javascripts/webshims/minified/shims/combos/59.js +59 -61
  118. data/vendor/assets/javascripts/webshims/minified/shims/combos/6.js +31 -29
  119. data/vendor/assets/javascripts/webshims/minified/shims/combos/7.js +38 -37
  120. data/vendor/assets/javascripts/webshims/minified/shims/combos/8.js +38 -33
  121. data/vendor/assets/javascripts/webshims/minified/shims/combos/9.js +68 -63
  122. data/vendor/assets/javascripts/webshims/minified/shims/dom-extend.js +22 -20
  123. data/vendor/assets/javascripts/webshims/minified/shims/es5.js +15 -14
  124. data/vendor/assets/javascripts/webshims/minified/shims/form-core.js +22 -22
  125. data/vendor/assets/javascripts/webshims/minified/shims/form-datalist.js +22 -22
  126. data/vendor/assets/javascripts/webshims/minified/shims/form-message.js +8 -9
  127. data/vendor/assets/javascripts/webshims/minified/shims/form-native-extend.js +7 -8
  128. data/vendor/assets/javascripts/webshims/minified/shims/form-number-date-ui.js +23 -21
  129. data/vendor/assets/javascripts/webshims/minified/shims/form-shim-extend.js +44 -33
  130. data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-sv.js +3 -0
  131. data/vendor/assets/javascripts/webshims/minified/shims/jwplayer/player.swf +0 -0
  132. data/vendor/assets/javascripts/webshims/minified/shims/jwplayer/readme.html +86 -86
  133. data/vendor/assets/javascripts/webshims/minified/shims/mediaelement-core.js +16 -13
  134. data/vendor/assets/javascripts/webshims/minified/shims/mediaelement-swf.js +30 -30
  135. data/vendor/assets/javascripts/webshims/minified/shims/mediaelement-yt.js +14 -0
  136. data/vendor/assets/javascripts/webshims/minified/shims/styles/shim.css +71 -10
  137. data/vendor/assets/javascripts/webshims/minified/shims/track-ui.js +9 -0
  138. data/vendor/assets/javascripts/webshims/minified/shims/track.js +20 -0
  139. metadata +101 -5
  140. data/vendor/assets/javascripts/webshims/minified/shims/form-output.js +0 -5
@@ -0,0 +1,62 @@
1
+ FlashCanvas
2
+ ===========
3
+
4
+ An implementation of the HTML5 Canvas API for Internet Explorer.
5
+
6
+
7
+ Description
8
+ -----------
9
+
10
+ FlashCanvas is a JavaScript library which adds the HTML5 Canvas support
11
+ to Internet Explorer. It renders shapes and images via Flash drawing
12
+ API, and in many cases, runs faster than other similar libraries which
13
+ use VML or Silverlight.
14
+
15
+
16
+ Requirements
17
+ ------------
18
+
19
+ * Microsoft Internet Explorer
20
+ * Adobe Flash Player 9 or later
21
+
22
+
23
+ Usage
24
+ -----
25
+
26
+ FlashCanvas consists of JavaScript, Flash and PHP files:
27
+
28
+ * flashcanvas.js
29
+ * flashcanvas.swf
30
+ * canvas2png.js (helps you to save a canvas image)
31
+ * proxy.php (used to load a file from other domain)
32
+ * save.php (used to save a canvas image)
33
+
34
+ These files can be found in the bin directory in this distribution
35
+ package. To install FlashCanvas, copy these files into some directory on
36
+ a Web server, and then add the following HTML code between <head> and
37
+ </head> tags on your web page.
38
+
39
+ <!--[if lt IE 9]>
40
+ <script type="text/javascript" src="path/to/flashcanvas.js"></script>
41
+ <![endif]-->
42
+
43
+ That's all you have to do in most cases. For more details, please read
44
+ the online manual at the project page.
45
+
46
+
47
+ License
48
+ -------
49
+
50
+ FlashCanvas is developed by FlashCanvas Project and released under the
51
+ MIT License.
52
+
53
+
54
+ Contact
55
+ -------
56
+
57
+ If you have a question about FlashCanvas, please utilize the discussion
58
+ group and issue tracker found at the project page. If you need to
59
+ contact us directly, you can reach us at the e-mail address.
60
+
61
+ Project page: http://code.google.com/p/flashcanvas/
62
+ E-mail: flashcanvas@gmail.com
@@ -0,0 +1,42 @@
1
+ /*
2
+ * canvas2png.js
3
+ *
4
+ * Copyright (c) 2010-2011 Shinya Muramatsu
5
+ * Released under the MIT License
6
+ * http://flashcanvas.net/
7
+ */
8
+
9
+ (function(doc) {
10
+
11
+ var scripts = doc.getElementsByTagName("script");
12
+ var script = scripts[scripts.length - 1];
13
+ var url = script.getAttribute("src").replace(/[^\/]+$/, "save.php");
14
+
15
+ window.canvas2png = function(canvas) {
16
+ var tagName = canvas.tagName.toLowerCase();
17
+ if (tagName !== "canvas") {
18
+ return;
19
+ }
20
+
21
+ if (typeof FlashCanvas !== "undefined") {
22
+ FlashCanvas.saveImage(canvas);
23
+ } else {
24
+ var form = doc.createElement("form");
25
+ var input = doc.createElement("input");
26
+
27
+ form.setAttribute("action", url);
28
+ form.setAttribute("method", "post");
29
+
30
+ input.setAttribute("type", "hidden");
31
+ input.setAttribute("name", "dataurl");
32
+ input.setAttribute("value", canvas.toDataURL());
33
+
34
+ doc.body.appendChild(form);
35
+ form.appendChild(input);
36
+ form.submit();
37
+ form.removeChild(input);
38
+ doc.body.removeChild(form);
39
+ }
40
+ }
41
+
42
+ })(document);
@@ -0,0 +1,28 @@
1
+ /*
2
+ * FlashCanvas
3
+ *
4
+ * Copyright (c) 2009 Tim Cameron Ryan
5
+ * Copyright (c) 2009-2011 FlashCanvas Project
6
+ * Released under the MIT/X License
7
+ */
8
+ window.ActiveXObject&&!window.CanvasRenderingContext2D&&function(h,j){function D(a){this.code=a;this.message=T[a]}function U(a){this.width=a}function E(a){this.id=a.C++}function t(a){this.G=a;this.id=a.C++}function u(a,b){this.canvas=a;this.B=b;this.d=a.uniqueID;this.D();this.C=0;this.t="";var c=this;setInterval(function(){n[c.d]===0&&c.e()},30)}function A(){if(j.readyState==="complete"){j.detachEvent(F,A);for(var a=j.getElementsByTagName(r),b=0,c=a.length;b<c;++b)B.initElement(a[b])}}function G(){var a=
9
+ event.srcElement,b=a.parentNode;a.blur();b.focus()}function H(){var a=event.propertyName;if(a==="width"||a==="height"){var b=event.srcElement,c=b[a],d=parseInt(c,10);if(isNaN(d)||d<0)d=a==="width"?300:150;if(c===d){b.style[a]=d+"px";b.getContext("2d").I(b.width,b.height)}else b[a]=d}}function I(){h.detachEvent(J,I);for(var a in s){var b=s[a],c=b.firstChild,d;for(d in c)if(typeof c[d]==="function")c[d]=k;for(d in b)if(typeof b[d]==="function")b[d]=k;c.detachEvent(K,G);b.detachEvent(L,H)}h[M]=k;h[N]=
10
+ k;h[O]=k;h[C]=k;h[P]=k}function V(){var a=j.getElementsByTagName("script");a=a[a.length-1];return j.documentMode>=8?a.src:a.getAttribute("src",4)}function v(a){return(""+a).replace(/&/g,"&amp;").replace(/</g,"&lt;")}function W(a){return a.toLowerCase()}function i(a){throw new D(a);}function Q(a){var b=parseInt(a.width,10),c=parseInt(a.height,10);if(isNaN(b)||b<0)b=300;if(isNaN(c)||c<0)c=150;a.width=b;a.height=c}var k=null,r="canvas",M="CanvasRenderingContext2D",N="CanvasGradient",O="CanvasPattern",
11
+ C="FlashCanvas",P="G_vmlCanvasManager",K="onfocus",L="onpropertychange",F="onreadystatechange",J="onunload",w=((h[C+"Options"]||{}).swfPath||V().replace(/[^\/]+$/,""))+"flashcanvas.swf",e=new function(a){for(var b=0,c=a.length;b<c;b++)this[a[b]]=b}(["toDataURL","save","restore","scale","rotate","translate","transform","setTransform","globalAlpha","globalCompositeOperation","strokeStyle","fillStyle","createLinearGradient","createRadialGradient","createPattern","lineWidth","lineCap","lineJoin","miterLimit",
12
+ "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"]),x={},n={},s={},y={};u.prototype={save:function(){this.b();this.c();this.m();this.l();this.z();this.w();
13
+ this.F.push([this.f,this.g,this.A,this.u,this.j,this.h,this.i,this.k,this.p,this.q,this.n,this.o,this.v,this.r,this.s]);this.a.push(e.save)},restore:function(){var a=this.F;if(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];
14
+ 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;if(this.f!==this.globalAlpha){this.f=this.globalAlpha;a.push(e.globalAlpha,this.f)}if(this.g!==this.globalCompositeOperation){this.g=this.globalCompositeOperation;
15
+ a.push(e.globalCompositeOperation,this.g)}},m:function(){if(this.A!==this.strokeStyle){var a=this.A=this.strokeStyle;this.a.push(e.strokeStyle,typeof a==="object"?a.id:a)}},l:function(){if(this.u!==this.fillStyle){var a=this.u=this.fillStyle;this.a.push(e.fillStyle,typeof a==="object"?a.id:a)}},createLinearGradient:function(a,b,c,d){isFinite(a)&&isFinite(b)&&isFinite(c)&&isFinite(d)||i(9);this.a.push(e.createLinearGradient,a,b,c,d);return new t(this)},createRadialGradient:function(a,b,c,d,f,g){isFinite(a)&&
16
+ isFinite(b)&&isFinite(c)&&isFinite(d)&&isFinite(f)&&isFinite(g)||i(9);if(c<0||g<0)i(1);this.a.push(e.createRadialGradient,a,b,c,d,f,g);return new t(this)},createPattern:function(a,b){a||i(17);var c=a.tagName,d,f=this.d;if(c){c=c.toLowerCase();if(c==="img")d=a.getAttribute("src",2);else if(c===r||c==="video")return;else i(17)}else if(a.src)d=a.src;else i(17);b==="repeat"||b==="no-repeat"||b==="repeat-x"||b==="repeat-y"||b===""||b===k||i(12);this.a.push(e.createPattern,v(d),b);if(x[f]){this.e();++n[f]}return new E(this)},
17
+ z:function(){var a=this.a;if(this.j!==this.lineWidth){this.j=this.lineWidth;a.push(e.lineWidth,this.j)}if(this.h!==this.lineCap){this.h=this.lineCap;a.push(e.lineCap,this.h)}if(this.i!==this.lineJoin){this.i=this.lineJoin;a.push(e.lineJoin,this.i)}if(this.k!==this.miterLimit){this.k=this.miterLimit;a.push(e.miterLimit,this.k)}},c:function(){var a=this.a;if(this.p!==this.shadowOffsetX){this.p=this.shadowOffsetX;a.push(e.shadowOffsetX,this.p)}if(this.q!==this.shadowOffsetY){this.q=this.shadowOffsetY;
18
+ a.push(e.shadowOffsetY,this.q)}if(this.n!==this.shadowBlur){this.n=this.shadowBlur;a.push(e.shadowBlur,this.n)}if(this.o!==this.shadowColor){this.o=this.shadowColor;a.push(e.shadowColor,this.o)}},clearRect:function(a,b,c,d){this.a.push(e.clearRect,a,b,c,d)},fillRect:function(a,b,c,d){this.b();this.c();this.l();this.a.push(e.fillRect,a,b,c,d)},strokeRect:function(a,b,c,d){this.b();this.c();this.m();this.z();this.a.push(e.strokeRect,a,b,c,d)},beginPath:function(){this.a.push(e.beginPath)},closePath:function(){this.a.push(e.closePath)},
19
+ moveTo:function(a,b){this.a.push(e.moveTo,a,b)},lineTo:function(a,b){this.a.push(e.lineTo,a,b)},quadraticCurveTo:function(a,b,c,d){this.a.push(e.quadraticCurveTo,a,b,c,d)},bezierCurveTo:function(a,b,c,d,f,g){this.a.push(e.bezierCurveTo,a,b,c,d,f,g)},arcTo:function(a,b,c,d,f){f<0&&isFinite(f)&&i(1);this.a.push(e.arcTo,a,b,c,d,f)},rect:function(a,b,c,d){this.a.push(e.rect,a,b,c,d)},arc:function(a,b,c,d,f,g){c<0&&isFinite(c)&&i(1);this.a.push(e.arc,a,b,c,d,f,g?1:0)},fill:function(){this.b();this.c();
20
+ this.l();this.a.push(e.fill)},stroke:function(){this.b();this.c();this.m();this.z();this.a.push(e.stroke)},clip:function(){this.a.push(e.clip)},w:function(){var a=this.a;if(this.v!==this.font)try{var b=y[this.d];b.style.font=this.v=this.font;var c=b.currentStyle;a.push(e.font,[c.fontStyle,c.fontWeight,b.offsetHeight,c.fontFamily].join(" "))}catch(d){}if(this.r!==this.textAlign){this.r=this.textAlign;a.push(e.textAlign,this.r)}if(this.s!==this.textBaseline){this.s=this.textBaseline;a.push(e.textBaseline,
21
+ this.s)}if(this.t!==this.canvas.currentStyle.direction){this.t=this.canvas.currentStyle.direction;a.push(e.direction,this.t)}},fillText:function(a,b,c,d){this.b();this.l();this.c();this.w();this.a.push(e.fillText,v(a),b,c,d===void 0?Infinity:d)},strokeText:function(a,b,c,d){this.b();this.m();this.c();this.w();this.a.push(e.strokeText,v(a),b,c,d===void 0?Infinity:d)},measureText:function(a){var b=y[this.d];try{b.style.font=this.font}catch(c){}b.innerText=a.replace(/[ \n\f\r]/g,"\t");return new U(b.offsetWidth)},
22
+ drawImage:function(a,b,c,d,f,g,o,l,z){a||i(17);var p=a.tagName,m,q=arguments.length,R=this.d;if(p){p=p.toLowerCase();if(p==="img")m=a.getAttribute("src",2);else if(p===r||p==="video")return;else i(17)}else if(a.src)m=a.src;else i(17);this.b();this.c();m=v(m);if(q===3)this.a.push(e.drawImage,q,m,b,c);else if(q===5)this.a.push(e.drawImage,q,m,b,c,d,f);else if(q===9){if(d===0||f===0)i(1);this.a.push(e.drawImage,q,m,b,c,d,f,g,o,l,z)}else return;if(x[R]){this.e();++n[R]}},D:function(){this.globalAlpha=
23
+ this.f=1;this.globalCompositeOperation=this.g="source-over";this.fillStyle=this.u=this.strokeStyle=this.A="#000000";this.lineWidth=this.j=1;this.lineCap=this.h="butt";this.lineJoin=this.i="miter";this.miterLimit=this.k=10;this.shadowBlur=this.n=this.shadowOffsetY=this.q=this.shadowOffsetX=this.p=0;this.shadowColor=this.o="rgba(0, 0, 0, 0.0)";this.font=this.v="10px sans-serif";this.textAlign=this.r="start";this.textBaseline=this.s="alphabetic";this.a=[];this.F=[]},H:function(){var a=this.a;this.a=
24
+ [];return a},e:function(){var a=this.H();if(a.length>0)return eval(this.B.CallFunction('<invoke name="executeCommand" returntype="javascript"><arguments><string>'+a.join("&#0;")+"</string></arguments></invoke>"))},I:function(a,b){this.e();this.D();if(a>0)this.B.width=a;if(b>0)this.B.height=b;this.a.push(e.resize,a,b)}};t.prototype={addColorStop:function(a,b){if(isNaN(a)||a<0||a>1)i(1);this.G.a.push(e.addColorStop,this.id,a,b)}};D.prototype=Error();var T={1:"INDEX_SIZE_ERR",9:"NOT_SUPPORTED_ERR",11:"INVALID_STATE_ERR",
25
+ 12:"SYNTAX_ERR",17:"TYPE_MISMATCH_ERR",18:"SECURITY_ERR"},B={initElement:function(a){if(a.getContext)return a;var b=a.uniqueID,c="external"+b;x[b]=false;n[b]=1;Q(a);a.innerHTML='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+location.protocol+'//fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="100%" height="100%" id="'+c+'"><param name="allowScriptAccess" value="always"><param name="flashvars" value="id='+c+'"><param name="wmode" value="transparent"></object><span style="margin:0;padding:0;border:0;display:inline-block;position:static;height:1em;overflow:visible;white-space:nowrap"></span>';
26
+ s[b]=a;var d=a.firstChild;y[b]=a.lastChild;var f=j.body.contains;if(f(a))d.movie=w;else var g=setInterval(function(){if(f(a)){clearInterval(g);d.movie=w}},0);if(j.compatMode==="BackCompat"||!h.XMLHttpRequest)y[b].style.overflow="hidden";var o=new u(a,d);a.getContext=function(l){return l==="2d"?o:k};a.toDataURL=function(l,z){(""+l).replace(/[A-Z]+/g,W)==="image/jpeg"?o.a.push(e.toDataURL,l,typeof z==="number"?z:""):o.a.push(e.toDataURL,l);return o.e()};d.attachEvent(K,G);return a},saveImage:function(a){a.firstChild.saveImage()},
27
+ setOptions:function(){},trigger:function(a,b){s[a].fireEvent("on"+b)},unlock:function(a,b){n[a]&&--n[a];if(b){var c=s[a],d=c.firstChild,f,g;Q(c);f=c.width;g=c.height;c.style.width=f+"px";c.style.height=g+"px";if(f>0)d.width=f;if(g>0)d.height=g;d.resize(f,g);c.attachEvent(L,H);x[a]=true}}};j.createElement(r);j.createStyleSheet().cssText=r+"{display:inline-block;overflow:hidden;width:300px;height:150px}";j.readyState==="complete"?A():j.attachEvent(F,A);h.attachEvent(J,I);if(w.indexOf(location.protocol+
28
+ "//"+location.host+"/")===0){var S=new ActiveXObject("Microsoft.XMLHTTP");S.open("GET",w,false);S.send(k)}h[M]=u;h[N]=t;h[O]=E;h[C]=B;h[P]={init:function(){},init_:function(){},initElement:B.initElement};keep=u.measureText}(window,document);
@@ -0,0 +1,73 @@
1
+ <?php
2
+
3
+ /**
4
+ * Proxy script to load a file from other domain
5
+ *
6
+ * PHP versions 4 and 5
7
+ *
8
+ * Copyright (c) 2010-2011 Shinya Muramatsu
9
+ *
10
+ * Permission is hereby granted, free of charge, to any person obtaining a
11
+ * copy of this software and associated documentation files (the "Software"),
12
+ * to deal in the Software without restriction, including without limitation
13
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14
+ * and/or sell copies of the Software, and to permit persons to whom the
15
+ * Software is furnished to do so, subject to the following conditions:
16
+ *
17
+ * The above copyright notice and this permission notice shall be included in
18
+ * all copies or substantial portions of the Software.
19
+ *
20
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26
+ * DEALINGS IN THE SOFTWARE.
27
+ *
28
+ * @author Shinya Muramatsu <revulon@gmail.com>
29
+ * @copyright 2010-2011 Shinya Muramatsu
30
+ * @license http://www.opensource.org/licenses/mit-license.php MIT License
31
+ * @link http://flashcanvas.net/
32
+ * @link http://code.google.com/p/flashcanvas/
33
+ */
34
+
35
+ // Whether we check referrer or not
36
+ define('CHECK_REFERRER', true);
37
+
38
+ // Check that the request is from FlashCanvas
39
+ if (CHECK_REFERRER) {
40
+ if (empty($_SERVER['HTTP_REFERER'])) {
41
+ exit;
42
+ }
43
+ if (!preg_match('#/flash\d*canvas\.swf$#', $_SERVER['HTTP_REFERER'])) {
44
+ exit;
45
+ }
46
+ }
47
+
48
+ // Check that the request has a valid URL parameter
49
+ if (empty($_GET['url'])) {
50
+ exit;
51
+ }
52
+ if (!preg_match('#^https?://#', $_GET['url'])) {
53
+ exit;
54
+ }
55
+
56
+ // Percent-encode special characters in the URL
57
+ $search = array( '%', '#', ' ');
58
+ $replace = array('%25', '%23', '%20');
59
+ $url = str_replace($search, $replace, $_GET['url']);
60
+
61
+ // Disable compression
62
+ header('Content-Encoding: none');
63
+
64
+ // Load and output the file
65
+ if (extension_loaded('curl')) {
66
+ // Use cURL extension
67
+ $ch = curl_init($url);
68
+ curl_exec($ch);
69
+ curl_close($ch);
70
+ } else {
71
+ // Use the http:// wrapper
72
+ readfile($url);
73
+ }
@@ -0,0 +1,49 @@
1
+ <?php
2
+
3
+ /**
4
+ * Save the input as a PNG file
5
+ *
6
+ * PHP versions 4 and 5
7
+ *
8
+ * Copyright (c) 2010-2011 Shinya Muramatsu
9
+ *
10
+ * Permission is hereby granted, free of charge, to any person obtaining a
11
+ * copy of this software and associated documentation files (the "Software"),
12
+ * to deal in the Software without restriction, including without limitation
13
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14
+ * and/or sell copies of the Software, and to permit persons to whom the
15
+ * Software is furnished to do so, subject to the following conditions:
16
+ *
17
+ * The above copyright notice and this permission notice shall be included in
18
+ * all copies or substantial portions of the Software.
19
+ *
20
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26
+ * DEALINGS IN THE SOFTWARE.
27
+ *
28
+ * @author Shinya Muramatsu <revulon@gmail.com>
29
+ * @copyright 2010-2011 Shinya Muramatsu
30
+ * @license http://www.opensource.org/licenses/mit-license.php MIT License
31
+ * @link http://flashcanvas.net/
32
+ * @link http://code.google.com/p/flashcanvas/
33
+ */
34
+
35
+ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
36
+ // Force download
37
+ header('Content-Type: application/octet-stream');
38
+ header('Content-Disposition: attachment; filename="canvas.png"');
39
+
40
+ if (isset($_POST['dataurl'])) {
41
+ // Decode the base64-encoded data
42
+ $data = $_POST['dataurl'];
43
+ $data = substr($data, strpos($data, ',') + 1);
44
+ echo base64_decode($data);
45
+ } else {
46
+ // Output the raw data
47
+ readfile('php://input');
48
+ }
49
+ }
@@ -0,0 +1,82 @@
1
+ FlashCanvas Pro
2
+ ===============
3
+
4
+ An implementation of the HTML5 Canvas API for Internet Explorer.
5
+
6
+
7
+ Description
8
+ -----------
9
+
10
+ FlashCanvas is a JavaScript library which adds the HTML5 Canvas support
11
+ to Internet Explorer. It renders shapes and images via Flash drawing
12
+ API, and in many cases, runs faster than other similar libraries which
13
+ use VML or Silverlight.
14
+
15
+ FlashCanvas Pro is a professional edition of FlashCanvas. It supports
16
+ almost all Canvas APIs including text, shadow and pixel manipulation.
17
+ Moreover, it utilizes Flash Player 10 features if available, that
18
+ provides better performance and compatibility.
19
+
20
+
21
+ Requirements
22
+ ------------
23
+
24
+ * Microsoft Internet Explorer
25
+ * Adobe Flash Player 9 or later
26
+
27
+
28
+ Usage
29
+ -----
30
+
31
+ FlashCanvas Pro consists of JavaScript, Flash and PHP files:
32
+
33
+ * flashcanvas.js
34
+ * flash9canvas.swf
35
+ * flash10canvas.swf
36
+ * canvas2png.js (helps you to save a canvas image)
37
+ * proxy.php (used to load a file from other domain)
38
+ * save.php (used to save a canvas image)
39
+
40
+ These files can be found in the bin directory in this distribution
41
+ package. To install FlashCanvas Pro, copy these files into some
42
+ directory on a Web server, and then add the following HTML code between
43
+ <head> and </head> tags on your web page.
44
+
45
+ <!--[if lt IE 9]>
46
+ <script type="text/javascript" src="path/to/flashcanvas.js"></script>
47
+ <![endif]-->
48
+
49
+ That's all you have to do in most cases. For more details, please read
50
+ the online manual at the project page.
51
+
52
+
53
+ License
54
+ -------
55
+
56
+ FlashCanvas Pro is released under the FlashCanvas Pro License. This
57
+ license is based on the MIT License, but includes the following
58
+ modifications:
59
+
60
+ * Remove the rights to "sublicense, and/or sell copies of the Software".
61
+ * Permit to use "free of charge" only for non-profit use.
62
+ * Add conditions for commercial use.
63
+
64
+ As a result, FlashCanvas Pro is available free of charge for non-profit
65
+ use. If you use FlashCanvas Pro for commercial purposes, however, you
66
+ are required to purchase a commercial license. This commercial license
67
+ includes the following rights:
68
+
69
+ * The licensee can use FlashCanvas Pro as many times as needed.
70
+ * The licensee can download the latest version of FlashCanvas Pro as
71
+ many times as needed.
72
+
73
+
74
+ Contact
75
+ -------
76
+
77
+ If you have a question about FlashCanvas Pro, please utilize the
78
+ discussion group and issue tracker found at the project page. If you
79
+ need to contact us directly, you can reach us at the e-mail address.
80
+
81
+ Project page: http://flashcanvas.net/
82
+ E-mail: info@flashcanvas.net
@@ -0,0 +1,42 @@
1
+ /*
2
+ * canvas2png.js
3
+ *
4
+ * Copyright (c) 2010-2011 Shinya Muramatsu
5
+ * Released under the MIT License
6
+ * http://flashcanvas.net/
7
+ */
8
+
9
+ (function(doc) {
10
+
11
+ var scripts = doc.getElementsByTagName("script");
12
+ var script = scripts[scripts.length - 1];
13
+ var url = script.getAttribute("src").replace(/[^\/]+$/, "save.php");
14
+
15
+ window.canvas2png = function(canvas) {
16
+ var tagName = canvas.tagName.toLowerCase();
17
+ if (tagName !== "canvas") {
18
+ return;
19
+ }
20
+
21
+ if (typeof FlashCanvas !== "undefined") {
22
+ FlashCanvas.saveImage(canvas);
23
+ } else {
24
+ var form = doc.createElement("form");
25
+ var input = doc.createElement("input");
26
+
27
+ form.setAttribute("action", url);
28
+ form.setAttribute("method", "post");
29
+
30
+ input.setAttribute("type", "hidden");
31
+ input.setAttribute("name", "dataurl");
32
+ input.setAttribute("value", canvas.toDataURL());
33
+
34
+ doc.body.appendChild(form);
35
+ form.appendChild(input);
36
+ form.submit();
37
+ form.removeChild(input);
38
+ doc.body.removeChild(form);
39
+ }
40
+ }
41
+
42
+ })(document);
@@ -0,0 +1,31 @@
1
+ /*
2
+ * FlashCanvas Pro
3
+ *
4
+ * Copyright (c) 2009 Tim Cameron Ryan
5
+ * Copyright (c) 2009-2011 Shinya Muramatsu
6
+ */
7
+ window.ActiveXObject&&!window.CanvasRenderingContext2D&&function(j,m){function O(a){this.code=a;this.message=ea[a]}function y(a,b,c){if(!c){c=[];for(var d=0,e=a*b*4;d<e;++d)c[d]=0}this.width=a;this.height=b;this.data=c}function fa(a){this.width=a}function P(a){this.id=a.I++}function z(a){this.O=a;this.id=a.I++}function D(a,b){this.canvas=a;this.w=b;this.f=a.uniqueID;this.J();this.I=0;this.j=this.H="";this.c=0}function E(){if(m.readyState==="complete"){m.detachEvent(Q,E);for(var a=m.getElementsByTagName(u),
8
+ b=0,c=a.length;b<c;++b)F.initElement(a[b])}}function R(){var a=event.srcElement,b=a.parentNode;a.blur();b.focus()}function G(){event.button&2&&event.srcElement.parentNode.setCapture()}function H(){event.button&2&&event.srcElement.parentNode.releaseCapture()}function S(){var a=event.propertyName;if(a==="width"||a==="height"){var b=event.srcElement,c=b[a],d=parseInt(c,10);if(isNaN(d)||d<0)d=a==="width"?300:150;if(c===d){b.style[a]=d+"px";b.getContext("2d").P(b.width,b.height)}else b[a]=d}}function T(){j.detachEvent(U,
9
+ T);for(var a in n){var b=n[a],c=b.firstChild,d;for(d in c)if(typeof c[d]==="function")c[d]=k;for(d in b)if(typeof b[d]==="function")b[d]=k;c.detachEvent(V,R);c.detachEvent(I,G);b.detachEvent(J,H);b.detachEvent(W,S)}j[X]=k;j[Y]=k;j[Z]=k;j[K]=k;j[$]=k}function ga(){var a=m.getElementsByTagName("script");a=a[a.length-1];return m.documentMode>=8?a.src:a.getAttribute("src",4)}function ha(a){return a.toLowerCase()}function g(a){throw new O(a);}function aa(a){var b=parseInt(a.width,10),c=parseInt(a.height,
10
+ 10);if(isNaN(b)||b<0)b=300;if(isNaN(c)||c<0)c=150;a.width=b;a.height=c}var k=null,u="canvas",X="CanvasRenderingContext2D",Y="CanvasGradient",Z="CanvasPattern",K="FlashCanvas",$="G_vmlCanvasManager",V="onfocus",I="onmousedown",J="onmouseup",W="onpropertychange",Q="onreadystatechange",U="onunload",q;try{q=(new ActiveXObject("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version").match(/[\d,]+/)[0].replace(/,/g,".")}catch(ia){q=0}var r=j[K+"Options"]||{},ba=r.swfPath||ga().replace(/[^\/]+$/,""),x;
11
+ x=parseInt(q)>9?ba+"flash10canvas.swf":ba+"flash9canvas.swf";var A={},B={},ca={},L={},v={},da={},n={},C={},l={C:"turbo"in r?r.turbo:1,B:r.delay||0,M:r.disableContextMenu||0,N:r.imageCacheSize||100,D:r.usePolicyFile||0};if(q==="10.1.53.64"){l.C=0;l.B=30}D.prototype={save:function(){this.e(15);this.L.push([this.l,this.m,this.v,this.k,this.p,this.n,this.o,this.q,this.t,this.u,this.r,this.s,this.j,this.z,this.A]);this.a.push("B")},restore:function(){var a=this.L;if(a.length){a=a.pop();this.globalAlpha=
12
+ 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("C")},scale:function(a,b){this.a.push("D",a,b)},rotate:function(a){this.a.push("E",a)},translate:function(a,b){this.a.push("F",a,b)},transform:function(a,b,c,d,e,f){this.a.push("G",
13
+ a,b,c,d,e,f)},setTransform:function(a,b,c,d,e,f){this.a.push("H",a,b,c,d,e,f)},createLinearGradient:function(a,b,c,d){isFinite(a)&&isFinite(b)&&isFinite(c)&&isFinite(d)||g(9);this.a.push("M",a,b,c,d);return new z(this)},createRadialGradient:function(a,b,c,d,e,f){isFinite(a)&&isFinite(b)&&isFinite(c)&&isFinite(d)&&isFinite(e)&&isFinite(f)||g(9);if(c<0||f<0)g(1);this.a.push("N",a,b,c,d,e,f);return new z(this)},createPattern:function(a,b){a||g(17);var c=a.tagName,d,e,f,h=this.f;if(c){c=c.toLowerCase();
14
+ if(c==="img")d=a.getAttribute("src",2);else if(c===u){e=this.G(a);f=a!==this.canvas}else if(c==="video")return;else g(17)}else if(a.src)d=a.src;else g(17);b==="repeat"||b==="no-repeat"||b==="repeat-x"||b==="repeat-y"||b===""||b===k||g(12);if(!e){e=B[h][d];if(f=e===void 0)e=this.F(d)}this.a.push("O",e,b);if(f&&A[h]){this.g();++v[h]}return new P(this)},clearRect:function(a,b,c,d){this.a.push("X",a,b,c,d);this.b||this.d();this.c=0},fillRect:function(a,b,c,d){this.e(1);this.a.push("Y",a,b,c,d);this.b||
15
+ this.d();this.c=0},strokeRect:function(a,b,c,d){this.e(6);this.a.push("Z",a,b,c,d);this.b||this.d();this.c=0},beginPath:function(){this.a.push("a")},closePath:function(){this.a.push("b")},moveTo:function(a,b){this.a.push("c",a,b)},lineTo:function(a,b){this.a.push("d",a,b)},quadraticCurveTo:function(a,b,c,d){this.a.push("e",a,b,c,d)},bezierCurveTo:function(a,b,c,d,e,f){this.a.push("f",a,b,c,d,e,f)},arcTo:function(a,b,c,d,e){e<0&&isFinite(e)&&g(1);this.a.push("g",a,b,c,d,e)},rect:function(a,b,c,d){this.a.push("h",
16
+ a,b,c,d)},arc:function(a,b,c,d,e,f){c<0&&isFinite(c)&&g(1);this.a.push("i",a,b,c,d,e,f?1:0)},fill:function(){this.e(1);this.a.push("j");this.b||this.d();this.c=0},stroke:function(){this.e(6);this.a.push("k");this.b||this.d();this.c=0},clip:function(){this.a.push("l")},isPointInPath:function(a,b){this.a.push("m",a,b);return this.g()==="true"},fillText:function(a,b,c,d){this.e(9);this.h.push(this.a.length+1);this.a.push("r",a,b,c,d===void 0?Infinity:d);this.b||this.d();this.c=0},strokeText:function(a,
17
+ b,c,d){this.e(10);this.h.push(this.a.length+1);this.a.push("s",a,b,c,d===void 0?Infinity:d);this.b||this.d();this.c=0},measureText:function(a){var b=C[this.f];try{b.style.font=this.font}catch(c){}b.innerText=a.replace(/[ \n\f\r]/g,"\t");return new fa(b.offsetWidth)},drawImage:function(a,b,c,d,e,f,h,i,s){a||g(17);var o=a.tagName,t,p,M,w=arguments.length,N=this.f;if(o){o=o.toLowerCase();if(o==="img")t=a.getAttribute("src",2);else if(o===u){p=this.G(a);M=a!==this.canvas}else if(o==="video")return;else g(17)}else if(a.src)t=
18
+ a.src;else g(17);if(!p){p=B[N][t];if(M=p===void 0)p=this.F(t)}this.e(0);if(w===3)this.a.push("u",w,p,b,c);else if(w===5)this.a.push("u",w,p,b,c,d,e);else if(w===9){if(d===0||e===0)g(1);this.a.push("u",w,p,b,c,d,e,f,h,i,s)}else return;if(M&&A[N]){this.g();++v[N]}else this.b||this.d();this.c=0},createImageData:function(a,b){var c=Math.ceil;if(arguments.length===2){isFinite(a)&&isFinite(b)||g(9);if(a===0||b===0)g(1)}else{a instanceof y||g(9);b=a.height;a=a.width}a=c(a<0?-a:a);b=c(b<0?-b:b);return new y(a,
19
+ b)},getImageData:function(a,b,c,d){isFinite(a)&&isFinite(b)&&isFinite(c)&&isFinite(d)||g(9);if(c===0||d===0)g(1);this.a.push("w",a,b,c,d);a=this.g();c=typeof JSON==="object"?JSON.parse(a):m.documentMode?eval(a):a.slice(1,-1).split(",");a=c.shift();b=c.shift();return new y(a,b,c)},putImageData:function(a,b,c,d,e,f,h){a instanceof y||g(17);isFinite(b)&&isFinite(c)||g(9);var i=arguments.length,s=a.width,o=a.height,t=a.data;if(i===3)this.a.push("x",i,s,o,t.toString(),b,c);else if(i===7){isFinite(d)&&
20
+ isFinite(e)&&isFinite(f)&&isFinite(h)||g(9);this.a.push("x",i,s,o,t.toString(),b,c,d,e,f,h)}this.b||this.d();this.c=0},J:function(){this.globalAlpha=this.l=1;this.globalCompositeOperation=this.m="source-over";this.fillStyle=this.k=this.strokeStyle=this.v="#000000";this.lineWidth=this.p=1;this.lineCap=this.n="butt";this.lineJoin=this.o="miter";this.miterLimit=this.q=10;this.shadowBlur=this.r=this.shadowOffsetY=this.u=this.shadowOffsetX=this.t=0;this.shadowColor=this.s="rgba(0, 0, 0, 0.0)";this.font=
21
+ this.j="10px sans-serif";this.textAlign=this.z="start";this.textBaseline=this.A="alphabetic";this.a=[];this.L=[];this.i=[];this.h=[];this.b=k;this.K=1},e:function(a){var b=this.a,c;if(this.l!==this.globalAlpha)b.push("I",this.l=this.globalAlpha);if(this.m!==this.globalCompositeOperation)b.push("J",this.m=this.globalCompositeOperation);if(this.t!==this.shadowOffsetX)b.push("T",this.t=this.shadowOffsetX);if(this.u!==this.shadowOffsetY)b.push("U",this.u=this.shadowOffsetY);if(this.r!==this.shadowBlur)b.push("V",
22
+ this.r=this.shadowBlur);if(this.s!==this.shadowColor){c=this.s=this.shadowColor;(""+c).indexOf("%")>0&&this.i.push(b.length+1);b.push("W",c)}if(a&1)if(this.k!==this.fillStyle){c=this.k=this.fillStyle;if(typeof c==="object")c=c.id;else(""+c).indexOf("%")>0&&this.i.push(b.length+1);b.push("L",c)}if(a&2)if(this.v!==this.strokeStyle){c=this.v=this.strokeStyle;if(typeof c==="object")c=c.id;else(""+c).indexOf("%")>0&&this.i.push(b.length+1);b.push("K",c)}if(a&4){if(this.p!==this.lineWidth)b.push("P",this.p=
23
+ this.lineWidth);if(this.n!==this.lineCap)b.push("Q",this.n=this.lineCap);if(this.o!==this.lineJoin)b.push("R",this.o=this.lineJoin);if(this.q!==this.miterLimit)b.push("S",this.q=this.miterLimit)}if(a&8){if(this.j!==this.font){a=C[this.f].offsetHeight;this.h.push(b.length+2);b.push("o",a,this.j=this.font)}if(this.z!==this.textAlign)b.push("p",this.z=this.textAlign);if(this.A!==this.textBaseline)b.push("q",this.A=this.textBaseline);if(this.H!==this.canvas.currentStyle.direction)b.push("1",this.H=this.canvas.currentStyle.direction)}},
24
+ d:function(){var a=this;a.b=setTimeout(function(){if(v[a.f])a.d();else{a.b=k;a.g(l.C)}},l.B)},Q:function(){clearTimeout(this.b);this.b=k},g:function(a){var b,c,d,e=this.i,f=this.h,h=this.a,i=this.w;if(h.length){this.b&&this.Q();if(a){b=0;for(c=e.length;b<c;++b){d=e[b];h[d]=encodeURI(h[d])}b=0;for(c=f.length;b<c;++b){d=f[b];h[d]=encodeURIComponent(h[d])}}else{b=0;for(c=f.length;b<c;++b){d=f[b];h[d]=(""+h[d]).replace(/&/g,"&amp;").replace(/</g,"&lt;")}}b=h.join("\u0001");this.a=[];this.i=[];this.h=
25
+ [];if(a){i.flashvars="c="+b;i.width=i.clientWidth+this.K;this.K^=-2}else return i.CallFunction('<invoke name="executeCommand" returntype="javascript"><arguments><string>'+b+"</string></arguments></invoke>")}},P:function(a,b){this.g();this.J();if(a>0)this.w.width=a;if(b>0)this.w.height=b;this.a.push("2",a,b);this.b||this.d();this.c=0},G:function(a){var b=a.uniqueID,c=u+":"+b;if(a.width===0||a.height===0)g(11);if(b!==this.f){a=n[b].getContext("2d");if(!a.c){b=++da[b];c+=":"+b;a.a.push("3",b);a.b||a.d();
26
+ a.c=1}}return c},F:function(a){var b=this.f,c=B[b],d=ca[b],e=c[a]=L[b]++;if(e>=l.N-1)L[b]=0;e in d&&delete c[d[e]];this.h.push(this.a.length+2);this.a.push("5",e,a);d[e]=a;return e}};z.prototype={addColorStop:function(a,b){if(isNaN(a)||a<0||a>1)g(1);var c=this.O,d=this.id;(""+b).indexOf("%")>0&&c.i.push(c.a.length+3);c.a.push("y",d,a,b)}};O.prototype=Error();var ea={1:"INDEX_SIZE_ERR",9:"NOT_SUPPORTED_ERR",11:"INVALID_STATE_ERR",12:"SYNTAX_ERR",17:"TYPE_MISMATCH_ERR",18:"SECURITY_ERR"},F={initElement:function(a){if(a.getContext)return a;
27
+ var b=a.uniqueID,c="external"+b;A[b]=0;B[b]={};ca[b]=[];L[b]=0;v[b]=1;da[b]=0;aa(a);a.innerHTML='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+location.protocol+'//fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="100%" height="100%" id="'+c+'"><param name="allowScriptAccess" value="always"><param name="flashvars" value="id='+c+'"><param name="wmode" value="transparent"></object><span style="margin:0;padding:0;border:0;display:inline-block;position:static;height:1em;overflow:visible;white-space:nowrap"></span>';
28
+ n[b]=a;var d=a.firstChild;C[b]=a.lastChild;var e=m.body.contains;if(e(a))d.movie=x;else var f=setInterval(function(){if(e(a)){clearInterval(f);d.movie=x}},0);if(m.compatMode==="BackCompat"||!j.XMLHttpRequest)C[b].style.overflow="hidden";var h=new D(a,d);a.getContext=function(i){return i==="2d"?h:k};a.toDataURL=function(i,s){if(a.width===0||a.height===0)return"data:,";(""+i).replace(/[A-Z]+/g,ha)==="image/jpeg"?h.a.push("A",i,typeof s==="number"?s:""):h.a.push("A",i);return h.g().slice(1,-1)};d.attachEvent(V,
29
+ R);if(l.M){d.attachEvent(I,G);a.attachEvent(J,H)}l.D&&h.a.push("4","usePolicyFile",l.D);return a},saveImage:function(a){a.firstChild.saveImage()},setOptions:function(a){for(var b in a){var c=a[b];switch(b){case "turbo":l.C=c;break;case "delay":l.B=c;break;case "disableContextMenu":var d=l.M=c;c=void 0;for(c in n){var e=n[c],f=d?"attachEvent":"detachEvent";e.firstChild[f](I,G);e[f](J,H)}break;case "imageCacheSize":l.N=c;break;case "usePolicyFile":d=b;c=l.D=c?1:0;e=void 0;for(e in n){f=n[e].getContext("2d");
30
+ f.h.push(f.a.length+2);f.a.push("4",d,c)}}}},trigger:function(a,b){n[a].fireEvent("on"+b)},unlock:function(a,b){v[a]&&--v[a];if(b){var c=n[a],d=c.firstChild,e,f;aa(c);e=c.width;f=c.height;c.style.width=e+"px";c.style.height=f+"px";if(e>0)d.width=e;if(f>0)d.height=f;d.resize(e,f);c.attachEvent(W,S);A[a]=1}}};m.createElement(u);m.createStyleSheet().cssText=u+"{display:inline-block;overflow:hidden;width:300px;height:150px}";m.readyState==="complete"?E():m.attachEvent(Q,E);j.attachEvent(U,T);if(x.indexOf(location.protocol+
31
+ "//"+location.host+"/")===0){q=new ActiveXObject("Microsoft.XMLHTTP");q.open("GET",x,false);q.send(k)}j[X]=D;j[Y]=z;j[Z]=P;j[K]=F;j[$]={init:function(){},init_:function(){},initElement:F.initElement}}(window,document);
@@ -0,0 +1,73 @@
1
+ <?php
2
+
3
+ /**
4
+ * Proxy script to load a file from other domain
5
+ *
6
+ * PHP versions 4 and 5
7
+ *
8
+ * Copyright (c) 2010-2011 Shinya Muramatsu
9
+ *
10
+ * Permission is hereby granted, free of charge, to any person obtaining a
11
+ * copy of this software and associated documentation files (the "Software"),
12
+ * to deal in the Software without restriction, including without limitation
13
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14
+ * and/or sell copies of the Software, and to permit persons to whom the
15
+ * Software is furnished to do so, subject to the following conditions:
16
+ *
17
+ * The above copyright notice and this permission notice shall be included in
18
+ * all copies or substantial portions of the Software.
19
+ *
20
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26
+ * DEALINGS IN THE SOFTWARE.
27
+ *
28
+ * @author Shinya Muramatsu <revulon@gmail.com>
29
+ * @copyright 2010-2011 Shinya Muramatsu
30
+ * @license http://www.opensource.org/licenses/mit-license.php MIT License
31
+ * @link http://flashcanvas.net/
32
+ * @link http://code.google.com/p/flashcanvas/
33
+ */
34
+
35
+ // Whether we check referrer or not
36
+ define('CHECK_REFERRER', true);
37
+
38
+ // Check that the request is from FlashCanvas
39
+ if (CHECK_REFERRER) {
40
+ if (empty($_SERVER['HTTP_REFERER'])) {
41
+ exit;
42
+ }
43
+ if (!preg_match('#/flash\d*canvas\.swf$#', $_SERVER['HTTP_REFERER'])) {
44
+ exit;
45
+ }
46
+ }
47
+
48
+ // Check that the request has a valid URL parameter
49
+ if (empty($_GET['url'])) {
50
+ exit;
51
+ }
52
+ if (!preg_match('#^https?://#', $_GET['url'])) {
53
+ exit;
54
+ }
55
+
56
+ // Percent-encode special characters in the URL
57
+ $search = array( '%', '#', ' ');
58
+ $replace = array('%25', '%23', '%20');
59
+ $url = str_replace($search, $replace, $_GET['url']);
60
+
61
+ // Disable compression
62
+ header('Content-Encoding: none');
63
+
64
+ // Load and output the file
65
+ if (extension_loaded('curl')) {
66
+ // Use cURL extension
67
+ $ch = curl_init($url);
68
+ curl_exec($ch);
69
+ curl_close($ch);
70
+ } else {
71
+ // Use the http:// wrapper
72
+ readfile($url);
73
+ }