DMHYReadFilter

加深点击后的条目

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         DMHYReadFilter
// @namespace    https://github.com/lycloudqaq/ThreadViewed-Darker
// @version      1.1
// @description  加深点击后的条目
// @author       lycloud
// @match        *://share.dmhy.org/*
// @grant        GM_setValue
// @grant        GM_getValue
// ==/UserScript==


(function () {
    var filterTr = document.querySelectorAll("table#topic_list>tbody>tr.even");
    for (var i = 0; i < 40; i++) {
        filterTr[i].setAttribute("class", "odd")
    }
    filterTr = document.querySelector("table#topic_list");
    filterTr.setAttribute("border", "1");
    filterTr.setAttribute("style", "border-collapse: collapse;border-color: #000;");
})();

(function () {
    var readArray = [];
    readArray = readArray.concat(GM_getValue('read'));

    var aFilter = document.querySelectorAll('tr>.title>a');
    for (var i = 0; i < aFilter.length; i++) {
        var id = parseInt(aFilter[i].href.slice(35, 41));
        if (readArray.includes(id) == true) {
            aFilter[i].parentNode.parentNode.setAttribute("style", "background-color:#ccc;");
        }

        aFilter[i].addEventListener('mousedown', function () {
            id = parseInt(this.href.slice(35, 41));
            if (readArray.includes(id) == false) {
                readArray.push(id);
                if (readArray.length > 320) { readArray.shift() };
                GM_setValue('read', readArray);
                this.parentNode.parentNode.setAttribute("style", "background-color:#ccc;");
            }
        })
    }
})();