diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/editor.mjs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/editor.mjs b/src/editor.mjs index 2893f94..27744db 100644 --- a/src/editor.mjs +++ b/src/editor.mjs | |||
| @@ -67,16 +67,25 @@ const editor = new EasyMDE({ | |||
| 67 | action: () => addMapRandomlyByPreset() | 67 | action: () => addMapRandomlyByPreset() |
| 68 | }, | 68 | }, |
| 69 | { | 69 | { |
| 70 | name: 'debug', | 70 | name: 'export', |
| 71 | title: 'Save content as URL', | 71 | title: 'Export current page', |
| 72 | text: '\u{1F4BE}', | 72 | text: '\u{1F4BE}', |
| 73 | action: () => { | 73 | action: () => { |
| 74 | } | ||
| 75 | }, | ||
| 76 | { | ||
| 77 | name: 'hash', | ||
| 78 | title: 'Save content as URL', | ||
| 79 | // text: '\u{1F4BE}', | ||
| 80 | text: '#', | ||
| 81 | action: () => { | ||
| 74 | const state = { content: editor.value() } | 82 | const state = { content: editor.value() } |
| 75 | window.location.hash = encodeURIComponent(JSON.stringify(state)) | 83 | window.location.hash = encodeURIComponent(JSON.stringify(state)) |
| 76 | navigator.clipboard.writeText(window.location.href) | 84 | navigator.clipboard.writeText(window.location.href) |
| 77 | window.alert('URL copied to clipboard') | 85 | window.alert('URL updated in address bar, you can save current page as bookmark') |
| 78 | } | 86 | } |
| 79 | }, | 87 | }, |
| 88 | '|', | ||
| 80 | { | 89 | { |
| 81 | name: 'undo', | 90 | name: 'undo', |
| 82 | title: 'Undo last editing', | 91 | title: 'Undo last editing', |