A valid URL you can bookmark and paste into address bar for quickly taking notes and saving to a .txt file.
GitHub https://gist.github.com/smcllns/8b727361ce4cf55cbc017faaefbbf951
A valid URL you can bookmark and paste into address bar for quickly taking notes and saving to a .txt file.
pairs well with my capture bookmark
javascript:(function(){ function isoD(){ var weekday = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']; var date = new Date(); var day = leadingZero(date.getDate()); var month = leadingZero(date.getMonth()+1); var year = date.getFullYear(); var fullDate = year + '-' + month + '-' + day; var hour = leadingZero(date.getHours()); var minute = leadingZero(date.getMinutes()); var second = leadingZero(date.getSeconds()); var weekdayTxt = weekday[date.getDay()]; function leadingZero(nr){ if (nr < 10) nr = '0' + nr; return nr; } var offset = date.getTimezoneOffset(); var sign = offset < 0 ? %27+%27 : %27-%27; offset = Math.abs(offset); var offsetHours = leadingZero(Math.floor(offset / 60)); var offsetMinutes = leadingZero(offset % 60); var timezoneOffset = sign + offsetHours + %27:%27 + offsetMinutes; return fullDate + %27 %27 + hour + %27:%27 + minute + %27:%27 + second + timezoneOffset + %27 %27 + weekdayTxt + %27 %27; } var dateTimeStr = isoD(); let selectedText = ""; if(window.getSelection()!=%27%27){ selectedText=window.getSelection().toString(); let pageInfo = "\n\n---via [[" + document.title + "|" + location.href + "]]"; let outputToClipboard = dateTimeStr + selectedText + pageInfo; prompt("Copy the following text (Ctrl+C or Cmd+C) and press OK:", outputToClipboard); } else { alert(%27No text selected.%27); } })();
No comments:
Post a Comment