-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNotepad.html
163 lines (144 loc) · 4.56 KB
/
Notepad.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE html>
<html dir='ltr' lang='en'>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TupCode| Online Notepad </title>
<link href="https://notepad.code.pro.vn/favicon.ico" rel='icon' type='image/x-icon'>
<meta content="@wisdak_dart" name="twitter:site">
<meta content="@wisdak_dart" name="twitter:creator">
<meta content="Wisdak" name="author">
<meta content="Tup Code" name="copyright">
<meta content="Tup Code - Online Notepad is a fast, clean and easy-to-use notepad online!" name="description">
<meta content="Tup Code, Tup Code online notepad, online notepad, notepad online, notepad++, ..." name="keywords">
<meta content="Tup Code - Online Notepad" property="og:image:alt">
<meta content="https://notepad.code.pro.vn/thumbnail.jpg" property="og:image">
<!--<link rel="stylesheet" href="https://notepad.code.pro.vn/styles.css">-->
<style> @import url('https://cdn.jsdelivr.net/npm/segoe-fonts@1.0.1/segoe-fonts.min.css');
body {
margin: 0;
background: #ebeef1;
font-family: 'Segoe UI', sans-serif;
}
.container {
position: absolute;
top: 20px;
right: 20px;
bottom: 20px;
left: 20px;
}
#content {
font-family: inherit;
font-size: 20px;
color: #0E1830;
margin: 0;
padding: 20px;
overflow-y: auto;
resize: none;
width: 100%;
height: 100%;
min-height: 100%;
box-sizing: border-box;
border: 1px #ddd solid;
border-radius: 20px;
outline: none;
}
#printable {
display: none;
}
@media (prefers-color-scheme: dark) {
body {
background: #383934;
}
#content {
background: #282923;
color: #f8f8f2;
border: 0;
}
}
@media print {
.container {
display: none;
}
#printable {
display: block;
white-space: pre-wrap;
word-break: break-word;
}
}</style>
<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4205451578583274" crossorigin="anonymous"></script>
<!--<script async src="https://www.googletagmanager.com/gtag/js?id=G-DH75BTEKZP"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-DH75BTEKZP');
</script>-->
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4205451578583274"
crossorigin="anonymous"></script>
<!-- mashbyte_main -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-4205451578583274"
data-ad-slot="9939781657"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</head>
<body>
<div class="container">
<textarea id="content"></textarea>
</div>
<pre id="printable"></pre>
<!--<script src="https://notepad.code.pro.vn/script.js"></script>-->
<script> function uploadContent() {
// If textarea value changes.
if (content !== textarea.value) {
var temp = textarea.value;
var request = new XMLHttpRequest();
request.open("POST", window.location.href, true);
request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
request.onload = function () {
if (request.readyState === 4) {
// Request has ended, check again after 1 second.
content = temp;
setTimeout(uploadContent, 1000);
}
};
request.onerror = function () {
// Try again after 1 second.
setTimeout(uploadContent, 1000);
};
request.send("text=" + encodeURIComponent(temp));
// Make the content available to print.
printable.removeChild(printable.firstChild);
printable.appendChild(document.createTextNode(temp));
} else {
// Content has not changed, check again after 1 second.
setTimeout(uploadContent, 1000);
}
}
var textarea = document.getElementById("content");
var printable = document.getElementById("printable");
var content = textarea.value;
// Make the content available to print.
printable.appendChild(document.createTextNode(content));
textarea.focus();
uploadContent();
</script>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4205451578583274"
crossorigin="anonymous"></script>
<!-- mashbyte_main -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-4205451578583274"
data-ad-slot="9939781657"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</body>
</html>