From 5809998ac7c7778cc5802f0ee13d1bc0c821ee3c Mon Sep 17 00:00:00 2001 From: Aysha Date: Wed, 11 Sep 2024 11:45:56 +0530 Subject: [PATCH] refactor: update edit menu icon appearance and editor setup function --- wiki/public/js/editor.js | 19 +++---- wiki/public/scss/wiki.scss | 50 ++++++++++++++++--- .../doctype/wiki_page/templates/show.html | 8 +-- 3 files changed, 54 insertions(+), 23 deletions(-) diff --git a/wiki/public/js/editor.js b/wiki/public/js/editor.js index 2487e13f..96dc7ea2 100644 --- a/wiki/public/js/editor.js +++ b/wiki/public/js/editor.js @@ -55,20 +55,13 @@ previewToggleBtn.on("click", function () { }); function setEditor() { - editor.setOption("wrap", true); - editor.setOption("showPrintMargin", true); - editor.setTheme("ace/theme/tomorrow_night"); - editor.renderer.lineHeight = 20; - frappe.call({ - method: "wiki.wiki.doctype.wiki_page.wiki_page.convert_html", - args: { - html: $(".wiki-content").html(), - }, - callback: (r) => { - editor.setValue(markdown_content || "", 1); - }, + editor.setOptions({ + wrap: true, + showPrintMargin: true, + theme: "ace/theme/tomorrow_night", }); - + editor.renderer.lineHeight = 20; + editor.setValue(markdown_content || "", 1); wikiTitleInput.val($(".wiki-title").text() || ""); } diff --git a/wiki/public/scss/wiki.scss b/wiki/public/scss/wiki.scss index a2ba2e24..7602f6b7 100644 --- a/wiki/public/scss/wiki.scss +++ b/wiki/public/scss/wiki.scss @@ -40,9 +40,21 @@ body { // ------------------------------------------ - font-family: InterVariable, ui-sans-serif, system-ui, -apple-system, - BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, - sans-serif, "Apple Color Emoji", "Segoe UI Emoji", Segoe UI Symbol, + font-family: + InterVariable, + ui-sans-serif, + system-ui, + -apple-system, + BlinkMacSystemFont, + Segoe UI, + Roboto, + Helvetica Neue, + Arial, + Noto Sans, + sans-serif, + "Apple Color Emoji", + "Segoe UI Emoji", + Segoe UI Symbol, "Noto Color Emoji"; background-color: var(--background-color); @@ -316,7 +328,10 @@ body.dark { &.active { background-color: var(--sidebar-active-item-color); border-radius: 0.625rem; - box-shadow: 0 0 #0000, 0 0 #0000, 0px 1px 2px rgba(0, 0, 0, 0.1); + box-shadow: + 0 0 #0000, + 0 0 #0000, + 0px 1px 2px rgba(0, 0, 0, 0.1); } div { @@ -858,9 +873,11 @@ h6:hover .feather-link { } .wiki-options { + display: flex; + flex-direction: column; + justify-content: center; width: 2rem; height: 2rem; - margin-top: 0.5rem; margin-left: 0.5rem; svg { @@ -872,6 +889,24 @@ h6:hover .feather-link { } } +.menu { + cursor: pointer; + font-size: 24px; + + .dots { + display: flex; + justify-content: space-around; + width: 16px; + + .dot { + background-color: #333; + border-radius: 50%; + width: 6px; + height: 6px; + } + } +} + .wiki-options:hover { background-color: var(--gray-200); border-radius: 5px; @@ -953,7 +988,10 @@ h6:hover .feather-link { .active { color: var(--text-color); box-shadow: 1px 0 0 var(--primary) inset; - transition: color 0.2s, box-shadow 0.2s linear, transform 0.2s linear; + transition: + color 0.2s, + box-shadow 0.2s linear, + transform 0.2s linear; } a { diff --git a/wiki/wiki/doctype/wiki_page/templates/show.html b/wiki/wiki/doctype/wiki_page/templates/show.html index c3beff4c..f17adf18 100644 --- a/wiki/wiki/doctype/wiki_page/templates/show.html +++ b/wiki/wiki/doctype/wiki_page/templates/show.html @@ -44,14 +44,14 @@ {%- endif -%}