Proxer_AnimeMangalisteZahlen

Fügt der Anime/Mangaliste einen Counter hinzu

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Proxer_AnimeMangalisteZahlen
// @author      Dravorle
// @description Fügt der Anime/Mangaliste einen Counter hinzu
// @include     *proxer.me*
// @version     1.2.1 Wechsel zu OnLoad, da Chrome scheinbar Ready nicht checkt
// @grant       none
// @namespace https://greasyfork.org/users/12783
// ==/UserScript==
var scriptName = "Proxer_AnimeMangalisteZahlen";

$(window).on("load", function() {
  $(document).ajaxSuccess (function () {
    run();
  });
  run();
});

var run = function() {
  if(   !(window.location.href.indexOf("proxer.me/ucp?s=anime") >= 0)
     && !(window.location.href.indexOf("proxer.me/ucp?s=manga") >= 0)
     && !(window.location.href.indexOf("proxer.me/user") >= 0 && window.location.href.indexOf("/anime") >= 0)
     && !(window.location.href.indexOf("proxer.me/user") >= 0 && window.location.href.indexOf("/manga") >= 0) 
    ) {
    return;
  }
  
  var intCount;
  
  var tables = $("table");
  var ucp = false;
  if(window.location.href.indexOf("proxer.me/ucp") >= 0) {
    ucp = true;
  }
  /*
  * menuLinks/tables[0] > geschaut / gelesen
  * menuLinks/tables[1] > am Schauen / am Lesen
  * menuLinks/tables[2] > wird noch geschaut / wird noch gelesen
  * menuLinks/tables[3] > abgebrochen / abgebrochen
  */
    
  if(tables[0].rows[0].cells[0].innerHTML == "Geschaut" || tables[0].rows[0].cells[0].innerHTML == "Gelesen")
    {
      for(i=0; i<tables.length; i++) {
        if(tables[i].rows[2].cells[0].innerHTML == "Keine Einträge.") {
          intCount = 0;
        } else {
          intCount = (tables[i].rows.length -2);
        }
        tables[i].rows[0].cells[0].innerHTML += " ["+intCount+"]";
        if(ucp) { $("a.menu")[i].innerHTML += " ["+intCount+"]"; }
      }
    }
};