diff --git a/main/static/main/post.css b/main/static/main/post.css index 8774173..8cd1eb0 100644 --- a/main/static/main/post.css +++ b/main/static/main/post.css @@ -25,5 +25,5 @@ textarea.thought { font-size: 32px; color: var(--text-color); cursor: pointer; - float: right; + font-family: Georgia, Libre Baskerville, serif; } diff --git a/main/templates/whispermaphone/post.html b/main/templates/whispermaphone/post.html index 9f2527d..2a4ae7b 100644 --- a/main/templates/whispermaphone/post.html +++ b/main/templates/whispermaphone/post.html @@ -68,6 +68,23 @@ //textEl.style.width = textEl.scrollWidth + "px"; }); + //Allow pasting images into the extended text text-box + textExtEl.addEventListener("paste", (evt) => { + const items = evt.clipboardData.items; + const el = evt.target; + for (const item of items) { + //Mac clipboard at least only handles PNGs + if ("image/png" === item.type) { + const reader = new FileReader(); + reader.addEventListener("load", evt => { + const newText = `![](${evt.target.result})`; + el.value = el.value.slice(0, el.selectionStart) + newText + el.value.slice(el.selectionEnd); + }); + reader.readAsDataURL(item.getAsFile()); + } + } + }); + const textboxes = document.getElementsByClassName("thought"); for (const box of textboxes) { //style.height doesn't include padding, .scrollHeight does