mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2024-12-22 11:23:33 +02:00
fluoride: Add support for image.png
This commit is contained in:
parent
b6c09b4fc6
commit
471701f029
1 changed files with 18 additions and 0 deletions
|
@ -271,6 +271,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();
|
||||
|
@ -309,6 +323,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
|
||||
|
|
Loading…
Reference in a new issue