forked from a8a9a16/whiteboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
42 lines (35 loc) · 1.31 KB
/
index.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
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/paper.min.css">
<link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
<title>Small note</title>
</head>
<body>
<!-- This is a comment -->
<h1>Small note</h1>
<textarea id="note" contenteditable></textarea>
<script src="https://unpkg.com/filer/dist/filer.min.js"></script>
<script>
const fs = new Filer.FileSystem();
//step 5 for acturally coding...
window.addEventListener("DOMContentLoaded", (event) => {
fs.readFile("/note", 'utf8', function (err, data) {
if (err) {
document.querySelector('#note').innerHTML = "Just type, it will save automatically"
}
if (data) {
document.querySelector('#note').innerHTML = data;
}
});
});
window.setInterval(myCallback, 3000);
function myCallback() {
fs.writeFile('/note', document.querySelector('#note').innerHTML);
}
</script>
</body>
</html>