diff options
author | r <r@freesoftwareextremist.com> | 2022-09-23 17:22:54 +0000 |
---|---|---|
committer | r <r@freesoftwareextremist.com> | 2022-09-23 17:22:54 +0000 |
commit | f55595ddb63bd8afb4c85945b82aa1f174050e6b (patch) | |
tree | 3e9f909097c026b065365846ca8143295097a09f /static/fluoride.js | |
parent | b8c0133bcd5e7f1d4063ad992949cc19d18e7aad (diff) | |
parent | 68698a9e1afce43ef807d6b5f892ca1c0f905b8a (diff) | |
download | bloat-f55595ddb63bd8afb4c85945b82aa1f174050e6b.tar.gz bloat-f55595ddb63bd8afb4c85945b82aa1f174050e6b.zip |
Merge branch 'master' into absolute_fluorideabsolute_fluoride
Diffstat (limited to 'static/fluoride.js')
-rw-r--r-- | static/fluoride.js | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/static/fluoride.js b/static/fluoride.js index 279483f..e6624d1 100644 --- a/static/fluoride.js +++ b/static/fluoride.js @@ -152,6 +152,7 @@ function replyToLinkLocal(a) { var copy = status.cloneNode(true); copy.id = "reply-to-popup"; var ract = event.target.getBoundingClientRect(); + copy.style["max-width"] = (window.innerWidth - ract.left - 32) + "px"; if (ract.top > window.innerHeight / 2) { copy.style.bottom = (window.innerHeight - window.scrollY - ract.top) + "px"; @@ -245,6 +246,7 @@ function handleReplyLink(a) { var copy = status.cloneNode(true); copy.id = "reply-popup"; var ract = event.target.getBoundingClientRect(); + copy.style["max-width"] = (window.innerWidth - 98) + "px"; if (ract.left > window.innerWidth / 2) { copy.style.right = (window.innerWidth - ract.right - 12) + "px"; @@ -334,6 +336,20 @@ function handleImgPreview(a) { } } +function onPaste(e) { + if (!e.clipboardData.files) + return; + var fp = document.querySelector("#post-file-picker") + var dt = new DataTransfer(); + for (var i = 0; i < fp.files.length; i++) { + dt.items.add(fp.files[i]); + } + for (var i = 0; i < e.clipboardData.files.length; i++) { + dt.items.add(e.clipboardData.files[i]); + } + fp.files = dt.files; +} + document.addEventListener("DOMContentLoaded", function() { checkCSRFToken(); checkAntiDopamineMode(); @@ -363,7 +379,7 @@ document.addEventListener("DOMContentLoaded", function() { } } - var links = document.querySelectorAll(".user-profile-decription a"); + var links = document.querySelectorAll(".user-profile-decription a, .user-fields a"); for (var j = 0; j < links.length; j++) { links[j].target = "_blank"; } @@ -372,6 +388,10 @@ document.addEventListener("DOMContentLoaded", function() { for (var j = 0; j < links.length; j++) { handleImgPreview(links[j]); } + + var pf = document.querySelector(".post-form") + if (pf) + pf.addEventListener("paste", onPaste); }); // @license-end |