webshims-rails 1.11.6.1 → 1.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/lib/webshims-rails/version.rb +2 -2
  3. data/vendor/assets/javascripts/webshims/polyfiller.js +126 -72
  4. data/vendor/assets/javascripts/webshims/shims/FlashCanvas/canvas2png.js +9 -4
  5. data/vendor/assets/javascripts/webshims/shims/FlashCanvas/flashcanvas.js +32 -26
  6. data/vendor/assets/javascripts/webshims/shims/FlashCanvas/flashcanvas.swf +0 -0
  7. data/vendor/assets/javascripts/webshims/shims/FlashCanvas/proxy.php +25 -4
  8. data/vendor/assets/javascripts/webshims/shims/FlashCanvas/save.php +9 -3
  9. data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/canvas2png.js +9 -4
  10. data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/flash10canvas.swf +0 -0
  11. data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/flash9canvas.swf +0 -0
  12. data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/flashcanvas.js +36 -30
  13. data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/proxy.php +25 -4
  14. data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/save.php +9 -3
  15. data/vendor/assets/javascripts/webshims/shims/combos/1.js +13 -6
  16. data/vendor/assets/javascripts/webshims/shims/combos/10.js +156 -143
  17. data/vendor/assets/javascripts/webshims/shims/combos/11.js +97 -84
  18. data/vendor/assets/javascripts/webshims/shims/combos/12.js +2 -4
  19. data/vendor/assets/javascripts/webshims/shims/combos/13.js +1 -2
  20. data/vendor/assets/javascripts/webshims/shims/combos/14.js +956 -2819
  21. data/vendor/assets/javascripts/webshims/shims/combos/15.js +73 -67
  22. data/vendor/assets/javascripts/webshims/shims/combos/16.js +75 -71
  23. data/vendor/assets/javascripts/webshims/shims/combos/17.js +118 -89
  24. data/vendor/assets/javascripts/webshims/shims/combos/18.js +119 -91
  25. data/vendor/assets/javascripts/webshims/shims/combos/19.js +62 -65
  26. data/vendor/assets/javascripts/webshims/shims/combos/2.js +73 -67
  27. data/vendor/assets/javascripts/webshims/shims/combos/20.js +61 -63
  28. data/vendor/assets/javascripts/webshims/shims/combos/21.js +3 -6
  29. data/vendor/assets/javascripts/webshims/shims/combos/22.js +1 -2
  30. data/vendor/assets/javascripts/webshims/shims/combos/23.js +1 -2
  31. data/vendor/assets/javascripts/webshims/shims/combos/24.js +22 -12
  32. data/vendor/assets/javascripts/webshims/shims/combos/25.js +63 -67
  33. data/vendor/assets/javascripts/webshims/shims/combos/26.js +59 -59
  34. data/vendor/assets/javascripts/webshims/shims/combos/27.js +1 -2
  35. data/vendor/assets/javascripts/webshims/shims/combos/28.js +1915 -0
  36. data/vendor/assets/javascripts/webshims/shims/combos/29.js +817 -0
  37. data/vendor/assets/javascripts/webshims/shims/combos/3.js +71 -63
  38. data/vendor/assets/javascripts/webshims/shims/combos/30.js +72 -65
  39. data/vendor/assets/javascripts/webshims/shims/combos/31.js +71 -63
  40. data/vendor/assets/javascripts/webshims/shims/combos/32.js +2343 -0
  41. data/vendor/assets/javascripts/webshims/shims/combos/33.js +897 -0
  42. data/vendor/assets/javascripts/webshims/shims/combos/4.js +59 -59
  43. data/vendor/assets/javascripts/webshims/shims/combos/5.js +119 -91
  44. data/vendor/assets/javascripts/webshims/shims/combos/6.js +120 -93
  45. data/vendor/assets/javascripts/webshims/shims/combos/7.js +74 -69
  46. data/vendor/assets/javascripts/webshims/shims/combos/8.js +73 -67
  47. data/vendor/assets/javascripts/webshims/shims/combos/9.js +157 -145
  48. data/vendor/assets/javascripts/webshims/shims/dom-extend.js +58 -57
  49. data/vendor/assets/javascripts/webshims/shims/form-combat.js +0 -1
  50. data/vendor/assets/javascripts/webshims/shims/form-core.js +12 -3
  51. data/vendor/assets/javascripts/webshims/shims/form-datalist-lazy.js +4 -3
  52. data/vendor/assets/javascripts/webshims/shims/form-number-date-api.js +20 -3
  53. data/vendor/assets/javascripts/webshims/shims/form-number-date-ui.js +78 -71
  54. data/vendor/assets/javascripts/webshims/shims/form-shim-extend2.js +21 -10
  55. data/vendor/assets/javascripts/webshims/shims/form-validation.js +39 -27
  56. data/vendor/assets/javascripts/webshims/shims/forms-picker.js +173 -128
  57. data/vendor/assets/javascripts/webshims/shims/i18n/{formcfg-ch-ZN.js → formcfg-ch-CN.js} +0 -0
  58. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-en.js +0 -2
  59. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-zh-CN.js +65 -0
  60. data/vendor/assets/javascripts/webshims/shims/plugins/jquery.ui.position.js +1 -1
  61. data/vendor/assets/javascripts/webshims/shims/range-ui.js +18 -11
  62. data/vendor/assets/javascripts/webshims/shims/styles/forms-ext.css +221 -153
  63. data/vendor/assets/javascripts/webshims/shims/styles/progress.gif +0 -0
  64. data/vendor/assets/javascripts/webshims/shims/styles/progress.png +0 -0
  65. data/vendor/assets/javascripts/webshims/shims/styles/scss/_extends.scss +5 -0
  66. data/vendor/assets/javascripts/webshims/shims/styles/scss/forms-ext.scss +273 -177
  67. data/vendor/assets/javascripts/webshims/shims/styles/scss/shim.scss +113 -98
  68. data/vendor/assets/javascripts/webshims/shims/styles/shim.css +114 -88
  69. data/vendor/assets/javascripts/webshims/shims/track-ui.js +2 -2
  70. metadata +10 -7
  71. data/vendor/assets/javascripts/webshims/extras/mousepress.js +0 -60
  72. data/vendor/assets/javascripts/webshims/shims/jpicker/images/Thumbs.db +0 -0
  73. data/vendor/assets/javascripts/webshims/shims/json-storage.js +0 -316
  74. data/vendor/assets/javascripts/webshims/shims/mediagroup.js +0 -29
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * PHP versions 4 and 5
7
7
  *
8
- * Copyright (c) 2010-2011 Shinya Muramatsu
8
+ * Copyright (c) 2010-2013 Shinya Muramatsu
9
9
  *
10
10
  * Permission is hereby granted, free of charge, to any person obtaining a
11
11
  * copy of this software and associated documentation files (the "Software"),
@@ -26,21 +26,40 @@
26
26
  * DEALINGS IN THE SOFTWARE.
27
27
  *
28
28
  * @author Shinya Muramatsu <revulon@gmail.com>
29
- * @copyright 2010-2011 Shinya Muramatsu
29
+ * @copyright 2010-2013 Shinya Muramatsu
30
30
  * @license http://www.opensource.org/licenses/mit-license.php MIT License
31
31
  * @link http://flashcanvas.net/
32
32
  * @link http://code.google.com/p/flashcanvas/
33
33
  */
34
34
 
35
+ function getHostName() {
36
+ if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
37
+ return $_SERVER['HTTP_X_FORWARDED_HOST'];
38
+ } else if (isset($_SERVER['HTTP_HOST'])) {
39
+ return $_SERVER['HTTP_HOST'];
40
+ } else {
41
+ return $_SERVER['SERVER_NAME'];
42
+ }
43
+ }
44
+
35
45
  // Whether we check referrer or not
36
46
  define('CHECK_REFERRER', true);
37
47
 
38
- // Check that the request is from FlashCanvas
48
+ // If necessary, specify the host where the SWF file is located
49
+ define('SWF_HOST_NAME', '');
50
+
51
+ // Check that the request comes from the same host
39
52
  if (CHECK_REFERRER) {
40
53
  if (empty($_SERVER['HTTP_REFERER'])) {
41
54
  exit;
42
55
  }
43
- if (!preg_match('#/flash\d*canvas\.swf$#', $_SERVER['HTTP_REFERER'])) {
56
+ if (SWF_HOST_NAME) {
57
+ $host = SWF_HOST_NAME;
58
+ } else {
59
+ $host = getHostName();
60
+ }
61
+ $pattern = '#^https?://' . str_replace('.', '\.', $host) . '(:\d*)?/#';
62
+ if (!preg_match($pattern, $_SERVER['HTTP_REFERER'])) {
44
63
  exit;
45
64
  }
46
65
  }
@@ -65,6 +84,8 @@ header('Content-Encoding: none');
65
84
  if (extension_loaded('curl')) {
66
85
  // Use cURL extension
67
86
  $ch = curl_init($url);
87
+ // curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
88
+ // curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
68
89
  curl_exec($ch);
69
90
  curl_close($ch);
70
91
  } else {
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * PHP versions 4 and 5
7
7
  *
8
- * Copyright (c) 2010-2011 Shinya Muramatsu
8
+ * Copyright (c) 2010-2013 Shinya Muramatsu
9
9
  *
10
10
  * Permission is hereby granted, free of charge, to any person obtaining a
11
11
  * copy of this software and associated documentation files (the "Software"),
@@ -26,16 +26,22 @@
26
26
  * DEALINGS IN THE SOFTWARE.
27
27
  *
28
28
  * @author Shinya Muramatsu <revulon@gmail.com>
29
- * @copyright 2010-2011 Shinya Muramatsu
29
+ * @copyright 2010-2013 Shinya Muramatsu
30
30
  * @license http://www.opensource.org/licenses/mit-license.php MIT License
31
31
  * @link http://flashcanvas.net/
32
32
  * @link http://code.google.com/p/flashcanvas/
33
33
  */
34
34
 
35
35
  if ($_SERVER['REQUEST_METHOD'] === 'POST') {
36
+ if (isset($_GET['filename'])) {
37
+ $filename = $_GET['filename'];
38
+ } else {
39
+ $filename = 'canvas.png';
40
+ }
41
+
36
42
  // Force download
37
43
  header('Content-Type: application/octet-stream');
38
- header('Content-Disposition: attachment; filename="canvas.png"');
44
+ header('Content-Disposition: attachment; filename="' . $filename . '"');
39
45
 
40
46
  if (isset($_POST['dataurl'])) {
41
47
  // Decode the base64-encoded data
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * canvas2png.js
3
3
  *
4
- * Copyright (c) 2010-2011 Shinya Muramatsu
4
+ * Copyright (c) 2010-2013 Shinya Muramatsu
5
5
  * Released under the MIT License
6
6
  * http://flashcanvas.net/
7
7
  */
@@ -12,19 +12,24 @@ var scripts = doc.getElementsByTagName("script");
12
12
  var script = scripts[scripts.length - 1];
13
13
  var url = script.getAttribute("src").replace(/[^\/]+$/, "save.php");
14
14
 
15
- window.canvas2png = function(canvas) {
15
+ window.canvas2png = function(canvas, filename) {
16
16
  var tagName = canvas.tagName.toLowerCase();
17
17
  if (tagName !== "canvas") {
18
18
  return;
19
19
  }
20
20
 
21
21
  if (typeof FlashCanvas !== "undefined") {
22
- FlashCanvas.saveImage(canvas);
22
+ FlashCanvas.saveImage(canvas, filename);
23
23
  } else {
24
+ var action = url;
25
+ if (filename) {
26
+ action += "?filename=" + filename;
27
+ }
28
+
24
29
  var form = doc.createElement("form");
25
30
  var input = doc.createElement("input");
26
31
 
27
- form.setAttribute("action", url);
32
+ form.setAttribute("action", action);
28
33
  form.setAttribute("method", "post");
29
34
 
30
35
  input.setAttribute("type", "hidden");
@@ -1,38 +1,44 @@
1
+ window.FlashCanvasOptions = window.FlashCanvasOptions || {};
2
+ webshims.$.extend(FlashCanvasOptions, {
3
+ swfPath: webshims.cfg.basePath + 'FlashCanvasPro/'
4
+ });
5
+
1
6
  /*
2
7
  * FlashCanvas Pro
3
8
  *
4
9
  * Copyright (c) 2009 Tim Cameron Ryan
5
- * Copyright (c) 2009-2011 Shinya Muramatsu
10
+ * Copyright (c) 2009-2013 Shinya Muramatsu
6
11
  */
7
- window.FlashCanvasOptions = window.FlashCanvasOptions || {};
8
- webshims.$.extend(FlashCanvasOptions, {
9
- swfPath: webshims.cfg.basePath + 'FlashCanvasPro/'
10
- });
11
- 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),
12
- 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,
13
- 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,
14
- 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;
15
- 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=
16
- 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",
17
- 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();
18
- 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||
19
- 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",
20
- 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,
21
- 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=
22
- 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,
23
- 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)&&
24
- 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=
25
- 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",
26
- 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=
27
- 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)}},
28
- 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=
29
- [];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();
30
- 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;
31
- 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>';
32
- 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,
33
- 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");
34
- 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+
35
- "//"+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);
12
+ window.ActiveXObject&&!window.CanvasRenderingContext2D&&function(l,k,q){function O(a){this.code=a;this.message=ga[a]}function w(a,b,c){if(!c)for(var c=[],d=0,e=a*b*4;d<e;++d)c[d]=0;this.width=a;this.height=b;this.data=c}function ha(a){this.width=a}function x(a){this.id=a.F++}function o(a){this.J=a;this.id=a.F++}function A(a,b){this.canvas=a;this.z=b;this.e=b.id.slice(8);this.G();this.F=0;this.j=this.D="";this.d=0}function B(){if(k.readyState==="complete"){k.detachEvent(P,B);for(var a=k.getElementsByTagName(r),
13
+ b=0,c=a.length;b<c;++b)C.initElement(a[b])}}function Q(){var a=event.srcElement,b=a.parentNode;a.blur();b.focus()}function D(){event.button&2&&event.srcElement.parentNode.setCapture()}function E(){event.button&2&&event.srcElement.parentNode.releaseCapture()}function R(){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;c===d?(b.style[a]=d+"px",b.getContext("2d").K(b.width,b.height)):b[a]=d}}function S(){l.detachEvent(T,
14
+ S);for(var a in m){var b=m[a],c=b.firstChild,d;for(d in c)typeof c[d]==="function"&&(c[d]=g);for(d in b)typeof b[d]==="function"&&(b[d]=g);c.detachEvent(U,Q);c.detachEvent(F,D);b.detachEvent(G,E);b.detachEvent(V,R)}l[W]=g;l[X]=g;l[Y]=g;l[H]=g;l[Z]=g}function ia(a){return a.toLowerCase()}function i(a){throw new O(a);}function $(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}function I(a,b){for(var c in m){var d=m[c].getContext("2d");
15
+ d.g.push(d.a.length+2);d.a.push(y,a,b)}}var g=null,r="canvas",W="CanvasRenderingContext2D",X="CanvasGradient",Y="CanvasPattern",H="FlashCanvas",Z="G_vmlCanvasManager",U="onfocus",F="onmousedown",G="onmouseup",V="onpropertychange",P="onreadystatechange",T="onunload",n;try{n=(new ActiveXObject("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version").match(/[\d,]+/)[0].replace(/,/g,".")}catch(ka){n=0}var j=l[H+"Options"]||{},J=function(){var a=k.getElementsByTagName("script"),a=a[a.length-1];return k.documentMode>=
16
+ 8?a.src:a.getAttribute("src",4)}().replace(/[^\/]+$/,""),t=j.swfPath||J;t+=parseInt(n)>9?"flash10canvas.swf":"flash9canvas.swf";var y="4",s={},u={},aa={},K={},p={},ba={},v={},m={},z={},J="autoinit"in j?j.autoinit:1,L="turbo"in j?j.turbo:1,M=j.delay||0,ca=j.disableContextMenu||0,da=j.imageCacheSize||100,N=j.usePolicyFile||0,ea=j.proxy||"proxy.php",fa=j.save||"save.php";n==="10.1.53.64"&&(L=0,M=30);A.prototype={save:function(){this.h(15);this.I.push([this.m,this.n,this.w,this.l,this.q,this.o,this.p,
17
+ this.r,this.u,this.v,this.s,this.t,this.j,this.A,this.B]);this.a.push("B")},restore:function(){var a=this.I;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],this.textBaseline=a[14];this.a.push("C")},scale:function(a,b){this.a.push("D",
18
+ 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",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))&&i(9);this.a.push("M",a,b,c,d);return new o(this)},createRadialGradient:function(a,b,c,d,e,f){(!isFinite(a)||!isFinite(b)||!isFinite(c)||!isFinite(d)||!isFinite(e)||!isFinite(f))&&i(9);(c<
19
+ 0||f<0)&&i(1);this.a.push("N",a,b,c,d,e,f);return new o(this)},createPattern:function(a,b){a||i(17);var c=a.tagName,d,e,f,h=this.e;if(c)if(c=c.toLowerCase(),c==="img")d=a.getAttribute("src",2);else if(c===r)e=this.C(a),f=a!==this.canvas;else if(c==="video")return;else i(17);else a.src?d=a.src:i(17);b==="repeat"||b==="no-repeat"||b==="repeat-x"||b==="repeat-y"||b===""||b===g||i(12);e||(e=u[h][d],(f=e===q)&&(e=this.k(d)));this.a.push("O",e,b);f&&s[h]&&(this.f(),++p[h]);return new x(this)},clearRect:function(a,
20
+ b,c,d){this.a.push("X",a,b,c,d);this.b||this.c();this.d=0},fillRect:function(a,b,c,d){this.h(1);this.a.push("Y",a,b,c,d);this.b||this.c();this.d=0},strokeRect:function(a,b,c,d){this.h(6);this.a.push("Z",a,b,c,d);this.b||this.c();this.d=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",
21
+ a,b,c,d,e,f)},arcTo:function(a,b,c,d,e){e<0&&isFinite(e)&&i(1);this.a.push("g",a,b,c,d,e)},rect:function(a,b,c,d){this.a.push("h",a,b,c,d)},arc:function(a,b,c,d,e,f){c<0&&isFinite(c)&&i(1);this.a.push("i",a,b,c,d,e,f?1:0)},fill:function(){this.h(1);this.a.push("j");this.b||this.c();this.d=0},stroke:function(){this.h(6);this.a.push("k");this.b||this.c();this.d=0},clip:function(){this.a.push("l")},isPointInPath:function(a,b){this.a.push("m",a,b);return this.f()==="true"},fillText:function(a,b,c,d){this.h(9);
22
+ this.g.push(this.a.length+1);this.a.push("r",a,b,c,d===q?Infinity:d);this.b||this.c();this.d=0},strokeText:function(a,b,c,d){this.h(10);this.g.push(this.a.length+1);this.a.push("s",a,b,c,d===q?Infinity:d);this.b||this.c();this.d=0},measureText:function(a){var b=z[this.e];try{b.style.font=this.font}catch(c){}b.innerText=(""+a).replace(/[ \n\f\r]/g,"\t");return new ha(b.offsetWidth)},drawImage:function(a,b,c,d,e,f,h,ja,l){a||i(17);var g=a.tagName,k,j,m,n=arguments.length,o=this.e;if(g)if(g=g.toLowerCase(),
23
+ g==="img")k=a.getAttribute("src",2);else if(g===r)j=this.C(a),m=a!==this.canvas;else if(g==="video")return;else i(17);else a.src?k=a.src:i(17);j||(j=u[o][k],(m=j===q)&&(j=this.k(k)));this.h(0);if(n===3)this.a.push("u",n,j,b,c);else if(n===5)this.a.push("u",n,j,b,c,d,e);else if(n===9)(d===0||e===0)&&i(1),this.a.push("u",n,j,b,c,d,e,f,h,ja,l);else return;m&&s[o]?(this.f(),++p[o]):this.b||this.c();this.d=0},createImageData:function(a,b){var c=Math.ceil;arguments.length===2?((!isFinite(a)||!isFinite(b))&&
24
+ i(9),(a===0||b===0)&&i(1)):(a instanceof w||i(9),b=a.height,a=a.width);a=c(a<0?-a:a);b=c(b<0?-b:b);return new w(a,b)},getImageData:function(a,b,c,d){(!isFinite(a)||!isFinite(b)||!isFinite(c)||!isFinite(d))&&i(9);(c===0||d===0)&&i(1);this.a.push("w",a,b,c,d);a=this.f();c=typeof JSON==="object"?JSON.parse(a):k.documentMode?eval(a):a.slice(1,-1).split(",");a=c.shift();b=c.shift();return new w(a,b,c)},putImageData:function(a,b,c,d,e,f,h){a instanceof w||i(17);(!isFinite(b)||!isFinite(c))&&i(9);var g=
25
+ arguments.length,j=a.width,k=a.height,l=a.data;g===3?this.a.push("x",g,j,k,l.toString(),b,c):g===7&&((!isFinite(d)||!isFinite(e)||!isFinite(f)||!isFinite(h))&&i(9),this.a.push("x",g,j,k,l.toString(),b,c,d,e,f,h));this.b||this.c();this.d=0},loadFont:function(a,b,c){var d=this.e;if(b||c)v[d][a]=[a,b,c];this.g.push(this.a.length+1);this.a.push("6",a);s[d]?(this.f(),++p[d]):this.b||this.c()},loadImage:function(a,b,c){var d=a.tagName,e,f=this.e;if(d)d.toLowerCase()==="img"&&(e=a.getAttribute("src",2));
26
+ else if(a.src)e=a.src;if(e&&u[f][e]===q){d=this.k(e);if(b||c)v[f][d]=[a,b,c];this.a.push("u",1,d);s[f]&&(this.f(),++p[f])}},G:function(){this.globalAlpha=this.m=1;this.globalCompositeOperation=this.n="source-over";this.fillStyle=this.l=this.strokeStyle=this.w="#000000";this.lineWidth=this.q=1;this.lineCap=this.o="butt";this.lineJoin=this.p="miter";this.miterLimit=this.r=10;this.shadowBlur=this.s=this.shadowOffsetY=this.v=this.shadowOffsetX=this.u=0;this.shadowColor=this.t="rgba(0, 0, 0, 0.0)";this.font=
27
+ this.j="10px sans-serif";this.textAlign=this.A="start";this.textBaseline=this.B="alphabetic";this.a=[];this.I=[];this.i=[];this.g=[];this.b=g;this.H=1},h:function(a){var b=this.a,c;if(this.m!==this.globalAlpha)b.push("I",this.m=this.globalAlpha);if(this.n!==this.globalCompositeOperation)b.push("J",this.n=this.globalCompositeOperation);if(this.u!==this.shadowOffsetX)b.push("T",this.u=this.shadowOffsetX);if(this.v!==this.shadowOffsetY)b.push("U",this.v=this.shadowOffsetY);if(this.s!==this.shadowBlur)b.push("V",
28
+ this.s=this.shadowBlur);if(this.t!==this.shadowColor)c=this.t=this.shadowColor,(""+c).indexOf("%")>0&&this.i.push(b.length+1),b.push("W",c);if(a&1&&this.l!==this.fillStyle)c=this.l=this.fillStyle,typeof c==="string"?(c.indexOf("%")>0&&this.i.push(b.length+1),b.push("L",c)):(c instanceof o||c instanceof x)&&b.push("L",c.id);if(a&2&&this.w!==this.strokeStyle)c=this.w=this.strokeStyle,typeof c==="string"?(c.indexOf("%")>0&&this.i.push(b.length+1),b.push("K",c)):(c instanceof o||c instanceof x)&&b.push("K",
29
+ c.id);if(a&4){if(this.q!==this.lineWidth)b.push("P",this.q=this.lineWidth);if(this.o!==this.lineCap)b.push("Q",this.o=this.lineCap);if(this.p!==this.lineJoin)b.push("R",this.p=this.lineJoin);if(this.r!==this.miterLimit)b.push("S",this.r=this.miterLimit)}if(a&8){if(this.j!==this.font)a=z[this.e].offsetHeight,this.g.push(b.length+2),b.push("o",a,this.j=this.font);if(this.A!==this.textAlign)b.push("p",this.A=this.textAlign);if(this.B!==this.textBaseline)b.push("q",this.B=this.textBaseline);if(this.D!==
30
+ this.canvas.currentStyle.direction)b.push("1",this.D=this.canvas.currentStyle.direction)}},c:function(){var a=this;a.b=setTimeout(function(){p[a.e]?a.c():(a.b=g,a.f(L))},M)},L:function(){clearTimeout(this.b);this.b=g},f:function(a){var b,c,d,e=this.i,f=this.g,h=this.a,g=this.z;if(h.length){this.b&&this.L();if(a){for(b=0,c=e.length;b<c;++b)d=e[b],h[d]=encodeURI(h[d]);for(b=0,c=f.length;b<c;++b)d=f[b],h[d]=encodeURIComponent(h[d])}else for(b=0,c=f.length;b<c;++b)d=f[b],h[d]=(""+h[d]).replace(/&/g,"&amp;").replace(/</g,
31
+ "&lt;");b=h.join("\u0001");this.a=[];this.i=[];this.g=[];if(a)g.flashvars="c="+b,g.width=g.clientWidth+this.H,this.H^=-2;else return g.CallFunction('<invoke name="executeCommand" returntype="javascript"><arguments><string>'+b+"</string></arguments></invoke>")}},K:function(a,b){this.f();this.G();if(a>0)this.z.width=a;if(b>0)this.z.height=b;this.a.push("2",a,b);this.b||this.c();this.d=0},C:function(a){var b=a.getContext("2d").e,c=r+":"+b;(a.width===0||a.height===0)&&i(11);if(b!==this.e&&(a=m[b].getContext("2d"),
32
+ !a.d))b=++ba[b],c+=":"+b,a.a.push("3",b),a.b||a.c(),a.d=1;return c},k:function(a){var b=this.e,c=u[b],d=aa[b],e=c[a]=K[b]++;e>=da-1&&(K[b]=0);e in d&&delete c[d[e]];this.g.push(this.a.length+2);this.a.push("5",e,a);d[e]=a;return e}};o.prototype={addColorStop:function(a,b){(isNaN(a)||a<0||a>1)&&i(1);var c=this.J,d=this.id;(""+b).indexOf("%")>0&&c.i.push(c.a.length+3);c.a.push("y",d,a,b)}};O.prototype=Error();var ga={1:"INDEX_SIZE_ERR",9:"NOT_SUPPORTED_ERR",11:"INVALID_STATE_ERR",12:"SYNTAX_ERR",17:"TYPE_MISMATCH_ERR",
33
+ 18:"SECURITY_ERR"},C={initElement:function(a){if(a.getContext)return a;var b=Math.random().toString(36).slice(2)||"0",c="external"+b;s[b]=0;u[b]={};aa[b]=[];K[b]=0;p[b]=1;ba[b]=0;v[b]=[];$(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+
34
+ '"><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>';m[b]=a;var d=a.firstChild;z[b]=a.lastChild;var e=k.body.contains;if(e(a))d.movie=t;else var f=setInterval(function(){if(e(a))clearInterval(f),d.movie=t},0);if(k.compatMode==="BackCompat"||!l.XMLHttpRequest)z[b].style.overflow="hidden";var h=new A(a,d);a.getContext=function(a){return a==="2d"?h:g};a.toDataURL=function(b,
35
+ c){if(a.width===0||a.height===0)return"data:,";(""+b).replace(/[A-Z]+/g,ia)==="image/jpeg"?h.a.push("A",b,typeof c==="number"?c:""):h.a.push("A",b);return h.f().slice(1,-1)};d.attachEvent(U,Q);ca&&(d.attachEvent(F,D),a.attachEvent(G,E));N&&h.a.push(y,"usePolicyFile",N);b=h.a.length;h.g.push(b+2,b+5);h.a.push(y,"proxy",ea,y,"save",fa);return a},saveImage:function(a,b){a.firstChild.saveImage(b)},setOptions:function(a){for(var b in a){var c=a[b];switch(b){case "turbo":L=c;break;case "delay":M=c;break;
36
+ case "disableContextMenu":ca=c;var d=void 0;for(d in m){var e=m[d],f=c?"attachEvent":"detachEvent";e.firstChild[f](F,D);e[f](G,E)}break;case "imageCacheSize":da=c;break;case "usePolicyFile":I(b,N=c?1:0);break;case "proxy":I(b,ea=c);break;case "save":I(b,fa=c)}}},trigger:function(a,b){m[a].fireEvent("on"+b)},unlock:function(a,b,c){var d,e,f;p[a]&&--p[a];if(b===q){d=m[a];b=d.firstChild;$(d);e=d.width;c=d.height;d.style.width=e+"px";d.style.height=c+"px";if(e>0)b.width=e;if(c>0)b.height=c;b.resize(e,
37
+ c);d.attachEvent(V,R);s[a]=1;typeof d.onload==="function"&&setTimeout(function(){d.onload()},0)}else if(f=v[a][b])e=f[0],c=f[1+c],delete v[a][b],typeof c==="function"&&c.call(e)}};k.createElement(r);k.createStyleSheet().cssText=r+"{display:inline-block;overflow:hidden;width:300px;height:150px}";J&&(k.readyState==="complete"?B():k.attachEvent(P,B));l.attachEvent(T,S);t.indexOf(location.protocol+"//"+location.host+"/")===0&&(n=new ActiveXObject("Microsoft.XMLHTTP"),n.open("GET",t,!1),n.send(g));l[W]=
38
+ A;l[X]=o;l[Y]=x;l[H]=C;l[Z]={init:function(){},init_:function(){},initElement:C.initElement}}(window,document);
39
+
40
+
41
+
36
42
  (function(document){
37
43
  webshims.addReady(function(context, elem){
38
44
  if(context == document){
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * PHP versions 4 and 5
7
7
  *
8
- * Copyright (c) 2010-2011 Shinya Muramatsu
8
+ * Copyright (c) 2010-2013 Shinya Muramatsu
9
9
  *
10
10
  * Permission is hereby granted, free of charge, to any person obtaining a
11
11
  * copy of this software and associated documentation files (the "Software"),
@@ -26,21 +26,40 @@
26
26
  * DEALINGS IN THE SOFTWARE.
27
27
  *
28
28
  * @author Shinya Muramatsu <revulon@gmail.com>
29
- * @copyright 2010-2011 Shinya Muramatsu
29
+ * @copyright 2010-2013 Shinya Muramatsu
30
30
  * @license http://www.opensource.org/licenses/mit-license.php MIT License
31
31
  * @link http://flashcanvas.net/
32
32
  * @link http://code.google.com/p/flashcanvas/
33
33
  */
34
34
 
35
+ function getHostName() {
36
+ if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
37
+ return $_SERVER['HTTP_X_FORWARDED_HOST'];
38
+ } else if (isset($_SERVER['HTTP_HOST'])) {
39
+ return $_SERVER['HTTP_HOST'];
40
+ } else {
41
+ return $_SERVER['SERVER_NAME'];
42
+ }
43
+ }
44
+
35
45
  // Whether we check referrer or not
36
46
  define('CHECK_REFERRER', true);
37
47
 
38
- // Check that the request is from FlashCanvas
48
+ // If necessary, specify the host where the SWF file is located
49
+ define('SWF_HOST_NAME', '');
50
+
51
+ // Check that the request comes from the same host
39
52
  if (CHECK_REFERRER) {
40
53
  if (empty($_SERVER['HTTP_REFERER'])) {
41
54
  exit;
42
55
  }
43
- if (!preg_match('#/flash\d*canvas\.swf$#', $_SERVER['HTTP_REFERER'])) {
56
+ if (SWF_HOST_NAME) {
57
+ $host = SWF_HOST_NAME;
58
+ } else {
59
+ $host = getHostName();
60
+ }
61
+ $pattern = '#^https?://' . str_replace('.', '\.', $host) . '(:\d*)?/#';
62
+ if (!preg_match($pattern, $_SERVER['HTTP_REFERER'])) {
44
63
  exit;
45
64
  }
46
65
  }
@@ -65,6 +84,8 @@ header('Content-Encoding: none');
65
84
  if (extension_loaded('curl')) {
66
85
  // Use cURL extension
67
86
  $ch = curl_init($url);
87
+ // curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
88
+ // curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
68
89
  curl_exec($ch);
69
90
  curl_close($ch);
70
91
  } else {
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * PHP versions 4 and 5
7
7
  *
8
- * Copyright (c) 2010-2011 Shinya Muramatsu
8
+ * Copyright (c) 2010-2013 Shinya Muramatsu
9
9
  *
10
10
  * Permission is hereby granted, free of charge, to any person obtaining a
11
11
  * copy of this software and associated documentation files (the "Software"),
@@ -26,16 +26,22 @@
26
26
  * DEALINGS IN THE SOFTWARE.
27
27
  *
28
28
  * @author Shinya Muramatsu <revulon@gmail.com>
29
- * @copyright 2010-2011 Shinya Muramatsu
29
+ * @copyright 2010-2013 Shinya Muramatsu
30
30
  * @license http://www.opensource.org/licenses/mit-license.php MIT License
31
31
  * @link http://flashcanvas.net/
32
32
  * @link http://code.google.com/p/flashcanvas/
33
33
  */
34
34
 
35
35
  if ($_SERVER['REQUEST_METHOD'] === 'POST') {
36
+ if (isset($_GET['filename'])) {
37
+ $filename = $_GET['filename'];
38
+ } else {
39
+ $filename = 'canvas.png';
40
+ }
41
+
36
42
  // Force download
37
43
  header('Content-Type: application/octet-stream');
38
- header('Content-Disposition: attachment; filename="canvas.png"');
44
+ header('Content-Disposition: attachment; filename="' . $filename . '"');
39
45
 
40
46
  if (isset($_POST['dataurl'])) {
41
47
  // Decode the base64-encoded data
@@ -449,7 +449,7 @@ var swfmini = function() {
449
449
  }
450
450
  };
451
451
  }();
452
-
452
+ ;
453
453
  webshims.register('form-core', function($, webshims, window, document, undefined, options){
454
454
  "use strict";
455
455
 
@@ -514,6 +514,7 @@ webshims.register('form-core', function($, webshims, window, document, undefined
514
514
  };
515
515
 
516
516
  var extendSels = function(){
517
+ var matches, matchesOverride;
517
518
  var exp = $.expr[":"];
518
519
  $.extend(exp, {
519
520
  "valid-element": function(elem){
@@ -538,7 +539,15 @@ webshims.register('form-core', function($, webshims, window, document, undefined
538
539
  });
539
540
 
540
541
  // sizzle/jQuery has a bug with :disabled/:enabled selectors
541
- if(Modernizr.fieldsetdisabled && !$('<fieldset disabled=""><input /><fieldset>').find('input').is(':disabled')){
542
+ if(Modernizr.fieldsetdisabled && !$('<fieldset disabled=""><input /><input /></fieldset>').find(':disabled').filter(':disabled').is(':disabled')){
543
+ matches = $.find.matches;
544
+ matchesOverride = {':disabled': 1, ':enabled': 1};
545
+ $.find.matches = function(expr, elements){
546
+ if(matchesOverride[expr]){
547
+ return matches.call(this, '*'+expr, elements);
548
+ }
549
+ return matches.apply(this, arguments);
550
+ };
542
551
  $.extend(exp, {
543
552
  "enabled": function( elem ) {
544
553
  return elem.disabled === false && !$(elem).is('fieldset[disabled] *');
@@ -642,7 +651,7 @@ webshims.register('form-core', function($, webshims, window, document, undefined
642
651
  if(webshims.errorbox && webshims.errorbox.initIvalContentMessage){
643
652
  webshims.errorbox.initIvalContentMessage(elem);
644
653
  }
645
- var message = (webshims.getOptions && webshims.errorbox ? webshims.getOptions(elem, 'errormessage') : $(elem).data('errormessage')) || elem.getAttribute('x-moz-errormessage') || '';
654
+ var message = (webshims.getOptions && webshims.errorbox ? webshims.getOptions(elem, 'errormessage', false, true) : $(elem).data('errormessage')) || elem.getAttribute('x-moz-errormessage') || '';
646
655
  if(key && message[key]){
647
656
  message = message[key];
648
657
  } else if(message) {
@@ -693,10 +702,8 @@ webshims.register('form-core', function($, webshims, window, document, undefined
693
702
  }
694
703
  });
695
704
  webshims.ready('WINDOWLOAD', lazyLoad);
696
-
697
705
  });
698
-
699
- (function(Modernizr, webshims){
706
+ ;(function(Modernizr, webshims){
700
707
  "use strict";
701
708
  var $ = webshims.$;
702
709
  var hasNative = Modernizr.audio && Modernizr.video;
@@ -40,34 +40,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
40
40
  webshims.ready('WINDOWLOAD', switch$);
41
41
 
42
42
  }
43
- // (function(){
44
- // var hostNames = {
45
- // 'afarkas.github.io': 1,
46
- // localhost: 1,
47
- // '127.0.0.1': 1
48
- // };
49
- //
50
- // if( webshims.cfg.debug && (hostNames[location.hostname] || location.protocol == 'file:') ){
51
- // var list = $('<ul class="webshims-debug-list" />');
52
- // webshims.errorLog.push = function(message){
53
- // list.appendTo('body');
54
- // $('<li style="display: none;">'+ message +'</li>')
55
- // .appendTo(list)
56
- // .slideDown()
57
- // .delay(3000)
58
- // .slideUp(function(){
59
- // $(this).remove();
60
- // if(!$('li', list).length){
61
- // list.detach();
62
- // }
63
- // })
64
- // ;
65
- // };
66
- // $.each(webshims.errorLog, function(i, message){
67
- // webshims.errorLog.push(message);
68
- // });
69
- // }
70
- // })();
71
43
 
72
44
  //shortcus
73
45
  var modules = webshims.modules;
@@ -509,11 +481,22 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
509
481
  });
510
482
  },
511
483
  getOptions: (function(){
484
+ var normalName = /\-([a-z])/g;
512
485
  var regs = {};
486
+ var nameRegs = {};
513
487
  var regFn = function(f, upper){
514
488
  return upper.toLowerCase();
515
489
  };
516
- return function(elem, name, bases){
490
+ var nameFn = function(f, dashed){
491
+ return dashed.toUpperCase();
492
+ };
493
+ return function(elem, name, bases, stringAllowed){
494
+ if(nameRegs[name]){
495
+ name = nameRegs[name];
496
+ } else {
497
+ nameRegs[name] = name.replace(normalName, nameFn);
498
+ name = nameRegs[name];
499
+ }
517
500
  var data = elementData(elem, 'cfg'+name);
518
501
  var dataName;
519
502
  var cfg = {};
@@ -522,7 +505,12 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
522
505
  return data;
523
506
  }
524
507
  data = $(elem).data();
525
-
508
+ if(data && typeof data[name] == 'string'){
509
+ if(stringAllowed){
510
+ return elementData(elem, 'cfg'+name, data[name]);
511
+ }
512
+ webshims.error('data-'+ name +' attribute has to be a valid JSON, was: '+ data[name]);
513
+ }
526
514
  if(!bases){
527
515
  bases = [true, {}];
528
516
  } else if(!Array.isArray(bases)){
@@ -531,12 +519,8 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
531
519
  bases.unshift(true, {});
532
520
  }
533
521
 
534
- if(data && data[name]){
535
- if(typeof data[name] == 'object'){
536
- bases.push(data[name]);
537
- } else {
538
- webshims.error('data-'+ name +' attribute has to be a valid JSON, was: '+ data[name]);
539
- }
522
+ if(data && typeof data[name] == 'object'){
523
+ bases.push(data[name]);
540
524
  }
541
525
 
542
526
  if(!regs[name]){
@@ -549,7 +533,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
549
533
  }
550
534
  }
551
535
  bases.push(cfg);
552
-
553
536
  return elementData(elem, 'cfg'+name, $.extend.apply($, bases));
554
537
  };
555
538
  })(),
@@ -579,7 +562,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
579
562
  var resizeTimer;
580
563
  var lastHeight;
581
564
  var lastWidth;
582
-
565
+ var $window = $(window);
583
566
  var docObserve = {
584
567
  init: false,
585
568
  runs: 0,
@@ -599,25 +582,36 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
599
582
  docObserve.runs = 0;
600
583
  }
601
584
  },
602
- handler: function(e){
603
- clearTimeout(resizeTimer);
604
- resizeTimer = setTimeout(function(){
605
- if(e.type == 'resize'){
606
- var width = $(window).width();
607
- var height = $(window).width();
608
- if(height == lastHeight && width == lastWidth){
609
- return;
585
+ handler: (function(){
586
+ var trigger = function(){
587
+ $(document).triggerHandler('updateshadowdom');
588
+ };
589
+ return function(e){
590
+ clearTimeout(resizeTimer);
591
+ resizeTimer = setTimeout(function(){
592
+ if(e.type == 'resize'){
593
+ var width = $window.width();
594
+ var height = $window.width();
595
+
596
+ if(height == lastHeight && width == lastWidth){
597
+ return;
598
+ }
599
+ lastHeight = height;
600
+ lastWidth = width;
601
+
602
+ docObserve.height = docObserve.getHeight();
603
+ docObserve.width = docObserve.getWidth();
604
+ }
605
+
606
+ if(window.requestAnimationFrame){
607
+ requestAnimationFrame(trigger);
608
+ } else {
609
+ setTimeout(trigger, 0);
610
610
  }
611
- lastHeight = height;
612
- lastWidth = width;
613
-
614
- docObserve.height = docObserve.getHeight();
615
- docObserve.width = docObserve.getWidth();
616
611
 
617
- }
618
- $(document).triggerHandler('updateshadowdom');
619
- }, (e.type == 'resize') ? 50 : 9);
620
- },
612
+ }, (e.type == 'resize' && !window.requestAnimationFrame) ? 50 : 0);
613
+ };
614
+ })(),
621
615
  _create: function(){
622
616
  $.each({ Height: "getHeight", Width: "getWidth" }, function(name, type){
623
617
  var body = document.body;
@@ -955,13 +949,17 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
955
949
  webshims.defineNodeNamesProperty(elementNames, prop, {
956
950
  attr: {
957
951
  set: function(val){
958
- this.setAttribute(prop, val);
952
+ if(descs.useContentAttribute){
953
+ webshims.contentAttr(this, prop, val);
954
+ } else {
955
+ this.setAttribute(prop, val);
956
+ }
959
957
  if(descs.set){
960
958
  descs.set.call(this, true);
961
959
  }
962
960
  },
963
961
  get: function(){
964
- var ret = this.getAttribute(prop);
962
+ var ret = (descs.useContentAttribute) ? webshims.contentAttr(this, prop) : this.getAttribute(prop);
965
963
  return (ret == null) ? undefined : prop;
966
964
  }
967
965
  },
@@ -1018,6 +1016,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1018
1016
  });
1019
1017
  }
1020
1018
  };
1019
+
1021
1020
  var select = function(obj){
1022
1021
  var oldLang = obj.__active;
1023
1022
  var selectLang = function(i, lang){
@@ -1025,6 +1024,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1025
1024
  if(obj[lang] || obj.availableLangs.indexOf(lang) != -1){
1026
1025
  if(obj[lang]){
1027
1026
  obj.__active = obj[lang];
1027
+ obj.__activeName = lang;
1028
1028
  } else {
1029
1029
  load(obj.langSrc+lang, obj, curLang.join());
1030
1030
  }
@@ -1034,6 +1034,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1034
1034
  $.each(curLang, selectLang);
1035
1035
  if(!obj.__active){
1036
1036
  obj.__active = obj[''];
1037
+ obj.__activeName = '';
1037
1038
  }
1038
1039
  if(oldLang != obj.__active){
1039
1040
  $(obj).trigger('change');
@@ -1138,8 +1139,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1138
1139
  }
1139
1140
  });
1140
1141
 
1141
- })(webshims.$, document);
1142
- (function($){
1142
+ })(webshims.$, document);;(function($){
1143
1143
 
1144
1144
  var id = 0;
1145
1145
  var isNumber = function(string){
@@ -1159,7 +1159,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1159
1159
 
1160
1160
  this.element.addClass('ws-range').attr({role: 'slider'}).append('<span class="ws-range-min ws-range-progress" /><span class="ws-range-rail ws-range-track"><span class="ws-range-thumb" /></span>');
1161
1161
  this.trail = $('.ws-range-track', this.element);
1162
- this.range = $('.ws-range-progress ', this.element);
1162
+ this.range = $('.ws-range-progress', this.element);
1163
1163
  this.thumb = $('.ws-range-thumb', this.trail);
1164
1164
 
1165
1165
  this.updateMetrics();
@@ -1179,7 +1179,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1179
1179
  },
1180
1180
  value: $.noop,
1181
1181
  _value: function(val, _noNormalize, animate){
1182
- var left, posDif;
1182
+ var left, posDif, textValue;
1183
1183
  var o = this.options;
1184
1184
  var oVal = val;
1185
1185
  var thumbStyle = {};
@@ -1228,9 +1228,15 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1228
1228
  if(this.orig && (oVal != val || (!this._init && this.orig.value != val)) ){
1229
1229
  this.options._change(val);
1230
1230
  }
1231
+
1232
+ textValue = this.options.textValue ? this.options.textValue(this.options.value) : this.options.options[this.options.value] || this.options.value;
1231
1233
  this.element.attr({
1232
1234
  'aria-valuenow': this.options.value,
1233
- 'aria-valuetext': this.options.textValue ? this.options.textValue(this.options.value) : this.options.options[this.options.value] || this.options.value
1235
+ 'aria-valuetext': textValue
1236
+ });
1237
+ this.thumb.attr({
1238
+ 'data-value': this.options.value,
1239
+ 'data-valuetext': textValue
1234
1240
  });
1235
1241
  },
1236
1242
  initDataList: function(){
@@ -1274,13 +1280,19 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1274
1280
  $.each(o.options, function(val, label){
1275
1281
  if(!isNumber(val) || val < min || val > max){return;}
1276
1282
  var left = 100 * ((val - min) / (max - min));
1277
- var title = o.showLabels && label ? ' title="'+ label +'"' : '';
1283
+ var attr = '';
1284
+ if(label){
1285
+ attr += 'data-label="'+label+'"';
1286
+ if(o.showLabels){
1287
+ attr += ' title="'+label+'"';
1288
+ }
1289
+ }
1278
1290
  if(that.vertical){
1279
1291
  left = Math.abs(left - 100);
1280
1292
  }
1281
1293
 
1282
1294
  that.posCenter(
1283
- $('<span class="ws-range-ticks"'+ title +' data-label="'+label+'" style="'+(that.dirs.left)+': '+left+'%;" />').appendTo(trail)
1295
+ $('<span class="ws-range-ticks"'+ attr +' style="'+(that.dirs.left)+': '+left+'%;" />').appendTo(trail)
1284
1296
  );
1285
1297
  });
1286
1298
  },
@@ -1689,33 +1701,36 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1689
1701
  });
1690
1702
  };
1691
1703
  if(window.webshims && webshims.isReady){
1692
- webshims.ready('es5', function(){
1693
- webshims.isReady('range-ui', true);
1694
- });
1695
- if(webshims._polyfill){
1696
- webshims._polyfill(['es5']);
1697
- }
1704
+ webshims.isReady('range-ui', true);
1698
1705
  }
1699
- })(window.webshims ? webshims.$ : jQuery);
1700
- webshims.register('form-number-date-ui', function($, webshims, window, document, undefined, options){
1706
+ })(window.webshims ? webshims.$ : jQuery);;webshims.register('form-number-date-ui', function($, webshims, window, document, undefined, options){
1701
1707
  "use strict";
1702
1708
  var curCfg;
1703
1709
  var formcfg = webshims.formcfg;
1710
+ var hasFormValidation = Modernizr.formvalidation && !webshims.bugs.bustedValidity;
1704
1711
  var monthDigits = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'];
1705
1712
  var stopPropagation = function(e){
1706
1713
  e.stopImmediatePropagation();
1707
1714
  };
1708
- var getMonthOptions = (function(){
1709
- var str;
1710
- return function(){
1711
- if(!str){
1712
- str = ('<option value=""></option>')+$.map(monthDigits, function(val){
1713
- return '<option value="'+val+'"]>'+val+'</option>';
1714
- }).join('');
1715
- }
1716
- return str;
1717
- };
1718
- })();
1715
+ var getMonthOptions = function(opts){
1716
+ var selectName = 'monthSelect'+opts.formatMonthNames;
1717
+ if(!curCfg[selectName]){
1718
+ var labels = curCfg.date[opts.formatMonthNames] || monthDigits;
1719
+ curCfg[selectName] = ('<option value=""></option>')+$.map(monthDigits, function(val, i){
1720
+ return '<option value="'+val+'"]>'+labels[i]+'</option>';
1721
+ }).join('');
1722
+ }
1723
+ return curCfg[selectName];
1724
+ };
1725
+ var daySelect = '<select class="dd"><option value=""></option>'+ (function(){
1726
+ var i = 1;
1727
+ var opts = [];
1728
+ while(i < 32){
1729
+ opts.push('<option>'+ ((i < 10) ? '0'+ i : i) +'</option>' );
1730
+ i++;
1731
+ }
1732
+ return opts.join('');
1733
+ })() +'</select>';
1719
1734
  var createFormat = function(name){
1720
1735
  if(!curCfg.patterns[name+'Obj']){
1721
1736
  var obj = {};
@@ -1729,15 +1744,19 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1729
1744
  date: {
1730
1745
  _create: function(opts){
1731
1746
  var obj = {
1732
- splits: [$('<input type="text" class="yy" size="4" inputmode="numeric" />')[0]]
1747
+ splits: [$('<input type="text" class="yy" size="4" inputmode="numeric" maxlength="4" />')[0]]
1733
1748
  };
1749
+
1734
1750
  if(opts.monthSelect){
1735
1751
  obj.splits.push($('<select class="mm">'+getMonthOptions(opts)+'</select>')[0]);
1736
1752
  } else {
1737
1753
  obj.splits.push($('<input type="text" class="mm" inputmode="numeric" maxlength="2" size="2" />')[0]);
1738
1754
  }
1739
- obj.splits.push($('<input type="text" class="dd ws-spin" inputmode="numeric" maxlength="2" size="2" />')[0]);
1740
-
1755
+ if(opts.daySelect){
1756
+ obj.splits.push($(daySelect)[0]);
1757
+ } else {
1758
+ obj.splits.push($('<input type="text" class="dd ws-spin" inputmode="numeric" maxlength="2" size="2" />')[0]);
1759
+ }
1741
1760
 
1742
1761
  obj.elements = [obj.splits[0], $('<span class="ws-input-seperator" />')[0], obj.splits[1], $('<span class="ws-input-seperator" />')[0], obj.splits[2]];
1743
1762
  return obj;
@@ -1767,7 +1786,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1767
1786
  splits: [$('<input type="text" class="yy" inputmode="numeric" size="4" />')[0]]
1768
1787
  };
1769
1788
  if(opts.monthSelect){
1770
- obj.splits.push($('<select class="mm ws-spin">'+getMonthOptions(opts)+'</select>')[0]);
1789
+ obj.splits.push($('<select class="mm">'+getMonthOptions(opts)+'</select>')[0]);
1771
1790
  } else {
1772
1791
  obj.splits.push($('<input type="text" class="mm ws-spin" />')[0]);
1773
1792
  if(opts.onlyMonthDigits){
@@ -2171,18 +2190,30 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2171
2190
  },
2172
2191
  date: function(val, opts, noCorrect){
2173
2192
  createFormat('d');
2174
- var i;
2175
- var obj;
2193
+ var tmp, obj;
2194
+ var ret = '';
2176
2195
  if(opts.splitInput){
2177
2196
  obj = {yy: 0, mm: 1, dd: 2};
2178
2197
  } else {
2179
2198
  obj = curCfg.patterns.dObj;
2180
2199
  val = val.split(curCfg.dFormat);
2181
2200
  }
2182
-
2183
- return (val.length == 3 && val[0] && val[1] && val[2] && (!noCorrect || (val[obj.yy].length > 3 && val[obj.mm].length == 2 && val[obj.dd].length == 2))) ?
2184
- ([addZero(val[obj.yy]), addZero(val[obj.mm]), addZero(val[obj.dd])]).join('-') :
2185
- ''
2201
+ if(val.length == 3 && val[0] && val[1] && val[2] && (!noCorrect || (val[obj.yy].length > 3 && val[obj.mm].length == 2 && val[obj.dd].length == 2))){
2202
+ if(val[obj.mm] > 12 && val[obj.dd] < 13){
2203
+ tmp = val[obj.dd];
2204
+ val[obj.dd] = val[obj.mm];
2205
+ val[obj.mm] = tmp;
2206
+ }
2207
+ if(val[obj.yy].length < 4){
2208
+ tmp = ((new Date()).getFullYear() +'').substr(0, 4 - val[obj.yy].length);
2209
+ if(val[obj.yy] > 50){
2210
+ tmp--;
2211
+ }
2212
+ val[obj.yy] = tmp + val[obj.yy];
2213
+ }
2214
+ ret = ([addZero(val[obj.yy]), addZero(val[obj.mm]), addZero(val[obj.dd])]).join('-');
2215
+ }
2216
+ return ret
2186
2217
  ;
2187
2218
  },
2188
2219
  color: function(val, opts){
@@ -2282,7 +2313,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2282
2313
  this.buttonWrapper = $('<span class="input-buttons '+this.type+'-input-buttons"></span>').insertAfter(this.element);
2283
2314
  this.options.containerElements.push(this.buttonWrapper[0]);
2284
2315
 
2285
- o.mirrorValidity = o.mirrorValidity && this.orig && Modernizr.formvalidation && !webshims.bugs.bustedValidity;
2316
+ o.mirrorValidity = o.mirrorValidity && this.orig && hasFormValidation;
2286
2317
 
2287
2318
  if(o.splitInput && this._addSplitInputs){
2288
2319
  if(o.monthSelect){
@@ -2386,7 +2417,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2386
2417
 
2387
2418
  if(this.type != 'color'){
2388
2419
  (function(){
2389
- var localeChange ;
2420
+ var localeChange, select, selectVal;
2390
2421
  if(!o.splitInput){
2391
2422
  localeChange = function(){
2392
2423
 
@@ -2401,6 +2432,12 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2401
2432
  } else {
2402
2433
  localeChange = function(){
2403
2434
  that.reorderInputs();
2435
+ if(o.monthSelect){
2436
+ select = that.inputElements.filter('select.mm');
2437
+ selectVal = select.prop('value');
2438
+ select.html(getMonthOptions(o));
2439
+ select.prop('value', selectVal);
2440
+ }
2404
2441
  };
2405
2442
  that.reorderInputs();
2406
2443
  }
@@ -2434,7 +2471,11 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2434
2471
  }
2435
2472
  if(options.splitInput && typeof placeholder == 'object'){
2436
2473
  $.each(this.splits, function(i, elem){
2437
- $.prop(elem, 'placeholder', placeholder[i]);
2474
+ if($.nodeName(elem, 'select')){
2475
+ $(elem).children('option:first-child').text(placeholder[i]);
2476
+ } else {
2477
+ $.prop(elem, 'placeholder', placeholder[i]);
2478
+ }
2438
2479
  });
2439
2480
  } else {
2440
2481
  this.element.prop('placeholder', placeholder);
@@ -2518,14 +2559,9 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2518
2559
  }
2519
2560
 
2520
2561
 
2521
- if(!o.min && typeof o.relMin == 'number'){
2522
- o.min = this.asValue(this.getRelNumber(o.relMin));
2523
- $.prop(this.orig, 'min', o.min);
2524
- }
2525
2562
 
2526
- if(!o.max && typeof o.relMax == 'number'){
2527
- o.max = this.asValue(this.getRelNumber(o.relMax));
2528
- $.prop(this.orig, 'max', o.max);
2563
+ if((!o.max && typeof o.relMax == 'number') || (!o.min && typeof o.relMin == 'number')){
2564
+ webshims.error('relMax/relMin are not supported anymore')
2529
2565
  }
2530
2566
  this._init = true;
2531
2567
  },
@@ -2594,6 +2630,8 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2594
2630
  if(!this._init || force || this.options[name] !== val){
2595
2631
  if(isValue){
2596
2632
  this._beforeValue(val);
2633
+ } else {
2634
+ this.elemHelper.prop(name, val);
2597
2635
  }
2598
2636
 
2599
2637
  val = formatVal[this.type](val, this.options);
@@ -2644,9 +2682,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2644
2682
 
2645
2683
  $.fn.spinbtnUI = function(opts){
2646
2684
  opts = $.extend({
2647
- monthNames: 'monthNames',
2648
- size: 1,
2649
- startView: 0
2685
+ monthNames: 'monthNames'
2650
2686
  }, opts);
2651
2687
  return this.each(function(){
2652
2688
  $.webshims.objectCreate(spinBtnProto, {
@@ -2718,10 +2754,12 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2718
2754
 
2719
2755
 
2720
2756
  picker.commonInit = function(data, popover){
2757
+ if(data._commonInit){return;}
2758
+ data._commonInit = true;
2721
2759
  var tabbable;
2722
2760
 
2723
2761
  popover.isDirty = true;
2724
-
2762
+
2725
2763
  popover.element.on('updatepickercontent pickerchange', function(){
2726
2764
  tabbable = false;
2727
2765
  });
@@ -2761,6 +2799,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2761
2799
  return function(prop){
2762
2800
  if(prop == 'value' && !data.options.inlinePicker){return;}
2763
2801
  popover.isDirty = true;
2802
+
2764
2803
  if(popover.isVisible){
2765
2804
  clearTimeout(timer);
2766
2805
  timer = setTimeout(update, 9);
@@ -2828,30 +2867,6 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2828
2867
 
2829
2868
  options.containerElements.push(popover.element[0]);
2830
2869
 
2831
- if(data.type != 'color'){
2832
- if(options.yearButtons){
2833
- options.startView = 2;
2834
- }
2835
- if(!options.startView){
2836
- options.startView = 0;
2837
- }
2838
-
2839
- if(data.type == 'time'){
2840
- options.minView = 3;
2841
- options.startView = 3;
2842
- }
2843
- if(!options.minView){
2844
- options.minView = 0;
2845
- }
2846
- if(options.startView < options.minView){
2847
- options.startView = options.minView;
2848
- webshims.warn("wrong config for minView/startView.");
2849
- }
2850
- if(!options.size){
2851
- options.size = 1;
2852
- }
2853
- }
2854
-
2855
2870
  popover.element
2856
2871
  .addClass(data.type+'-popover input-picker')
2857
2872
  .attr({role: 'application'})
@@ -2912,12 +2927,12 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2912
2927
  };
2913
2928
  data.inputElements.on({
2914
2929
  keydown: function(e){
2915
- if(e.keyCode == 40 && e.altKey){
2930
+ if(e.keyCode == 40 && e.altKey && !$.nodeName(e.target, 'select')){
2916
2931
  open();
2917
2932
  }
2918
2933
  },
2919
- focus: function(){
2920
- if(!popover.stopOpen && (options.buttonOnly || options.openOnFocus || (mouseFocus && options.openOnMouseFocus))){
2934
+ focus: function(e){
2935
+ if(!popover.stopOpen && (options.buttonOnly || options.openOnFocus || (mouseFocus && options.openOnMouseFocus)) && !$.nodeName(e.target, 'select')){
2921
2936
  popover.openedByFocus = options.buttonOnly ? false : !options.noInput;
2922
2937
  show();
2923
2938
  } else {
@@ -2934,7 +2949,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2934
2949
  popover.activeElement.focus();
2935
2950
  }, 4);
2936
2951
  }
2937
- if(data.element.is(':focus')){
2952
+ if(data.element.is(':focus') && !$.nodeName(e.target, 'select')){
2938
2953
  popover.openedByFocus = options.buttonOnly ? false : !options.noInput;
2939
2954
  show();
2940
2955
  }
@@ -3162,10 +3177,8 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3162
3177
  opts[optsName] = $.attr(this, copyAttrs[i]) || opts[optsName];
3163
3178
  }
3164
3179
  }
3165
- if(opts.monthSelect){
3166
- opts.onlyMonthDigits = true;
3167
- }
3168
- if(opts.onlyMonthDigits){
3180
+
3181
+ if(opts.onlyMonthDigits || (!opts.formatMonthNames && opts.monthSelect)){
3169
3182
  opts.formatMonthNames = 'monthDigits';
3170
3183
  }
3171
3184
  data.shim = inputTypes[type]._create(opts);
@@ -3215,11 +3228,11 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3215
3228
 
3216
3229
  data.shim.element.on('change input', stopPropagation);
3217
3230
 
3218
- if(Modernizr.formvalidation){
3231
+ if(hasFormValidation){
3219
3232
  $(opts.orig).on('firstinvalid', function(e){
3220
3233
  if(!webshims.fromSubmit && isCheckValidity){return;}
3221
3234
  $(opts.orig).off('invalid.replacedwidgetbubble').on('invalid.replacedwidgetbubble', function(evt){
3222
- if(!e.isInvalidUIPrevented() && !evt.isDefaultPrevented()){
3235
+ if(!evt.isDefaultPrevented()){
3223
3236
  webshims.validityAlert.showFor( e.target );
3224
3237
  e.preventDefault();
3225
3238
  evt.preventDefault();
@@ -3246,7 +3259,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3246
3259
  };
3247
3260
 
3248
3261
 
3249
- if(Modernizr.formvalidation){
3262
+ if(hasFormValidation){
3250
3263
  ['input', 'form'].forEach(function(name){
3251
3264
  var desc = webshims.defineNodeNameProperty(name, 'checkValidity', {
3252
3265
  prop: {
@@ -3297,7 +3310,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3297
3310
  if(!modernizrInputTypes[name] || replace[name]){
3298
3311
  extendType(name, {
3299
3312
  _create: function(opts, set){
3300
- if(opts.monthSelect){
3313
+ if(opts.monthSelect || opts.daySelect){
3301
3314
  opts.splitInput = true;
3302
3315
  }
3303
3316
  if(opts.splitInput && !splitInputs[name]){