added 'copy with meta' option to add in info to the copied words todo: format all the date strings

This commit is contained in:
Jacob Haddon 2024-03-10 21:42:17 -04:00
parent 4c77292b34
commit 0be081d7e8

View File

@ -121,6 +121,14 @@ $(document).ready(function(){
navigator.clipboard.writeText($("#poem_list").text());
}); // copy text
$("#copy_text_meta").click(function(){
const today = Date(Date.now());
todayFormatted = today.toString();
var poem_meta = "#dailyBlackoutPoetryChallenge\n\n" + $("#poem_list").text() + "\n\n" + book.title + " - " + todayFormatted;
navigator.clipboard.writeText(poem_meta);
}); // copy text
// change the color of a clicked word; add/remove clicked word to list
$(document).on('click', "#spina.unlock p span", function(e){
// $("#spina.unlock p span").click(function(){
@ -187,6 +195,7 @@ $(document).ready(function(){
<h1>Copy Your Words</h1>
<p>Copy the words you found here for alt-text, editing and archive! (Remember we dont keep anything, so once you close this page, this poem is gone!)</P>
<button id="copy_text">Copy</button>
<button id="copy_text_meta">Copy with meta</button>
<div id="poem_list"></div>
</section>