8chan stuff
CSS
JS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | window.addEventListener("load", (event) => {
// Fixes bug that prevents nested inline quotes by doing a null fallback
tooltips.quoteAlreadyAdded = function(quoteUrl, innerPost) {
var previews = innerPost.getElementsByClassName("replyPreview")[0];
var message = innerPost.getElementsByClassName("divMessage")[0];
if (!message) return
return Array.from(message.children).concat(Array.from(previews?.children || [])).reduce((acc, preview) => {
var linkSelf = preview.getElementsByClassName("linkSelf")[0];
return acc || (linkSelf && linkSelf.href === quoteUrl)
}, false)
}
// Fixes ANOTHER bug that prevents nested inline quotes by doing a null fallback
hiding.buildPostFilterId = function(linkSelf, id) {
if (id === undefined) return;
var checkbox = linkSelf.parentNode.getElementsByClassName('deletionCheckBox')[0];
var postData = checkbox?.name?.split('-') || [];
var board = postData[0];
var threadId = postData[1];
return board + '-' + threadId + '-' + id;
};
//Fixes ANOTHER massive bug with backlink Tooltips
posting.addExternalExtras = function(ret, noTooltips) {
var innerPost = ret.innerPost;
var linkSelf = ret.linkSelf;
var postInfo = ret.postInfo;
posting.processIdLabel(innerPost.getElementsByClassName("labelId")[0]);
//(You)s
if (posting.yous && posting.yous.indexOf(+postInfo.post) !== -1) {
posting.markPostAsYou(postInfo.post, innerPost);
}
//load posting menu, hiding menu, and watcher
//TODO: coalesce files?
if (typeof postingMenu !== "undefined") {
interfaceUtils.addMenuDropdown(ret, "Post Menu",
"extraMenuButton", postingMenu.buildMenu);
}
if (typeof hiding !== "undefined") {
interfaceUtils.addMenuDropdown(ret, "Hide",
"hideButton", hiding.buildMenu);
}
if (typeof watcher !== "undefined") {
if (postInfo.op)
watcher.processOP(innerPost);
}
if (typeof qr !== "undefined") {
var linkQuote = innerPost.getElementsByClassName('linkQuote')[0];
linkQuote.onclick = function() {
qr.showQr(linkQuote.href.match(/#q(\d+)/)[1]);
};
}
if (typeof tooltips !== "undefined") {
Array.from(innerPost.getElementsByClassName('quoteLink'))
.forEach((quote) => {
var target = api.parsePostLink(quote.href);
tooltips.processQuote(quote, false, noTooltips);
if (!posting.yous) return;
if (api.boardUri === target.board && posting.yous.indexOf(+target.post) !== -1)
quote.classList.add("you");
});
Array.from(innerPost.querySelectorAll(".panelBacklinks a")).forEach((quote) => {
var target = api.parsePostLink(quote.href);
tooltips.processQuote(quote, true, noTooltips);
if (!posting.yous) return;
if (api.boardUri === target.board && posting.yous.indexOf(+target.post) !== -1)
quote.classList.add("you");
});
}
};
//Fixes ANOTHER massive but with inlining backlinks
tooltips.addInlineClick = function(quote, innerPost, isBacklink, quoteTarget, sourceId) {
quote.addEventListener("click", function(e) {
if (!tooltips.inlineReplies)
return;
e.preventDefault();
var replyPreview = Array.from(innerPost.children)
.find((a) => a.className === "replyPreview");
var divMessage = innerPost.getElementsByClassName("divMessage")[0];
if (tooltips.loadingPreviews[quoteTarget.quoteUrl] ||
tooltips.quoteAlreadyAdded(quoteTarget.quoteUrl, innerPost))
return;
var placeHolder = document.createElement("div");
placeHolder.style.whiteSpace = "normal";
placeHolder.className = "inlineQuote";
tooltips.loadTooltip(placeHolder, quoteTarget.quoteUrl, true, true);
if (!placeHolder.getElementsByClassName("linkSelf"))
return;
var close = document.createElement("A");
close.innerText = "X";
close.onclick = function() {
placeHolder.remove();
}
close.style.className = "closeInline";
placeHolder.getElementsByClassName("postInfo")[0].prepend(close);
Array.from(placeHolder.getElementsByClassName("quoteLink"))
.forEach((a) => tooltips.processQuote(a, false, true));
if (tooltips.bottomBacklinks) {
var alts = placeHolder.getElementsByClassName("altBacklinks")[0].firstChild
Array.from(alts.children)
.forEach((a) => tooltips.processQuote(a, true));
}
if (isBacklink) {
innerPost.append(placeHolder);
} else {
quote.insertAdjacentElement("afterEnd", placeHolder);
}
tooltips.removeIfExists();
})
}
});
|
Waifu Image
Adds a fun little image of your waifu encoded in base64 like oneechan. Don't forget to add the .waifu
css code from above
JS