try editor .ctmpl in browser, time for somethin smarter

master
Bel LaPointe 2022-02-14 07:58:01 -07:00
parent aff325960f
commit 11cbf4f9e4
1 changed files with 34 additions and 1 deletions

View File

@ -1,4 +1,5 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.css">
<script src="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.js"></script>
<style> <style>
.EasyMDEContainer button { .EasyMDEContainer button {
color: black; color: black;
@ -150,8 +151,9 @@
</form> </form>
</span> </span>
<span id="titlePath"> <span id="titlePath">
/
{{ if ne .PID "" }} {{ if ne .PID "" }}
<a href="/ui/files/{{ .PID }}">{{ .PTitle }}</a> <a href="/ui/files/{{ .PID }}">{{ .PTitle }}</a> /
{{ end }} {{ end }}
</span> </span>
<span id="title" class="thic_flex" contenteditable>{{ .Title }}</span> <span id="title" class="thic_flex" contenteditable>{{ .Title }}</span>
@ -168,3 +170,34 @@
<textarea id="my-text-area"></textarea> <textarea id="my-text-area"></textarea>
</div> </div>
</article> </article>
<script>
const easyMDE = new EasyMDE({
autoDownloadFontAwesome: true,
autofocus: true,
autosave: {
enabled: false,
},
element: document.getElementById('my-text-area'),
forceSync: true,
indentWithTabs: false,
initialValue: "# initial\nvalue",
showIcons: ["code", "table"],
spellChecker: false,
sideBySideFullscreen: false,
tabSize: 3,
previewImagesInEditor: true,
insertTexts: {
image: ["![](", ")"],
link: ["[](", ")"],
},
lineNumbers: true,
lineWrapping: false,
uploadImage: true,
imageUploadEndpoint: "/api/v0/media", // POST wants {data: {filePath: "/..."}}
imagePathAbsolute: false,
renderingConfig: {
codeSyntaxHighlighting: true,
},
status: ["lines", "words", "cursor"],
})
</script>