Remove read-only mode
This commit is contained in:
parent
e4ebaa2cf4
commit
5b8744d0a8
@ -111,11 +111,6 @@ export function confirm(
|
|||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
return syscall("editor.confirm", message);
|
return syscall("editor.confirm", message);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function enableReadOnlyMode(enabled: boolean) {
|
|
||||||
return syscall("editor.enableReadOnlyMode", enabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getUiOption(key: string): Promise<any> {
|
export function getUiOption(key: string): Promise<any> {
|
||||||
return syscall("editor.getUiOption", key);
|
return syscall("editor.getUiOption", key);
|
||||||
}
|
}
|
||||||
|
@ -57,15 +57,6 @@ functions:
|
|||||||
command:
|
command:
|
||||||
name: "Page: Delete"
|
name: "Page: Delete"
|
||||||
|
|
||||||
editorLoad:
|
|
||||||
path: "./editor.ts:editorLoad"
|
|
||||||
events:
|
|
||||||
- plugs:loaded
|
|
||||||
toggleReadOnlyode:
|
|
||||||
path: "./editor.ts:toggleReadOnlyMode"
|
|
||||||
command:
|
|
||||||
name: "Editor: Toggle Read Only Mode"
|
|
||||||
|
|
||||||
# Attachments
|
# Attachments
|
||||||
attachmentQueryProvider:
|
attachmentQueryProvider:
|
||||||
path: ./attachment.ts:attachmentQueryProvider
|
path: ./attachment.ts:attachmentQueryProvider
|
||||||
|
@ -1,19 +1,5 @@
|
|||||||
import { clientStore, editor } from "$sb/silverbullet-syscall/mod.ts";
|
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"
|
// Run on "editor:init"
|
||||||
export async function setEditorMode() {
|
export async function setEditorMode() {
|
||||||
if (await clientStore.get("vimMode")) {
|
if (await clientStore.get("vimMode")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user