-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtextarea.html
108 lines (101 loc) · 2.45 KB
/
textarea.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>memo html</title>
<style>
* {
margin: 0;
padding: 0;
}
html, body {
display: block;
height: 100%;
background: #002233;
overflow: hidden;
}
body {
}
.wrapper {
height: calc(100% - 80px);
width: 600px;
margin: 0 auto;
overflow: hidden;
}
.wrapper::scrollbar {
display: none;
}
textarea {
display: block;
height: calc(100%);
margin: 0 auto;
padding: 20px;
width: calc(100% - 40px);
font-size: 14px;
font-family: "CodeM";
background-color: #002233;
color: white;
resize: none;
border: none;
line-height: 1.65;
}
textarea:focus {
outline: 0;
}
div.menu {
height: 40px;
line-height: 40px;
font-size: 10px;
color: white;
background-color: #000000;
padding-left: 20px;
text-align: center;
}
div.menu a {
color: white;
}
</style>
</head>
<body>
<div class='menu'>
<a href="http://denari.link/textarea.html?key=nippou">nippou</a> /
<a href="http://denari.link/textarea.html?key=memo1">memo1</a> /
<a href="http://denari.link/textarea.html?key=memo2">memo2</a> /
<a href="http://denari.link/textarea.html?key=memo3">memo3</a>
</div>
<div class="wrapper">
<textarea name="memo" cols="80"></textarea>
</div>
<script>
function GetQueryString() {
if (1 < document.location.search.length) {
// 最初の1文字 (?記号) を除いた文字列を取得する
var query = document.location.search.substring(1);
// クエリの区切り記号 (&) で文字列を配列に分割する
var parameters = query.split('&');
var result = new Object();
for (var i = 0; i < parameters.length; i++) {
// パラメータ名とパラメータ値に分割する
var element = parameters[i].split('=');
var paramName = decodeURIComponent(element[0]);
var paramValue = decodeURIComponent(element[1]);
// パラメータ名をキーとして連想配列に追加する
result[paramName] = decodeURIComponent(paramValue);
}
return result;
}
return null;
}
param = GetQueryString();
key = param !== null && param["key"] !== undefined ? param["key"] : "default";
getValue = function() {
return String( localStorage[key] !== undefined ? localStorage[key] : "" );
}
setValue = function() {
localStorage[key] = document.getElementsByName('memo')[0].value ;
}
document.getElementsByName('memo')[0].value = getValue()
setInterval(setValue,1000);
</script>
</body>
</html>