diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2018-08-10 11:56:28 +0200 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2018-08-10 11:56:28 +0200 |
| commit | 149285b54d1a4abac5d518f0a9ebd8874135613a (patch) | |
| tree | 8b99deb7b8c4311623ac57514f0e65d5b4aa5033 /tools/editor/index.html | |
| parent | 207450dd0abd15cc344117efe5c240e9d5e0209e (diff) | |
| download | mitjafelicijan.com-149285b54d1a4abac5d518f0a9ebd8874135613a.tar.gz | |
content update
Diffstat (limited to 'tools/editor/index.html')
| -rw-r--r-- | tools/editor/index.html | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tools/editor/index.html b/tools/editor/index.html index dbe8f64..571082f 100644 --- a/tools/editor/index.html +++ b/tools/editor/index.html | |||
| @@ -26,7 +26,18 @@ | |||
| 26 | color: #fff; | 26 | color: #fff; |
| 27 | } | 27 | } |
| 28 | </style> | 28 | </style> |
| 29 | <textarea>...</textarea> | 29 | <textarea></textarea> |
| 30 | 30 | <script> | |
| 31 | if (typeof(Storage) !== 'undefined') { | ||
| 32 | const autoSaveFrequency = 1000; | ||
| 33 | const editor = document.querySelector('textarea'); | ||
| 34 | editor.value = localStorage.getItem('content'); | ||
| 35 | setInterval(function() { | ||
| 36 | localStorage.setItem('content', editor.value); | ||
| 37 | }, autoSaveFrequency); | ||
| 38 | } else { | ||
| 39 | console.log('storage nok'); | ||
| 40 | } | ||
| 41 | </script> | ||
| 31 | </body> | 42 | </body> |
| 32 | </html> | 43 | </html> |
