From b98885ebf7e8327a100c10812efbaac568413b1d Mon Sep 17 00:00:00 2001 From: Tomofumi Chiba Date: Sun, 27 Oct 2024 09:20:00 +0900 Subject: [PATCH] fix --- .prototools | 1 + deno.json | 2 +- islands/PostEdit.tsx | 3 ++- islands/PostNew.tsx | 3 ++- routes/shortcuts.tsx | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 .prototools diff --git a/.prototools b/.prototools new file mode 100644 index 0000000..57138c8 --- /dev/null +++ b/.prototools @@ -0,0 +1 @@ +deno = "1.46.3" diff --git a/deno.json b/deno.json index aa394a4..312805d 100644 --- a/deno.json +++ b/deno.json @@ -3,7 +3,7 @@ "tasks": { "win": "deno run --watch=static/,routes/ --allow-env --allow-read --allow-write=.,$LOCALAPPDATA/Temp --allow-run=$(where deno),$LOCALAPPDATA/Cache/esbuild/bin/esbuild-windows-64@0.19.4 --allow-net=:8000,deno.land,esm.sh,accounts.google.com,www.googleapis.com,cdn.jsdelivr.net,$SUPABASE_HOST dev.ts", "arm": "deno run --watch=static/,routes/ --allow-env --allow-read --allow-write=.,/tmp --allow-run=deno,$HOME/.cache/esbuild/bin/esbuild-linux-arm64@0.19.4 --allow-net=:8000,deno.land,esm.sh,accounts.google.com,www.googleapis.com,cdn.jsdelivr.net,$SUPABASE_HOST dev.ts", - "linux": "export $(grep -v ^# .env) && deno run --watch=static/,routes/ --allow-env --allow-read --allow-write=.,$HOME/.cache/fresh,$HOME/.cache/esbuild --allow-run=deno,$HOME/.cache/esbuild/bin/@esbuild-linux-x64@0.19.4 --allow-net=:8000,deno.land,dl.deno.land,esm.sh,accounts.google.com,www.googleapis.com,cdn.jsdelivr.net,$SUPABASE_HOST,registry.npmjs.org dev.ts", + "linux": "export $(grep -v ^# .env) && deno run --watch=static/,routes/ --allow-env -R -W=.,$HOME/.cache/fresh,$HOME/.cache/esbuild --allow-run=$HOME/.proto/tools/deno/1.46.3/deno,$HOME/.cache/esbuild/bin/@esbuild-linux-x64@0.19.4 -N=:8000,deno.land,dl.deno.land,esm.sh,accounts.google.com,www.googleapis.com,cdn.jsdelivr.net,$SUPABASE_HOST,registry.npmjs.org dev.ts", "update": "deno run -A -r https://fresh.deno.dev/update .", "build": "git show --format='%H' --no-patch > static/build.txt && date --iso-8601='seconds' >> static/build.txt && deno run --allow-env --allow-read --allow-write=.,$HOME/.cache/fresh,$HOME/.cache/esbuild --allow-run=deno,$HOME/.cache/esbuild/bin/@esbuild-linux-x64@0.19.4 --allow-net=deno.land,dl.deno.land,esm.sh,cdn.jsdelivr.net,registry.npmjs.org dev.ts build", "env": "env", diff --git a/islands/PostEdit.tsx b/islands/PostEdit.tsx index f39a232..37b5660 100644 --- a/islands/PostEdit.tsx +++ b/islands/PostEdit.tsx @@ -48,9 +48,10 @@ export default function Edit(props: { post: PostViewType }) { ); } else { Mousetrap(textarea.current).bind( - "mod+enter", + ["mod+enter", "mod+s"], () => { save(); + return false; }, ); Mousetrap(textarea.current).bind( diff --git a/islands/PostNew.tsx b/islands/PostNew.tsx index 42fe5f0..e06a385 100644 --- a/islands/PostNew.tsx +++ b/islands/PostNew.tsx @@ -45,9 +45,10 @@ export default function Post() { ); } else { Mousetrap(textarea.current).bind( - "mod+enter", + ["mod+enter", "mod+s"], () => { post(); + return false; }, ); Mousetrap(textarea.current).bind( diff --git a/routes/shortcuts.tsx b/routes/shortcuts.tsx index 4626987..f7bbbf6 100644 --- a/routes/shortcuts.tsx +++ b/routes/shortcuts.tsx @@ -100,7 +100,7 @@ export default defineRoute(async (req, _ctx) => { Send/Save Post - (CTRL|⌘)+Enter + (CTRL|⌘)+Enter, (CTRL|⌘)+s Switch between Preview and Edit