aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2018-08-10 11:59:44 +0200
committerMitja Felicijan <mitja.felicijan@gmail.com>2018-08-10 11:59:44 +0200
commitb6cc77cbaf8558d837761b8e795d79b8703d47b4 (patch)
treecbfd0a996ae8cda44d9a6e9983efedc44a13b849 /tools
parent3e570fc7d99bc882c196ead8dccc8193f28150ff (diff)
downloadmitjafelicijan.com-b6cc77cbaf8558d837761b8e795d79b8703d47b4.tar.gz
content update
Diffstat (limited to 'tools')
-rw-r--r--tools/editor/index.html97
1 files changed, 51 insertions, 46 deletions
diff --git a/tools/editor/index.html b/tools/editor/index.html
index 25254b7..1fc44e1 100644
--- a/tools/editor/index.html
+++ b/tools/editor/index.html
@@ -1,49 +1,54 @@
1<!DOCTYPE html> 1<!DOCTYPE html>
2<html lang="en"> 2<html lang="en">
3<head> 3
4 4 <head>
5 <meta charset="UTF-8"> 5
6 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 6 <meta charset="UTF-8">
7 <meta http-equiv="X-UA-Compatible" content="ie=edge"> 7 <meta name="viewport" content="width=device-width, initial-scale=1.0">
8 8 <meta http-equiv="X-UA-Compatible" content="ie=edge">
9 <title>Editor</title> 9
10 10 <title>Editor</title>
11 <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> 11
12 <link rel="icon" href="favicon.ico" type="image/x-icon"> 12 <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
13 13 <link rel="icon" href="favicon.ico" type="image/x-icon">
14</head> 14
15<body> 15 </head>
16 16
17 <style> 17 <body>
18 textarea { 18
19 display: block; 19 <style>
20 position: fixed; 20 textarea {
21 left: 0; 21 display: block;
22 top: 0; 22 position: fixed;
23 right: 0; 23 left: 0;
24 bottom: 0; 24 top: 0;
25 width: 100%; 25 right: 0;
26 height: 100%; 26 bottom: 0;
27 padding: 20px; 27 width: 100%;
28 font: 16px monospace; 28 height: 100%;
29 outline: none; 29 padding: 20px;
30 border: 0; 30 font: 16px monospace;
31 background: #333; 31 outline: none;
32 color: #fff; 32 border: 0;
33 } 33 background: #333;
34 </style> 34 color: #fff;
35 <textarea></textarea> 35 }
36 <script> 36 </style>
37 if (typeof(Storage) !== 'undefined') { 37
38 const autoSaveFrequency = 1000; 38 <textarea></textarea>
39 const editor = document.querySelector('textarea'); 39
40 editor.value = localStorage.getItem('content'); 40 <script>
41 setInterval(function() { 41 if (typeof(Storage) !== 'undefined') {
42 localStorage.setItem('content', editor.value); 42 const autoSaveFrequency = 1000;
43 }, autoSaveFrequency); 43 const editor = document.querySelector('textarea');
44 } else { 44 editor.value = localStorage.getItem('content');
45 console.log('storage nok'); 45 setInterval(function() {
46 } 46 localStorage.setItem('content', editor.value);
47 </script> 47 }, autoSaveFrequency);
48</body> 48 } else {
49 console.log('storage nok');
50 }
51 </script>
52
53 </body>
49</html> 54</html>