Antik alias kokotkokot

Skript sloužící k ignorování antikakokota v diskuzích na fandimefilmu.cz

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Antik alias kokotkokot
// @namespace    fandimefilmu.cz
// @version      2025-02-10
// @description  Skript sloužící k ignorování antikakokota v diskuzích na fandimefilmu.cz
// @author       Karel
// @match        https://www.fandimefilmu.cz/komentare/*
// @icon         https://www.fandimefilmu.cz/assets/images/favicon.png
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    var ignore = "antikantik | Fandíme filmu";
    var count = 0;

   var comments = document.querySelectorAll(".comment-box"); // Vybere všechny .comment-box

    comments.forEach(function(comment) {
        var avatarImg = comment.querySelector(".comment-avatar-box img"); // Najde <img> uvnitř .comment-avatar-box

        if (avatarImg && avatarImg.getAttribute("alt")?.trim() === ignore) {
            comment.parentNode.removeChild(comment); // Smaže celý .comment-box
            count++;
        }
    });

  var text = " | Komentáře jsou bez antika!";
   if (count > 0){
     text = ' | ' + (parseInt(document.getElementById("num-comments").textContent, 10) - count) + ' - bez antika!';
   }
  document.getElementById("num-comments").textContent += text;


})();