aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/editor.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'src/editor.mjs')
-rw-r--r--src/editor.mjs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/editor.mjs b/src/editor.mjs
index 71e66be..02df642 100644
--- a/src/editor.mjs
+++ b/src/editor.mjs
@@ -4,7 +4,6 @@ import { markdown2HTML, generateMaps } from './dumbymap'
4import { defaultAliases, parseConfigsFromYaml } from 'mapclay' 4import { defaultAliases, parseConfigsFromYaml } from 'mapclay'
5import * as menuItem from './MenuItem' 5import * as menuItem from './MenuItem'
6import { shiftByWindow } from './utils.mjs' 6import { shiftByWindow } from './utils.mjs'
7import { Item } from './MenuItem.mjs'
8 7
9// Set up Containers {{{ 8// Set up Containers {{{
10 9
@@ -407,7 +406,7 @@ const completeForCodeBlock = change => {
407 */ 406 */
408const menuForEditor = (event, menu) => { 407const menuForEditor = (event, menu) => {
409 if (context.dataset.mode !== 'editing') { 408 if (context.dataset.mode !== 'editing') {
410 const switchToEditingMode = new Item({ 409 const switchToEditingMode = new menuItem.Item({
411 innerHTML: '<strong>EDIT</strong>', 410 innerHTML: '<strong>EDIT</strong>',
412 onclick: () => context.dataset.mode = 'editing' 411 onclick: () => context.dataset.mode = 'editing'
413 }) 412 })
@@ -416,7 +415,7 @@ const menuForEditor = (event, menu) => {
416 415
417 const map = dumbyContainer.querySelector('#' + menu.dataset.map) 416 const map = dumbyContainer.querySelector('#' + menu.dataset.map)
418 if (map) { 417 if (map) {
419 const item = new Item({ 418 const item = new menuItem.Item({
420 text: 'Add Anchor for GeoLinks', 419 text: 'Add Anchor for GeoLinks',
421 onclick: () => { 420 onclick: () => {
422 const rect = map.getBoundingClientRect() 421 const rect = map.getBoundingClientRect()
@@ -432,7 +431,7 @@ const menuForEditor = (event, menu) => {
432 anchorName = window.prompt(prompt, `${x}, ${y}`) 431 anchorName = window.prompt(prompt, `${x}, ${y}`)
433 link = `geo:${y},${x}?xy=${x},${y}&id=${map.id} "${anchorName}"` 432 link = `geo:${y},${x}?xy=${x},${y}&id=${map.id} "${anchorName}"`
434 } 433 }
435 while (refLinks.find(({ref}) => ref === anchorName)) 434 while (refLinks.find(({ ref }) => ref === anchorName))
436 435
437 const lastLineIsRefLink = cm.getLine(cm.lastLine()).match(refLinkPattern) 436 const lastLineIsRefLink = cm.getLine(cm.lastLine()).match(refLinkPattern)
438 cm.replaceRange( 437 cm.replaceRange(