diff --git a/.gitignore b/.gitignore index df803908..479c8469 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,4 @@ data.db publish-data.db /index.json .idea -deno.lock \ No newline at end of file +deno.lock diff --git a/plug-api/silverbullet-syscall/editor.ts b/plug-api/silverbullet-syscall/editor.ts index 54ed69f1..492cf60e 100644 --- a/plug-api/silverbullet-syscall/editor.ts +++ b/plug-api/silverbullet-syscall/editor.ts @@ -111,11 +111,6 @@ export function confirm( ): Promise { return syscall("editor.confirm", message); } - -export function enableReadOnlyMode(enabled: boolean) { - return syscall("editor.enableReadOnlyMode", enabled); -} - export function getUiOption(key: string): Promise { return syscall("editor.getUiOption", key); } diff --git a/plugs/core/core.plug.yaml b/plugs/core/core.plug.yaml index 1c51173e..70adedb5 100644 --- a/plugs/core/core.plug.yaml +++ b/plugs/core/core.plug.yaml @@ -57,15 +57,6 @@ functions: command: name: "Page: Delete" - editorLoad: - path: "./editor.ts:editorLoad" - events: - - plugs:loaded - toggleReadOnlyode: - path: "./editor.ts:toggleReadOnlyMode" - command: - name: "Editor: Toggle Read Only Mode" - # Attachments attachmentQueryProvider: path: ./attachment.ts:attachmentQueryProvider diff --git a/plugs/core/editor.ts b/plugs/core/editor.ts index 88c9189e..91098511 100644 --- a/plugs/core/editor.ts +++ b/plugs/core/editor.ts @@ -1,19 +1,5 @@ import { clientStore, editor } from "$sb/silverbullet-syscall/mod.ts"; -export async function editorLoad() { - const readOnlyMode = await clientStore.get("readOnlyMode"); - if (readOnlyMode) { - await editor.enableReadOnlyMode(true); - } -} - -export async function toggleReadOnlyMode() { - let readOnlyMode = await clientStore.get("readOnlyMode"); - readOnlyMode = !readOnlyMode; - await editor.enableReadOnlyMode(readOnlyMode); - await clientStore.set("readOnlyMode", readOnlyMode); -} - // Run on "editor:init" export async function setEditorMode() { if (await clientStore.get("vimMode")) {