From d1dcafa87ed1621e3fc2b264818a2966b40231ae Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Mon, 7 Oct 2024 16:12:11 +0800 Subject: style: code reformat --- src/css/dumbymap.css | 2 +- src/editor.mjs | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/css/dumbymap.css b/src/css/dumbymap.css index 7a4d3e7..d9a7791 100644 --- a/src/css/dumbymap.css +++ b/src/css/dumbymap.css @@ -54,8 +54,8 @@ a[href^='http']:not(:has(img))::after, display: inline-block; width: 8px; height: 8px; - margin-left: 2px; margin-right: 4px; + margin-left: 2px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5z'/%3E%3Cpath fill-rule='evenodd' d='M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0v-5z'/%3E%3C/svg%3E"); background-position: center; 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' import { defaultAliases, parseConfigsFromYaml } from 'mapclay' import * as menuItem from './MenuItem' import { shiftByWindow } from './utils.mjs' -import { Item } from './MenuItem.mjs' // Set up Containers {{{ @@ -407,7 +406,7 @@ const completeForCodeBlock = change => { */ const menuForEditor = (event, menu) => { if (context.dataset.mode !== 'editing') { - const switchToEditingMode = new Item({ + const switchToEditingMode = new menuItem.Item({ innerHTML: 'EDIT', onclick: () => context.dataset.mode = 'editing' }) @@ -416,7 +415,7 @@ const menuForEditor = (event, menu) => { const map = dumbyContainer.querySelector('#' + menu.dataset.map) if (map) { - const item = new Item({ + const item = new menuItem.Item({ text: 'Add Anchor for GeoLinks', onclick: () => { const rect = map.getBoundingClientRect() @@ -432,7 +431,7 @@ const menuForEditor = (event, menu) => { anchorName = window.prompt(prompt, `${x}, ${y}`) link = `geo:${y},${x}?xy=${x},${y}&id=${map.id} "${anchorName}"` } - while (refLinks.find(({ref}) => ref === anchorName)) + while (refLinks.find(({ ref }) => ref === anchorName)) const lastLineIsRefLink = cm.getLine(cm.lastLine()).match(refLinkPattern) cm.replaceRange( -- cgit v1.2.3-70-g09d2