diff --git a/site/index.html b/site/index.html index b522b07..d855dcf 100644 --- a/site/index.html +++ b/site/index.html @@ -27,6 +27,7 @@ Dopamine menu One thing Brain dump + Done-Wall + + +
diff --git a/site/static/app.js b/site/static/app.js index 4d15e13..5faa732 100644 --- a/site/static/app.js +++ b/site/static/app.js @@ -955,6 +955,32 @@ /* ---------- keyboard shortcuts ---------- */ document.addEventListener('keydown', function (e) { + // Quick Capture (Alt+P) - active globally + if (e.altKey && (e.key === 'p' || e.key === 'P')) { + e.preventDefault(); + var overlay = document.getElementById('quick-capture-overlay'); + if (overlay.hidden) { + overlay.hidden = false; + document.getElementById('quick-capture-input').value = ''; + document.getElementById('quick-capture-input').focus(); + } else { + overlay.hidden = true; + } + return; + } + // Quick capture handling inside input + if (e.target.id === 'quick-capture-input') { + if (e.key === 'Escape') { + document.getElementById('quick-capture-overlay').hidden = true; + } else if (e.key === 'Enter' && e.target.value.trim() !== '') { + var unTasks = store('unsorted_tasks') || []; + unTasks.push({ text: e.target.value.trim(), created: Date.now() }); + store('unsorted_tasks', unTasks); + if (typeof unPaint === 'function') unPaint(); + document.getElementById('quick-capture-overlay').hidden = true; + e.target.value = ''; + } + } // Don't trigger shortcuts when typing in an input or contenteditable var tag = e.target.tagName; if (tag === 'INPUT' || tag === 'TEXTAREA' || e.target.contentEditable === 'true') return;