diff options
Diffstat (limited to 'tools/editor')
| -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> |
