Proxer_AnimeMangalisteZahlen

Fügt der Anime/Mangaliste einen Counter hinzu

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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+"]"; }
      }
    }
};