// ==UserScript==
// @name Komikspec – ukrywanie użytkowników + ich cytatów
// @namespace
http://tampermonkey.net/// @version 3.0
// @description Ukrywa posty wybranych użytkowników oraz cytaty ich wypowiedzi w postach innych osób, zastępując je komunikatem.
// @match
https://forum.komikspec.pl/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// <<< TU WPISZ BLOKOWANYCH UŻYTKOWNIKÓW >>>
const blocked = [
"NazwaUżytkownika1"
].map(x => x.toLowerCase().trim());
// --- FUNKCJA: ukrywanie całych postów ---
function hidePosts() {
document.querySelectorAll(".post_wrapper, .post, .windowbg, .windowbg2, .message").forEach(post => {
const author =
post.querySelector(".poster h4 a") ||
post.querySelector(".poster a") ||
post.querySelector(".username a") ||
post.querySelector(".poster_name a");
if (!author) return;
const name = author.textContent.trim().toLowerCase();
if (blocked.includes(name)) {
post.style.display = "none";
}
});
}
// --- FUNKCJA: ukrywanie cytatów i zamiana na komunikat ---
function hideQuotes() {
document.querySelectorAll("blockquote, .quote, .bbc_quote").forEach(q => {
let headerText = "";
const header = q.previousElementSibling;
if (header && header.classList.contains("quoteheader")) {
headerText = header.textContent.toLowerCase();
}
if (!headerText) {
headerText = q.textContent.toLowerCase().slice(0, 200);
}
const isBlocked = blocked.some(username =>
headerText.includes(username)
);
if (isBlocked) {
if (header) header.style.display = "none";
// Wstawienie komunikatu ZAMIAST cytatu
q.style.display = "block";
q.style.padding = "6px 8px";
q.style.background = "#eee";
q.style.borderLeft = "3px solid #999";
q.style.fontStyle = "italic";
q.textContent = "[Cytat ukrytego użytkownika]";
}
});
}
// --- URUCHAMIANIE ---
function main() {
hidePosts();
hideQuotes();
}
// start
main();
// obserwacja zmian (ładowanie dynamiczne)
const observer = new MutationObserver(main);
observer.observe(document.body, { childList: true, subtree: true });
})();