From 8768ab1692a691eca6556e658fbe76ed63e542d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20=C3=85hall?= Date: Tue, 9 Jan 2024 17:58:41 +0100 Subject: [PATCH 1/3] Added highlight to markdown code. Added markdown icon to differentiate against markdown on/off. --- static/css/main.css | 10 +++++++ static/images/markdown-hollow.svg | 49 +++++++++++++++++++++++++++++++ static/js/node.mjs | 2 +- static/less/main.less | 12 ++++++++ 4 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 static/images/markdown-hollow.svg diff --git a/static/css/main.css b/static/css/main.css index 63c1a4e..d56561f 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -320,6 +320,16 @@ header .menu { border: 1px solid #ddd; padding: 4px 8px; } +#markdown code { + background: #e6eeee; + padding: 4px; + border-radius: 4px; +} +#markdown pre > code { + background: unset; + padding: 0px; + border-radius: 0px; +} /* ============================================================= * * Textarea replicates the height of an element expanding height * * ============================================================= */ diff --git a/static/images/markdown-hollow.svg b/static/images/markdown-hollow.svg new file mode 100644 index 0000000..bd2e424 --- /dev/null +++ b/static/images/markdown-hollow.svg @@ -0,0 +1,49 @@ + + + + + + + diff --git a/static/js/node.mjs b/static/js/node.mjs index 4a3332f..054e319 100644 --- a/static/js/node.mjs +++ b/static/js/node.mjs @@ -105,7 +105,7 @@ export class NodeUI extends Component {
this.saveNode()}>
document.getElementById('app').classList.toggle('toggle-tree')} />
Notes
-
{ evt.stopPropagation(); this.toggleMarkdown() }}>
+
{ evt.stopPropagation(); this.toggleMarkdown() }}>
this.createNode(evt)}>
{ evt.stopPropagation(); this.showPage('keys') }}>
diff --git a/static/less/main.less b/static/less/main.less index 30114dc..670bbfa 100644 --- a/static/less/main.less +++ b/static/less/main.less @@ -365,6 +365,18 @@ header { padding: 4px 8px; } } + + code { + background: #e6eeee; + padding: 4px; + border-radius: 4px; + } + + pre > code { + background: unset; + padding: 0px; + border-radius: 0px; + } } /* ============================================================= * From d3bc5e3f7f2be60e08bace49555fcf34529a1a9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20=C3=85hall?= Date: Tue, 9 Jan 2024 18:03:12 +0100 Subject: [PATCH 2/3] Modified Alt+Shift+S to also save node properties --- static/js/node.mjs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/static/js/node.mjs b/static/js/node.mjs index 054e319..1c76682 100644 --- a/static/js/node.mjs +++ b/static/js/node.mjs @@ -12,6 +12,7 @@ export class NodeUI extends Component { this.menu = signal(false) this.node = signal(null) this.nodeContent = createRef() + this.nodeProperties = createRef() this.keys = signal([]) this.page = signal('node') @@ -80,7 +81,7 @@ export class NodeUI extends Component { break case 'node-properties': - page = html`<${NodeProperties} nodeui=${this} />` + page = html`<${NodeProperties} ref=${this.nodeProperties} nodeui=${this} />` break case 'keys': @@ -160,7 +161,10 @@ export class NodeUI extends Component { break case 'S': - this.saveNode() + if (this.page.value == 'node') + this.saveNode() + else if (this.page.value == 'node-properties') + this.nodeProperties.current.save() break case 'U': From 5c27f9ed1c37d8712fbf66d2621d16325a1a96eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20=C3=85hall?= Date: Tue, 9 Jan 2024 18:03:30 +0100 Subject: [PATCH 3/3] Bumped to v20 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 62ccda5..9a2a0e2 100644 --- a/version +++ b/version @@ -1 +1 @@ -v19 +v20