|
|
@ -73,7 +73,7 @@ |
|
|
|
var define_BUILD_VERSION_default; |
|
|
|
var init_define_BUILD_VERSION = __esm({ |
|
|
|
"<define:BUILD_VERSION>"() { |
|
|
|
define_BUILD_VERSION_default = [0, 324]; |
|
|
|
define_BUILD_VERSION_default = [0, 326]; |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
@ -8574,7 +8574,8 @@ |
|
|
|
"b4k.co", |
|
|
|
"fireden.net", |
|
|
|
"thebarchive.com", |
|
|
|
"archiveofsins.com" |
|
|
|
"archiveofsins.com", |
|
|
|
"kohlchan.net" |
|
|
|
]; |
|
|
|
function supportedAltDomain(s) { |
|
|
|
return altdomains.includes(s); |
|
|
@ -20225,7 +20226,7 @@ |
|
|
|
init_define_BUILD_VERSION(); |
|
|
|
init_esbuild_inject(); |
|
|
|
function add_css13(target) { |
|
|
|
append_styles(target, "svelte-120v8nn", ".clickable.svelte-120v8nn.svelte-120v8nn{cursor:pointer;float:right}.root.svelte-120v8nn>span.svelte-120v8nn{display:flex;gap:10px;border:1px solid;padding:10px;border-radius:5px;font-weight:bolder;color:white;min-width:45vw}.root.svelte-120v8nn.svelte-120v8nn{position:fixed;top:0;left:50%;transform:translateX(-50%);display:flex;flex-direction:column;gap:10px}.error.svelte-120v8nn.svelte-120v8nn{background-color:crimson}.info.svelte-120v8nn.svelte-120v8nn{background-color:cornflowerblue}.warning.svelte-120v8nn.svelte-120v8nn{background-color:darkgoldenrod}.success.svelte-120v8nn.svelte-120v8nn{background-color:green}"); |
|
|
|
append_styles(target, "svelte-5t4r47", ".clickable.svelte-5t4r47.svelte-5t4r47{cursor:pointer;float:right}.root.svelte-5t4r47>span.svelte-5t4r47{display:flex;gap:10px;border:1px solid;padding:10px;border-radius:5px;font-weight:bolder;color:white;min-width:45vw}.root.svelte-5t4r47.svelte-5t4r47{position:fixed;top:0;left:50%;transform:translateX(-50%);display:flex;flex-direction:column;gap:10px}.error.svelte-5t4r47.svelte-5t4r47{background-color:crimson}.info.svelte-5t4r47.svelte-5t4r47{background-color:cornflowerblue}.warning.svelte-5t4r47.svelte-5t4r47{background-color:darkgoldenrod}.success.svelte-5t4r47.svelte-5t4r47{background-color:green}"); |
|
|
|
} |
|
|
|
function get_each_context6(ctx, list, i) { |
|
|
|
const child_ctx = ctx.slice(); |
|
|
@ -20251,8 +20252,8 @@ |
|
|
|
t0 = text(t0_value); |
|
|
|
span0 = element("span"); |
|
|
|
span0.textContent = "X"; |
|
|
|
attr(span0, "class", "clickable svelte-120v8nn"); |
|
|
|
attr(span1, "class", span1_class_value = null_to_empty(ctx[4].type) + " svelte-120v8nn"); |
|
|
|
attr(span0, "class", "clickable svelte-5t4r47"); |
|
|
|
attr(span1, "class", span1_class_value = null_to_empty(ctx[4].type) + " svelte-5t4r47"); |
|
|
|
this.first = span1; |
|
|
|
}, |
|
|
|
m(target, anchor) { |
|
|
@ -20268,7 +20269,7 @@ |
|
|
|
ctx = new_ctx; |
|
|
|
if (dirty & 1 && t0_value !== (t0_value = ctx[4].content + "")) |
|
|
|
set_data(t0, t0_value); |
|
|
|
if (dirty & 1 && span1_class_value !== (span1_class_value = null_to_empty(ctx[4].type) + " svelte-120v8nn")) { |
|
|
|
if (dirty & 1 && span1_class_value !== (span1_class_value = null_to_empty(ctx[4].type) + " svelte-5t4r47")) { |
|
|
|
attr(span1, "class", span1_class_value); |
|
|
|
} |
|
|
|
}, |
|
|
@ -20297,7 +20298,7 @@ |
|
|
|
for (let i = 0; i < each_blocks.length; i += 1) { |
|
|
|
each_blocks[i].c(); |
|
|
|
} |
|
|
|
attr(div, "class", "root svelte-120v8nn"); |
|
|
|
attr(div, "class", "root svelte-5t4r47"); |
|
|
|
}, |
|
|
|
m(target, anchor) { |
|
|
|
insert(target, div, anchor); |
|
|
@ -20431,9 +20432,35 @@ |
|
|
|
getCurrentBoard: V4chan.getCurrentBoard, |
|
|
|
getCurrentThread: V4chan.getCurrentThread |
|
|
|
}; |
|
|
|
var KChan = { |
|
|
|
getFileThumbnail: (post) => post.querySelector("figure.uploadCell"), |
|
|
|
getPost: (post) => post.querySelector(".innerPost"), |
|
|
|
postsWithFiles: (h) => [...(h || document).querySelectorAll(".postCell:has(figure)")], |
|
|
|
settingsHost: () => document.getElementById("navOptionsSpanThread"), |
|
|
|
catalogControlHost: () => document.getElementById("divTools"), |
|
|
|
getImageLink: async function* (post) { |
|
|
|
yield post.querySelector('a.imgLink[target="_blank"]')?.href || ""; |
|
|
|
}, |
|
|
|
getFilename: (post) => { |
|
|
|
const a = post.querySelector(".imgLink > img"); |
|
|
|
if (a && a.title) |
|
|
|
return a.title; |
|
|
|
return a?.textContent || ""; |
|
|
|
}, |
|
|
|
getMD5: (post) => "", |
|
|
|
getThumbnailLink: (post) => post.querySelector(".imgLink > img")?.getAttribute("src") || "", |
|
|
|
getInfoBox: (post) => post.querySelector("div.uploadDetails"), |
|
|
|
getPostIdPrefix: () => "", |
|
|
|
getTextBox: (post) => post.querySelector(".divMessage"), |
|
|
|
getCurrentBoard: () => location.pathname.split("/")[1], |
|
|
|
getCurrentThread: () => +location.pathname.split("/")[3] |
|
|
|
}; |
|
|
|
var getQueryProcessor = (is4chanX) => { |
|
|
|
if (["boards.4chan.org", "boards.4channel.org"].includes(location.host)) |
|
|
|
return is4chanX ? X4chan : V4chan; |
|
|
|
if (location.host == "kohlchan.net") { |
|
|
|
return KChan; |
|
|
|
} |
|
|
|
if (document.querySelector('meta[name="generator"]')?.getAttribute("content")?.startsWith("FoolFuuka")) |
|
|
|
return FoolFuuka; |
|
|
|
}; |
|
|
@ -21720,6 +21747,8 @@ |
|
|
|
} |
|
|
|
}, 5e3, { trailing: true }); |
|
|
|
var shouldUseCache = () => { |
|
|
|
if (location.host == "kohlchan.net") |
|
|
|
return false; |
|
|
|
if (cappState.isCatalog) |
|
|
|
return false; |
|
|
|
if (!csettings5) |
|
|
@ -21872,7 +21901,7 @@ |
|
|
|
if (cappState.isCatalog) |
|
|
|
op = +post.id.slice(2); |
|
|
|
else |
|
|
|
op = +location.pathname.match(/\/thread\/(.*)/)[1]; |
|
|
|
op = qp.getCurrentThread() || 0; |
|
|
|
if (shouldUseCache()) { |
|
|
|
res2 = await getEmbedsFromCache(qp.getCurrentBoard(), +qp.getCurrentThread(), post.id); |
|
|
|
} |
|
|
@ -22000,6 +22029,18 @@ Use the WebExtension version of PEE if you want to use b4k!`); |
|
|
|
qr.files = dt.files; |
|
|
|
}); |
|
|
|
} |
|
|
|
if (!document.body) { |
|
|
|
let bodyRes; |
|
|
|
const bodyInit = new Promise((r) => bodyRes = r); |
|
|
|
const mo2 = new MutationObserver((r) => { |
|
|
|
if (document.body) { |
|
|
|
mo2.disconnect(); |
|
|
|
bodyRes(); |
|
|
|
} |
|
|
|
}); |
|
|
|
mo2.observe(document.documentElement, { childList: true, subtree: true }); |
|
|
|
await bodyInit; |
|
|
|
} |
|
|
|
if (!cappState.isCatalog) { |
|
|
|
const mo = new MutationObserver((reco) => { |
|
|
|
for (const rec of reco) |
|
|
@ -22031,18 +22072,6 @@ Use the WebExtension version of PEE if you want to use b4k!`); |
|
|
|
mo.observe(e, { childList: true, subtree: true }); |
|
|
|
}); |
|
|
|
} |
|
|
|
if (!document.body) { |
|
|
|
let bodyRes; |
|
|
|
const bodyInit = new Promise((r) => bodyRes = r); |
|
|
|
const mo2 = new MutationObserver((r) => { |
|
|
|
if (document.body) { |
|
|
|
mo2.disconnect(); |
|
|
|
bodyRes(); |
|
|
|
} |
|
|
|
}); |
|
|
|
mo2.observe(document.documentElement, { childList: true, subtree: true }); |
|
|
|
await bodyInit; |
|
|
|
} |
|
|
|
document.addEventListener("QRDialogCreation", (e) => { |
|
|
|
const a = document.createElement("span"); |
|
|
|
const po = new PostOptions_default({ |
|
|
@ -22059,7 +22088,12 @@ Use the WebExtension version of PEE if you want to use b4k!`); |
|
|
|
} |
|
|
|
}; |
|
|
|
const obs = new MutationObserver(somethingChanged); |
|
|
|
if (!cappState.is4chanX) { |
|
|
|
if (location.host == "kohlchan.net") { |
|
|
|
target = e.detail; |
|
|
|
a.style.display = "inline-block"; |
|
|
|
const filesinp = target.querySelector("#selectedDivQr"); |
|
|
|
filesinp.parentElement?.appendChild(a); |
|
|
|
} else if (!cappState.is4chanX) { |
|
|
|
target = e.detail; |
|
|
|
a.style.display = "inline-block"; |
|
|
|
target.querySelector("input[type=submit]")?.insertAdjacentElement("beforebegin", a); |
|
|
@ -22072,6 +22106,21 @@ Use the WebExtension version of PEE if you want to use b4k!`); |
|
|
|
obs.observe(filesinp, { attributes: true }); |
|
|
|
} |
|
|
|
}, { once: !cappState.is4chanX }); |
|
|
|
if (location.host == "kohlchan.net") { |
|
|
|
setTimeout(() => { |
|
|
|
const no = document.querySelector("#quick-reply"); |
|
|
|
console.log("emitting qrdialog"); |
|
|
|
document.dispatchEvent(new CustomEvent("QRDialogCreation", { |
|
|
|
detail: no |
|
|
|
})); |
|
|
|
const s = document.createElement("script"); |
|
|
|
s.src = chrome.runtime.getURL("kohlchan-hooks.js"); |
|
|
|
s.onload = function() { |
|
|
|
s.remove(); |
|
|
|
}; |
|
|
|
(document.head || document.documentElement).appendChild(s); |
|
|
|
}, 1e3); |
|
|
|
} |
|
|
|
try { |
|
|
|
cp = new CommandProcessor(); |
|
|
|
} catch { |
|
|
@ -22080,7 +22129,7 @@ Use the WebExtension version of PEE if you want to use b4k!`); |
|
|
|
else |
|
|
|
fireNotification("error", "You may be using 4chanX\n\nGo to 4chanX's settings, Advanced > JS Whitelist and add 'blob:' without quotes to the list."); |
|
|
|
} |
|
|
|
if (!is4chanX && location.host.startsWith("boards.4chan")) { |
|
|
|
if (!is4chanX && location.host.startsWith("boards.4chan") || location.host == "kohlchan.net") { |
|
|
|
const notificationHost = document.createElement("span"); |
|
|
|
new NotificationsHandler_default({ |
|
|
|
target: notificationHost |
|
|
@ -22182,9 +22231,12 @@ Use the WebExtension version of PEE if you want to use b4k!`); |
|
|
|
}); |
|
|
|
document.addEventListener("ThreadUpdate", async (e) => { |
|
|
|
const newPosts = e.detail.newPosts; |
|
|
|
const qp2 = getQueryProcessor(cappState.is4chanX); |
|
|
|
if (!qp2) |
|
|
|
return; |
|
|
|
for (const post of newPosts) { |
|
|
|
const postContainer = document.getElementById("pc" + post.substring(post.indexOf(".") + 1)); |
|
|
|
const fn = qp.getFilename(postContainer); |
|
|
|
const postContainer = document.getElementById(qp2.getPostIdPrefix() + post.substring(post.indexOf(".") + 1)); |
|
|
|
const fn = qp2.getFilename(postContainer); |
|
|
|
if (fn) { |
|
|
|
if (!processed.has(postContainer.id)) { |
|
|
|
appState.update((v) => { |
|
|
|