Qidian Get Chapter Date

Fetches and displays the chapter dates for Qidian books

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

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

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         Qidian Get Chapter Date
// @namespace    https://greasyfork.org/en/users/689482-quin15
// @version      1.1.0
// @description  Fetches and displays the chapter dates for Qidian books
// @author       Quin15
// @match        https://book.qidian.com/info/*
// @icon         https://www.google.com/s2/favicons?domain=qidian.com
// @grant        none
// ==/UserScript==

var checkElems = function() {if (document.querySelector('.volume .cf li')) {injectDates()} else {setTimeout(checkElems, 100);}};
checkElems();

var injectDates = function() {
    var chaplist = document.querySelectorAll('.volume .cf li')
    for (var i = 0; i < chaplist.length; i++) {
        var date = chaplist[i].firstElementChild.title.replace('首发时间:', '').substr(0, 10);
        var dateElem = document.createElement('div');
        dateElem.style = "width: 100%; color: #888; font-size: 12px; line-height: 0;";
        dateElem.innerText = date;
        chaplist[i].style.height = "50px";
        chaplist[i].firstElementChild.style.float = "none"
        chaplist[i].appendChild(dateElem)
    };
};