aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/dumbyUtils.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'src/dumbyUtils.mjs')
-rw-r--r--src/dumbyUtils.mjs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/dumbyUtils.mjs b/src/dumbyUtils.mjs
index 214e44f..42a51bc 100644
--- a/src/dumbyUtils.mjs
+++ b/src/dumbyUtils.mjs
@@ -385,7 +385,7 @@ export const dragForAnchor = (container, range, endOfLeaderLine) => {
385 container.classList.add('dragging-geolink') 385 container.classList.add('dragging-geolink')
386 const geoLink = document.createElement('a') 386 const geoLink = document.createElement('a')
387 geoLink.textContent = range.toString() 387 geoLink.textContent = range.toString()
388 geoLink.classList.add('with-leader-line', 'geolink', 'drag') 388 geoLink.classList.add('with-leader-line', 'geolink', 'drag', 'from-text')
389 389
390 // Replace current content with link 390 // Replace current content with link
391 const originContent = range.cloneContents() 391 const originContent = range.cloneContents()
@@ -439,6 +439,11 @@ export const dragForAnchor = (container, range, endOfLeaderLine) => {
439 } 439 }
440} 440}
441 441
442/**
443 * addGeoSchemeByText.
444 *
445 * @param {Node} node
446 */
442export const addGeoSchemeByText = async (node) => { 447export const addGeoSchemeByText = async (node) => {
443 const digit = '[\\d\\uFF10-\\uFF19]' 448 const digit = '[\\d\\uFF10-\\uFF19]'
444 const decimal = '[.\\uFF0E]' 449 const decimal = '[.\\uFF0E]'
@@ -451,7 +456,7 @@ export const addGeoSchemeByText = async (node) => {
451 if (Date.parse(match.at(0) + ' 1990')) return null 456 if (Date.parse(match.at(0) + ' 1990')) return null
452 457
453 const a = document.createElement('a') 458 const a = document.createElement('a')
454 a.className = 'not-geolink' 459 a.className = 'not-geolink from-text'
455 a.href = `geo:0,0?xy=${x},${y}` 460 a.href = `geo:0,0?xy=${x},${y}`
456 a.textContent = match.at(0) 461 a.textContent = match.at(0)
457 return a 462 return a