You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/diary/index.njk
+6-15Lines changed: 6 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -228,26 +228,17 @@ but the content is a concise documentary/logbook about the site.
228
228
// Download (more robust for iOS/Safari with setTimeout)
229
229
if (dlBtn) dlBtn.addEventListener('click', function(){ var date=(dInput.value||todayStr()).slice(0,10); var filename=date+'-'+slugify(tInput.value)+'.md'; var md=buildMarkdown(tInput.value,dInput.value,bInput.value); var blob=newBlob([md],{type:'text/markdown'}); var url=URL.createObjectURL(blob); var a=document.createElement('a'); a.href=url; a.download=filename; document.body.appendChild(a); setTimeout(function(){ a.click(); setTimeout(function(){ URL.revokeObjectURL(url); document.body.removeChild(a); }, 500); }, 0); });
230
230
231
-
// Email .md (Web Share API with file when supported, fallback to mailto)
232
-
if (emailBtn) emailBtn.addEventListener('click', asyncfunction(){
231
+
// Email .md (simple mailto with Markdown in subject/body)
232
+
if (emailBtn) emailBtn.addEventListener('click', function(){
233
233
try {
234
234
var date=(dInput.value||todayStr()).slice(0,10);
235
-
var filename=date+'-'+slugify(tInput.value)+'.md';
236
235
var md=buildMarkdown(tInput.value,dInput.value,bInput.value);
237
-
var subject ='[Diary] '+ (tInput.value||'Untitled') +' ('+date+')';
238
-
// Try Web Share API with file attachment
239
-
if (window.File&&navigator.canShare) {
240
-
var file =newFile([md], filename, { type:'text/markdown' });
0 commit comments