回答編集履歴
4
調整
answer
CHANGED
@@ -9,7 +9,9 @@
|
|
9
9
|
$("img").remove();
|
10
10
|
});
|
11
11
|
$("#download-image").click(function() {
|
12
|
+
var a=$('<a>');
|
12
|
-
|
13
|
+
a.attr({'href':$("#canvas").jSignature("getData"),download:"test.png"}).appendTo($('body')).end().get(0).click();
|
14
|
+
a.remove();
|
13
15
|
});
|
14
16
|
});
|
15
17
|
</script>
|
3
chouseo
answer
CHANGED
@@ -1,1 +1,21 @@
|
|
1
|
-
|
1
|
+
```javascript
|
2
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
3
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jSignature/2.1.3/jSignature.min.js"></script>
|
4
|
+
<script>
|
5
|
+
$(function(){
|
6
|
+
$("#canvas").jSignature();
|
7
|
+
$("#clear").click(function() {
|
8
|
+
$("#canvas").jSignature("reset");
|
9
|
+
$("img").remove();
|
10
|
+
});
|
11
|
+
$("#download-image").click(function() {
|
12
|
+
$('<a>').attr({'href':$("#canvas").jSignature("getData"),download:"test.png"}).appendTo($('body')).end().get(0).click();
|
13
|
+
});
|
14
|
+
});
|
15
|
+
</script>
|
16
|
+
<div id="canvas" style="background-color:#ffffee;"></div>
|
17
|
+
<button id="clear">クリア</button>
|
18
|
+
<button id="download-image">画像ダウンロード</button>
|
19
|
+
<div id="someelement"></div>
|
20
|
+
|
21
|
+
```
|
2
調整
answer
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
|
1
|
+
回答場所を間違えました
|
1
修正
answer
CHANGED
@@ -1,18 +1,1 @@
|
|
1
|
-
```PHP
|
2
|
-
function unicode_decode($str) {
|
3
|
-
return preg_replace_callback("/((?:[^\x09\x0A\x0D\x20-\x7E]{3})+)/",function ($matches) {
|
4
|
-
$char = mb_convert_encoding($matches[1], "UTF-16", "UTF-8");
|
5
|
-
$escaped = "";
|
6
|
-
for ($i = 0, $l = strlen($char); $i < $l; $i += 2) {
|
7
|
-
$escaped .= "\u" . sprintf("%02x%02x", ord($char[$i]), ord($char[$i+1]));
|
8
|
-
}
|
9
|
-
|
1
|
+
すみません、回答場所を間違えました
|
10
|
-
},$str);
|
11
|
-
}
|
12
|
-
$str = "αβγδεζηθικλμνξοπρστυφχψω";
|
13
|
-
$decoded = unicode_decode($str);
|
14
|
-
echo "$decoded\n";
|
15
|
-
|
16
|
-
// \u03b1\u03b2\u03b3\u03b4\u03b5\u03b6\u03b7\u03b8\u03b9\u03ba\u03bb\u03bc\u03bd\u03be\u03bf\u03c0\u03c1\u03c3\u03c4\u03c5\u03c6\u03c7\u03c8\u03c9
|
17
|
-
|
18
|
-
```
|