diff options
Diffstat (limited to 'src/MenuItem.mjs')
-rw-r--r-- | src/MenuItem.mjs | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/MenuItem.mjs b/src/MenuItem.mjs index 2f9aff4..734c313 100644 --- a/src/MenuItem.mjs +++ b/src/MenuItem.mjs | |||
@@ -1,8 +1,8 @@ | |||
1 | import { createGeoLink } from "./dumbymap"; | 1 | import { createGeoLink } from './dumbymap'; |
2 | 2 | ||
3 | export function nextMap() { | 3 | export function nextMap() { |
4 | const element = document.createElement("div"); | 4 | const element = document.createElement('div'); |
5 | element.className = "menu-item"; | 5 | element.className = 'menu-item'; |
6 | element.innerHTML = 'Next Map <span class="info">(Tab)</span>'; | 6 | element.innerHTML = 'Next Map <span class="info">(Tab)</span>'; |
7 | element.onclick = () => this.utils.focusNextMap(); | 7 | element.onclick = () => this.utils.focusNextMap(); |
8 | 8 | ||
@@ -10,8 +10,8 @@ export function nextMap() { | |||
10 | } | 10 | } |
11 | 11 | ||
12 | export function nextBlock() { | 12 | export function nextBlock() { |
13 | const element = document.createElement("div"); | 13 | const element = document.createElement('div'); |
14 | element.className = "menu-item"; | 14 | element.className = 'menu-item'; |
15 | element.innerHTML = 'Next Block <span class="info">(n)</span>'; | 15 | element.innerHTML = 'Next Block <span class="info">(n)</span>'; |
16 | element.onclick = () => this.utils.focusNextBlock(); | 16 | element.onclick = () => this.utils.focusNextBlock(); |
17 | 17 | ||
@@ -19,8 +19,8 @@ export function nextBlock() { | |||
19 | } | 19 | } |
20 | 20 | ||
21 | export function nextLayout() { | 21 | export function nextLayout() { |
22 | const element = document.createElement("div"); | 22 | const element = document.createElement('div'); |
23 | element.className = "menu-item"; | 23 | element.className = 'menu-item'; |
24 | element.innerHTML = 'Next Layout <span class="info">(x)</span>'; | 24 | element.innerHTML = 'Next Layout <span class="info">(x)</span>'; |
25 | element.onclick = () => this.utils.switchToNextLayout(); | 25 | element.onclick = () => this.utils.switchToNextLayout(); |
26 | 26 | ||
@@ -33,9 +33,9 @@ export class GeoLink { | |||
33 | } | 33 | } |
34 | 34 | ||
35 | createElement = () => { | 35 | createElement = () => { |
36 | const element = document.createElement("div"); | 36 | const element = document.createElement('div'); |
37 | element.className = "menu-item"; | 37 | element.className = 'menu-item'; |
38 | element.innerText = "Add GeoLink"; | 38 | element.innerText = 'Add GeoLink'; |
39 | element.onclick = this.addGeoLinkbyRange; | 39 | element.onclick = this.addGeoLinkbyRange; |
40 | 40 | ||
41 | return element; | 41 | return element; |
@@ -49,7 +49,7 @@ export class GeoLink { | |||
49 | if (!match) return false; | 49 | if (!match) return false; |
50 | 50 | ||
51 | const [x, y] = match.slice(1); | 51 | const [x, y] = match.slice(1); |
52 | const anchor = document.createElement("a"); | 52 | const anchor = document.createElement('a'); |
53 | anchor.textContent = content; | 53 | anchor.textContent = content; |
54 | // FIXME apply WGS84 | 54 | // FIXME apply WGS84 |
55 | anchor.href = `geo:${y},${x}?xy=${x},${y}`; | 55 | anchor.href = `geo:${y},${x}?xy=${x},${y}`; |
@@ -67,21 +67,21 @@ export class Suggestion { | |||
67 | } | 67 | } |
68 | 68 | ||
69 | createElement(codemirror) { | 69 | createElement(codemirror) { |
70 | const option = document.createElement("div"); | 70 | const option = document.createElement('div'); |
71 | if (this.text.startsWith("<")) { | 71 | if (this.text.startsWith('<')) { |
72 | option.innerHTML = this.text; | 72 | option.innerHTML = this.text; |
73 | } else { | 73 | } else { |
74 | option.innerText = this.text; | 74 | option.innerText = this.text; |
75 | } | 75 | } |
76 | option.classList.add("container__suggestion"); | 76 | option.classList.add('container__suggestion'); |
77 | option.onmouseover = () => { | 77 | option.onmouseover = () => { |
78 | Array.from(option.parentElement?.children ?? []).forEach(s => | 78 | Array.from(option.parentElement?.children ?? []).forEach(s => |
79 | s.classList.remove("focus"), | 79 | s.classList.remove('focus'), |
80 | ); | 80 | ); |
81 | option.classList.add("focus"); | 81 | option.classList.add('focus'); |
82 | }; | 82 | }; |
83 | option.onmouseout = () => { | 83 | option.onmouseout = () => { |
84 | option.classList.remove("focus"); | 84 | option.classList.remove('focus'); |
85 | }; | 85 | }; |
86 | option.onclick = () => { | 86 | option.onclick = () => { |
87 | const anchor = codemirror.getCursor(); | 87 | const anchor = codemirror.getCursor(); |