Work on client modes

This commit is contained in:
Zef Hemel
2023-08-29 21:17:29 +02:00
parent 5ff1a8bae3
commit 9a005f26b5
54 changed files with 594 additions and 302 deletions
+2 -2
View File
@@ -14,7 +14,7 @@ export async function brokenLinksCommand() {
if (tree.type === "WikiLinkPage") {
// Add the prefix in the link text
const [pageName] = tree.children![0].text!.split("@");
if (pageName.startsWith("💭 ")) {
if (pageName.startsWith("!")) {
return true;
}
if (
@@ -31,7 +31,7 @@ export async function brokenLinksCommand() {
}
if (tree.type === "PageRef") {
const pageName = tree.children![0].text!.slice(2, -2);
if (pageName.startsWith("💭 ")) {
if (pageName.startsWith("!")) {
return true;
}
if (!allPagesMap.has(pageName)) {
-7
View File
@@ -1,7 +0,0 @@
import { editor } from "$sb/syscalls.ts";
export async function setThinClient(def: any) {
console.log("Setting thin client to", def.value);
await editor.setUiOption("thinClientMode", def.value);
await editor.reloadUI();
}
+5 -19
View File
@@ -1,6 +1,4 @@
name: editor
requiredPermissions:
- fetch
syntax:
NakedURL:
firstCharacters:
@@ -59,6 +57,10 @@ functions:
name: "Navigate: Home"
key: "Alt-h"
page: ""
moveToPos:
path: "./editor.ts:moveToPosCommand"
command:
name: "Navigate: Move Cursor to Position"
# Text editing commands
quoteSelectionCommand:
@@ -113,12 +115,8 @@ functions:
centerCursor:
path: "./editor.ts:centerCursorCommand"
command:
name: "Editor: Center Cursor"
name: "Navigate: Center Cursor"
key: "Ctrl-Alt-l"
moveToPos:
path: "./editor.ts:moveToPosCommand"
command:
name: "Editor: Move Cursor to Position"
# Debug commands
parseCommand:
@@ -197,18 +195,6 @@ functions:
command:
name: "Broken Links: Show"
# Client mode
enableThinClient:
path: ./client.ts:setThinClient
command:
name: "Client: Enable Thin Client"
value: true
disableThinClient:
path: ./client.ts:setThinClient
command:
name: "Client: Disable Thin Client"
value: false
# Random stuff
statsCommand:
path: ./stats.ts:statsCommand