aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/editor.mjs
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2024-10-09 18:00:56 +0800
committerHsieh Chin Fan <pham@topo.tw>2024-10-09 18:31:57 +0800
commit9b4af831b6b5866e655597eb752311fa79b6ab40 (patch)
treeaa78486b84cadcbd7958d80556bc60ecb642627b /src/editor.mjs
parentf153a4dfa051c711959a5f58d7a00c5148231f8e (diff)
feat: update default contents and used CSS
Diffstat (limited to 'src/editor.mjs')
-rw-r--r--src/editor.mjs40
1 files changed, 27 insertions, 13 deletions
diff --git a/src/editor.mjs b/src/editor.mjs
index b93bad8..819cf68 100644
--- a/src/editor.mjs
+++ b/src/editor.mjs
@@ -74,19 +74,34 @@ You can use it to:
74 74
751. [Roll a Dice] for a new map 751. [Roll a Dice] for a new map
762. Hover on [GeoLink][example-geolink] to show point in maps. 762. Hover on [GeoLink][example-geolink] to show point in maps.
773. Add a new anchor by **Right Click** on a map, and **Right Click** on **Selected Text** to attach anchor 773. Add GeoLink by dragging **selected text**
784. Add more contents into [Editor] by text in [Markdown] 784. Change contents by [Editor] with [Markdown] text
795. Generated document is at left hand side, **Right click** for context menu. 795. **Right click** to call context menu, you can:
80 You can: 80 + Change focus between maps
81 + Select content block for browsing 81 + Select a block for browsing
82 + Switch layouts for various use cases 82 + Switch layouts for various use cases
83 83
84 84
85If you want know more, take a look at subjects below: 85If you want know more, take a look at subjects below:
861. [How to write text in Markdown?][subject] 861. [How to write Markdown text?](https://www.markdownguide.org/basic-syntax/)
872. [How can I save contents for next time][subject] 871. <details>
883. [I want XXX feature in maps][subject] 88 <summary>How can I save contents for next use?</summary>
893. [I am a expeienced developer, show me what you got!][subject] 89
90 Since All contents come from raw texts, you can:
91 1. Save current page as bookmark by [hash button](#create-hash "=>.mde-hash")
92 2. Copy texts in editor and save as \`.txt\` file
93 3. Use online service for hosting Markdown, for example: [HackMD](https://hackmd.io)
94
95 </details>
961. <details>
97 <summary>I want more features in map!</summary>
98
99 DumbyMap use [mapclay](https://github.com/outdoorsafetylab/mapclay) to render maps.
100 1. You can use \`eval\` options to add custom scripts, see [tutoria](https://github.com/outdoorsafetylab/mapclay?tab=readme-ov-file#run-scripts-after-map-is-created) for more details
101 2. You can use custom Renderer indtead of default ones, see [tutoria](https://github.com/outdoorsafetylab/mapclay?tab=readme-ov-file#renderer) for more details
102
103 </details>
1041. [I am an experienced developer, show me what you got!](https://github.com/outdoorsafetylab/dumbymap)
90 105
91 106
92<br> 107<br>
@@ -96,10 +111,9 @@ If you want know more, take a look at subjects below:
96 <br> 111 <br>
97 112
98[Roll a dice]: #Click%20it! "=>.mde-roll" 113[Roll a dice]: #Click%20it! "=>.mde-roll"
99[example-geolink]: geo:24,121?xy=121,24 114[example-geolink]: geo:24,121?xy=121,24&text=Use%20yellow%20link%20point%20to%20map
100[Markdown]: https://www.markdownguide.org/basic-syntax/ 115[Markdown]: https://www.markdownguide.org/basic-syntax/
101[Editor]: #This%20is%20editor! "=>.editor" 116[Editor]: #This%20is%20editor! "=>.editor"`
102[subject]: placeholder`
103 117
104/** Editor from EasyMDE **/ 118/** Editor from EasyMDE **/
105const editor = new EasyMDE({ 119const editor = new EasyMDE({
@@ -1100,7 +1114,7 @@ dumbyContainer.onmousedown = (e) => {
1100 line.position() 1114 line.position()
1101 } 1115 }
1102 1116
1103 context.classList.add('dragging-geolink') 1117 context.classList.add('dragging-geolink')
1104 dumbyContainer.onmousemove = onMouseMove 1118 dumbyContainer.onmousemove = onMouseMove
1105 dumbymap.utils.renderedMaps().forEach(map => { map.style.cursor = 'crosshair' }) 1119 dumbymap.utils.renderedMaps().forEach(map => { map.style.cursor = 'crosshair' })
1106 dumbyContainer.onmouseup = function (e) { 1120 dumbyContainer.onmouseup = function (e) {