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.
- checksums.yaml +4 -4
- data/lib/webshims-rails/version.rb +2 -2
- data/vendor/assets/javascripts/webshims/polyfiller.js +126 -72
- data/vendor/assets/javascripts/webshims/shims/FlashCanvas/canvas2png.js +9 -4
- data/vendor/assets/javascripts/webshims/shims/FlashCanvas/flashcanvas.js +32 -26
- data/vendor/assets/javascripts/webshims/shims/FlashCanvas/flashcanvas.swf +0 -0
- data/vendor/assets/javascripts/webshims/shims/FlashCanvas/proxy.php +25 -4
- data/vendor/assets/javascripts/webshims/shims/FlashCanvas/save.php +9 -3
- data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/canvas2png.js +9 -4
- data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/flash10canvas.swf +0 -0
- data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/flash9canvas.swf +0 -0
- data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/flashcanvas.js +36 -30
- data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/proxy.php +25 -4
- data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/save.php +9 -3
- data/vendor/assets/javascripts/webshims/shims/combos/1.js +13 -6
- data/vendor/assets/javascripts/webshims/shims/combos/10.js +156 -143
- data/vendor/assets/javascripts/webshims/shims/combos/11.js +97 -84
- data/vendor/assets/javascripts/webshims/shims/combos/12.js +2 -4
- data/vendor/assets/javascripts/webshims/shims/combos/13.js +1 -2
- data/vendor/assets/javascripts/webshims/shims/combos/14.js +956 -2819
- data/vendor/assets/javascripts/webshims/shims/combos/15.js +73 -67
- data/vendor/assets/javascripts/webshims/shims/combos/16.js +75 -71
- data/vendor/assets/javascripts/webshims/shims/combos/17.js +118 -89
- data/vendor/assets/javascripts/webshims/shims/combos/18.js +119 -91
- data/vendor/assets/javascripts/webshims/shims/combos/19.js +62 -65
- data/vendor/assets/javascripts/webshims/shims/combos/2.js +73 -67
- data/vendor/assets/javascripts/webshims/shims/combos/20.js +61 -63
- data/vendor/assets/javascripts/webshims/shims/combos/21.js +3 -6
- data/vendor/assets/javascripts/webshims/shims/combos/22.js +1 -2
- data/vendor/assets/javascripts/webshims/shims/combos/23.js +1 -2
- data/vendor/assets/javascripts/webshims/shims/combos/24.js +22 -12
- data/vendor/assets/javascripts/webshims/shims/combos/25.js +63 -67
- data/vendor/assets/javascripts/webshims/shims/combos/26.js +59 -59
- data/vendor/assets/javascripts/webshims/shims/combos/27.js +1 -2
- data/vendor/assets/javascripts/webshims/shims/combos/28.js +1915 -0
- data/vendor/assets/javascripts/webshims/shims/combos/29.js +817 -0
- data/vendor/assets/javascripts/webshims/shims/combos/3.js +71 -63
- data/vendor/assets/javascripts/webshims/shims/combos/30.js +72 -65
- data/vendor/assets/javascripts/webshims/shims/combos/31.js +71 -63
- data/vendor/assets/javascripts/webshims/shims/combos/32.js +2343 -0
- data/vendor/assets/javascripts/webshims/shims/combos/33.js +897 -0
- data/vendor/assets/javascripts/webshims/shims/combos/4.js +59 -59
- data/vendor/assets/javascripts/webshims/shims/combos/5.js +119 -91
- data/vendor/assets/javascripts/webshims/shims/combos/6.js +120 -93
- data/vendor/assets/javascripts/webshims/shims/combos/7.js +74 -69
- data/vendor/assets/javascripts/webshims/shims/combos/8.js +73 -67
- data/vendor/assets/javascripts/webshims/shims/combos/9.js +157 -145
- data/vendor/assets/javascripts/webshims/shims/dom-extend.js +58 -57
- data/vendor/assets/javascripts/webshims/shims/form-combat.js +0 -1
- data/vendor/assets/javascripts/webshims/shims/form-core.js +12 -3
- data/vendor/assets/javascripts/webshims/shims/form-datalist-lazy.js +4 -3
- data/vendor/assets/javascripts/webshims/shims/form-number-date-api.js +20 -3
- data/vendor/assets/javascripts/webshims/shims/form-number-date-ui.js +78 -71
- data/vendor/assets/javascripts/webshims/shims/form-shim-extend2.js +21 -10
- data/vendor/assets/javascripts/webshims/shims/form-validation.js +39 -27
- data/vendor/assets/javascripts/webshims/shims/forms-picker.js +173 -128
- data/vendor/assets/javascripts/webshims/shims/i18n/{formcfg-ch-ZN.js → formcfg-ch-CN.js} +0 -0
- data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-en.js +0 -2
- data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-zh-CN.js +65 -0
- data/vendor/assets/javascripts/webshims/shims/plugins/jquery.ui.position.js +1 -1
- data/vendor/assets/javascripts/webshims/shims/range-ui.js +18 -11
- data/vendor/assets/javascripts/webshims/shims/styles/forms-ext.css +221 -153
- data/vendor/assets/javascripts/webshims/shims/styles/progress.gif +0 -0
- data/vendor/assets/javascripts/webshims/shims/styles/progress.png +0 -0
- data/vendor/assets/javascripts/webshims/shims/styles/scss/_extends.scss +5 -0
- data/vendor/assets/javascripts/webshims/shims/styles/scss/forms-ext.scss +273 -177
- data/vendor/assets/javascripts/webshims/shims/styles/scss/shim.scss +113 -98
- data/vendor/assets/javascripts/webshims/shims/styles/shim.css +114 -88
- data/vendor/assets/javascripts/webshims/shims/track-ui.js +2 -2
- metadata +10 -7
- data/vendor/assets/javascripts/webshims/extras/mousepress.js +0 -60
- data/vendor/assets/javascripts/webshims/shims/jpicker/images/Thumbs.db +0 -0
- data/vendor/assets/javascripts/webshims/shims/json-storage.js +0 -316
- data/vendor/assets/javascripts/webshims/shims/mediagroup.js +0 -29
Binary file
|
@@ -5,7 +5,7 @@
|
|
5
5
|
*
|
6
6
|
* PHP versions 4 and 5
|
7
7
|
*
|
8
|
-
* Copyright (c) 2010-
|
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-
|
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
|
-
//
|
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 (
|
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-
|
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-
|
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="
|
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-
|
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",
|
32
|
+
form.setAttribute("action", action);
|
28
33
|
form.setAttribute("method", "post");
|
29
34
|
|
30
35
|
input.setAttribute("type", "hidden");
|
Binary file
|
Binary file
|
@@ -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-
|
10
|
+
* Copyright (c) 2009-2013 Shinya Muramatsu
|
6
11
|
*/
|
7
|
-
window.
|
8
|
-
|
9
|
-
|
10
|
-
});
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
a
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
a,
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
this.
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
a.
|
31
|
-
var
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
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,"&").replace(/</g,
|
31
|
+
"<");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-
|
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-
|
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
|
-
//
|
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 (
|
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-
|
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-
|
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="
|
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('
|
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
|
-
|
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
|
-
|
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(
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
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
|
-
|
619
|
-
|
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
|
-
|
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
|
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':
|
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
|
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"'+
|
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.
|
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 =
|
1709
|
-
var
|
1710
|
-
|
1711
|
-
|
1712
|
-
|
1713
|
-
|
1714
|
-
|
1715
|
-
|
1716
|
-
|
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
|
-
|
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
|
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
|
2175
|
-
var
|
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
|
-
|
2184
|
-
|
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 &&
|
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
|
-
$.
|
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
|
-
|
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
|
-
|
3166
|
-
|
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(
|
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(!
|
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(
|
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]){
|