From fa539bbb682ed11922dec6b717137371cc6c566b Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 7 Jun 2026 13:39:09 -0400 Subject: [PATCH] Remove Save TXT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Share covers it (Notes, Files, anywhere), and drag-drop import remains the way back in. Toolbar: Copy · Save PNG · Share + toggles. Co-Authored-By: Claude Opus 4.8 (1M context) --- static/index.html | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/static/index.html b/static/index.html index 4f1cc56..ef4ea48 100644 --- a/static/index.html +++ b/static/index.html @@ -290,7 +290,6 @@ Double-click any word to look it up on the right.">
- @@ -1130,11 +1129,6 @@ lookupInput.addEventListener('paste', e=>{ /* ============================================================ FILES IN, FILES OUT — drafts shouldn't be hostage to localStorage ============================================================ */ -function draftFilename(){ - const doc = docsState.docs.find(d=>d.id===docsState.current); - return (((doc && doc.title && doc.title !== 'Untitled') ? doc.title : 'rhymepad') - .replace(/[^\w\- ]+/g, '').trim() || 'rhymepad') + '.txt'; -} const shareBtn = document.getElementById('shareBtn'); if(navigator.share){ shareBtn.hidden = false; @@ -1149,15 +1143,6 @@ if(navigator.share){ }catch(e){ /* user closed the sheet */ } }); } -document.getElementById('downloadBtn').addEventListener('click', ()=>{ - if(!editor.value.trim()) return; - const a = document.createElement('a'); - a.href = URL.createObjectURL(new Blob([editor.value], {type: 'text/plain'})); - a.download = draftFilename(); - a.click(); - setTimeout(()=>URL.revokeObjectURL(a.href), 5000); - flash('downloadBtn', 'Saved \u2713'); -}); // drop a .txt (or any text file) anywhere -> it becomes a new draft document.addEventListener('dragover', e=>{ e.preventDefault(); }); document.addEventListener('drop', async e=>{