An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: fix https://github.com/siyuan-note/siyuan/issues/6232
Vanessaa687331bdf84
diff --git a/app/src/assets/template/mobile/index.tpl b/app/src/assets/template/mobile/index.tplindex 0e4af5c935..3ebad2d7a0 100644--- a/app/src/assets/template/mobile/index.tpl+++ b/app/src/assets/template/mobile/index.tpl@@ -14,7 +14,7 @@<svg id="toolbarFile" class="toolbar__icon"><use xlink:href="#iconMenu"></use></svg>- <input readonly class="toolbar__title b3-text-field fn__hidden" id="toolbarName">+ <input class="toolbar__title b3-text-field fn__hidden" id="toolbarName"><svg id="toolbarEdit" class="toolbar__icon fn__hidden"><use xlink:href="#iconEdit"></use></svg>diff --git a/app/src/mobile/editor.ts b/app/src/mobile/editor.tsindex bc03331e19..6a4e992e81 100644--- a/app/src/mobile/editor.ts+++ b/app/src/mobile/editor.ts@@ -68,7 +68,7 @@ export const openMobileFileById = (id: string, action = [Constants.CB_GET_HL]) =},after: (editor) => {// protyle 仅初始化一次,后续更新时会对 url 等再次复制- if (window.siyuan.config.readonly || window.siyuan.config.editor.readOnly || document.querySelector("#toolbarEdit use").getAttribute("xlink:href") === "#iconEdit") {+ if (window.siyuan.config.readonly || window.siyuan.config.editor.readOnly) {disabledProtyle(editor.protyle);} else {enableProtyle(editor.protyle);diff --git a/app/src/mobile/util/initFramework.ts b/app/src/mobile/util/initFramework.tsindex 6507940aec..60d7140c4e 100644--- a/app/src/mobile/util/initFramework.ts+++ b/app/src/mobile/util/initFramework.ts@@ -92,11 +92,21 @@ export const initFramework = () => {const editElement = document.getElementById("toolbarEdit");if (window.siyuan.config.readonly) {editElement.classList.add("fn__none");+ }+ const inputElement = document.getElementById("toolbarName") as HTMLInputElement;+ const editIconElement = editElement.querySelector("use");+ if (window.siyuan.config.readonly || window.siyuan.config.editor.readOnly) {+ inputElement.readOnly = true;+ editIconElement.setAttribute("xlink:href", "#iconEdit");} else {- const editIconElement = editElement.querySelector("use");- editElement.addEventListener(getEventName(), () => {- const inputElement = document.getElementById("toolbarName") as HTMLInputElement;- if (editIconElement.getAttribute("xlink:href") === "#iconEdit") {+ inputElement.readOnly = false;+ editIconElement.setAttribute("xlink:href", "#iconPreview");+ }+ editElement.addEventListener(getEventName(), () => {+ const isReadonly = editIconElement.getAttribute("xlink:href") === "#iconPreview"+ window.siyuan.config.editor.readOnly = isReadonly;+ fetchPost("/api/setting/setEditor", window.siyuan.config.editor, () => {+ if (!isReadonly) {enableProtyle(window.siyuan.mobileEditor.protyle);inputElement.readOnly = false;editIconElement.setAttribute("xlink:href", "#iconPreview");@@ -105,8 +115,9 @@ export const initFramework = () => {inputElement.readOnly = true;editIconElement.setAttribute("xlink:href", "#iconEdit");}- });- }+ })+ });+scrimElement.addEventListener(getEventName(), () => {closePanel();});@@ -141,10 +152,10 @@ const initEditorName = () => {const inputElement = document.getElementById("toolbarName") as HTMLInputElement;inputElement.setAttribute("placeholder", window.siyuan.languages._kernel[16]);inputElement.addEventListener("focus", () => {- hideKeyboardToolbar();+ hideKeyboardToolbar();});inputElement.addEventListener("blur", () => {- if (window.siyuan.config.readonly || document.querySelector("#toolbarEdit use").getAttribute("xlink:href") === "#iconEdit") {+ if (window.siyuan.config.readonly || window.siyuan.config.editor.readOnly) {return;}if (!validateName(inputElement.value)) {diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.tsindex fb4db88574..a9ac7cdd1b 100644--- a/app/src/protyle/wysiwyg/index.ts+++ b/app/src/protyle/wysiwyg/index.ts@@ -1649,7 +1649,7 @@ export class WYSIWYG {}const menuElement = hasClosestByClassName(event.target, "protyle-action__menu");- if (menuElement && !protyle.disabled) {+ if (menuElement) {protyle.gutter.renderMenu(protyle, menuElement.parentElement.parentElement);const rect = menuElement.getBoundingClientRect();window.siyuan.menus.menu.popup({