Proxer-Collapsable-Lists

Dieses Script bringt die zusammenklappbaren Anime-/Mangalisten aus dem Mobile Client ins Webinterface

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Proxer-Collapsable-Lists
// @namespace    
// @version      0.7
// @description  Dieses Script bringt die zusammenklappbaren Anime-/Mangalisten aus dem Mobile Client ins Webinterface
// @author       TheExoduser
// @match        *://*.proxer.me/ucp?s=*
// @require      https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js
// @run-at       document-end
// ==/UserScript==

$(document).ready(function() {
    var checkTrue = false;

    // Check if correct page
    if (window.location.href.indexOf('anime') > -1 || window.location.href.indexOf('manga') > -1) {
        checkTrue = true;
    }
    if (window.location.href.indexOf('ucp') === -1 || checkTrue === false || window.location.href.indexOf('forum') > -1) {
        return;
    }

    // Move first row to thead
    $("table#box-table-a").each(function(index) {
        var rowFirst = $(this).find("tr:first");

        $(this).find("tr:first").remove();
        $(this).prepend("<thead style=\"cursor:pointer;\">" + $(rowFirst).html() + "</thead>");
    });

    // Add +/- toggle icon to table head
    $("table#box-table-a:eq(1)").find("tr:first").html($("table#box-table-a:eq(1)").find("tr:first").html().replace("</th>","<span style=\"float:right;\">-</span></th>"));
    $("table#box-table-a").not(":eq(1)").each(function(index) {
        $(this).find("tr:first").html($(this).find("tr:first").html().replace("</th>","<span style=\"float:right;\">+</span></th>"));
    });

    // Hide all tbodys exept of the currently watching list
    $("table#box-table-a").not(":eq(1)").find('tbody').toggle();

    // Add events to toggle the tbodys on click
    $("th").click(function() {
        if ($(this).html().indexOf("+") >= 0) {
            $(this).html($(this).html().replace("+", "-"));
        } else {
            $(this).html($(this).html().replace("-", "+"));
        }

        $(this).closest('table').find('tbody').toggle("slow");
    });

    // Echo a loaded message
    console.warn("Proxer-Collapsable-Lists Userscript successfully loaded!");
});