Greasy Fork

来自缓存

Greasy Fork is available in English.

MD Mark All Chapters Read

OBSOLETE!! Mark all visible chapters read. If there are too many chapters for one page you will need to do each page separately.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         MD Mark All Chapters Read
// @namespace    ultrabenosaurus.MangaDex
// @version      0.5
// @description  OBSOLETE!! Mark all visible chapters read. If there are too many chapters for one page you will need to do each page separately.
// @author       Ultrabenosaurus
// @license      GNU AGPLv3
// @source       http://greasyfork.icu/en/users/437117-ultrabenosaurus?sort=name
// @match        https://mangadex.org/title/*
// @icon         https://www.google.com/s2/favicons?domain=mangadex.org
// @grant        none
// ==/UserScript==


(function() {
    'use strict';

    if(document.querySelectorAll('span.chapter_mark_read_button.grey').length!=0&&document.querySelectorAll('div.btn-group button.btn.dropdown-toggle span.fa-eye').length!=0){
        //UBaddMarkAllButton();
    }
})();

function UBaddMarkAllButton(){
    var mrElem = '<button class="btn btn-secondary" id="UBmarkAll"><span class="fas fa-eye fa-fw " aria-hidden="true" title="Mark All Read"></span> <span class="d-none d-xl-inline">Mark read</span></button>';
    document.querySelectorAll('button.btn.btn-warning.float-right[data-target="#manga_report_modal"]')[0].insertAdjacentHTML("beforebegin", mrElem);

    var mrBtn = document.getElementById('UBmarkAll');
    if(mrBtn){
        mrBtn.addEventListener("click", UBmarkAll, false);
    }
}

function UBremoveMarkAllButton(){
    document.getElementById('UBmarkAll').removeEventListener("click", UBmarkAll);
    document.getElementById('UBmarkAll').remove();
}

function UBmarkAll(){
    var chaps=document.querySelectorAll('span.chapter_mark_read_button.grey');
    for (var chap in chaps) {
        if (chaps.hasOwnProperty(chap)) {
            chaps[chap].click();
        }
    }
    UBremoveMarkAllButton();
}