Can embed any file in a PNG/WebM/GIF/JPEG and upload it to a third-party host through 4chan
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

35 lines
961 B

const pc = postCommon;
const pcasf = pc.addSelectedFile.bind(pc);
let prevFile;
pc.addSelectedFile = (f, unk) => {
pcasf(f, unk);
// will only embed in the first file
const refresh = () => {
const currentFile = pc.selectedFiles[0];
if (prevFile != currentFile) {
prevFile = currentFile;
document.dispatchEvent(new CustomEvent("PEEFile", { detail: prevFile }));
}
};
refresh();
const rb = pc.selectedDiv.lastChild?.getElementsByClassName("removeButton")[0];
if (rb)
rb.addEventListener("click", refresh);
};
document.addEventListener("QRSetFile", (e) => {
if (pc.selectedFiles.length > 0)
pc.selectedFiles[0] = e.detail.file;
});
const taup = thread.addUnreadPost.bind(thread);
thread.addUnreadPost = (e) => {
taup(e);
document.dispatchEvent(new CustomEvent("ThreadUpdate", {
detail: {
newPosts: ['b.' + e.postId]
}
}));
}