mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2024-11-22 04:39:21 +02:00
fluoride: Add support for image.png
This commit is contained in:
parent
b6c09b4fc6
commit
471701f029
|
@ -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 New Issue