Cybrkyd's Git Repositories

jottings - commit: 681677d

commit 681677d2e37bd5ec3f399fefb0c4d31501b1211be59bab90bc61a55692e5c683
author Cybrkyd <git@cybrkyd.com> 2026-06-22 19:34:33 +0100
committer Cybrkyd <git@cybrkyd.com> 2026-06-22 19:34:33 +0100

Commit Message

Ctrl+S / Cmd+S to save the current jot

📊 Diffstat

resources/js/app.js 10
1 files changed, 10 insertions(+), 0 deletions(-)

Diff

diff --git a/resources/js/app.js b/resources/js/app.js
index 004cc74..aed4350 100644
--- a/resources/js/app.js
+++ b/resources/js/app.js
@@ -851,6 +851,16 @@ document.getElementById("newBtn").onclick = function() {
document.getElementById("exportBtn").onclick = exportDocument;
+ // Ctrl+S / Cmd+S to save the current jot
+ document.addEventListener("keydown", function(e) {
+ if ((e.ctrlKey || e.metaKey) && (e.key === 's' || e.key === 'S')) {
+ e.preventDefault();
+ const text = getEditorText().trim();
+ if (!text) { alert("Enter some text first"); return; }
+ saveDocument(text);
+ }
+ });
+
const savedColumn = document.getElementById("savedColumn");
const toggleBtn = document.getElementById("toggleBtn");
toggleBtn.addEventListener("click", function() {