Mangaupdates - Custom releases page

Splits releases page into to areas. One for Novels and one for Mangas.

目前為 2015-07-13 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        Mangaupdates - Custom releases page
// @version     1
// @description Splits releases page into to areas. One for Novels and one for Mangas.
// @namespace   https://greasyfork.org/en/scripts/10937-mangaupdates-custom-releases-page
// @include     https://www.mangaupdates.com/releases.html*
// @include     http://www.mangaupdates.com/releases.html*
// @copyright   2015+, MiPo91
// @grant       none
// @require     http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js 
// ==/UserScript==

$( document ).ready(function() {

   // Otsikoiden laitto (paivamaarat)
   $(".titlesmall").each(function (){
       $(this).next().children().children().prepend('<tr><td width="44%" class="pad" style="background: rgb(240, 243, 247) none repeat scroll 0% 0%;"><b><a href="/releases.html?orderby=title">Title<span style="display:none;">(Novel)</span></a></b></td><td width="20%" class="pad" style="background: rgb(240, 243, 247) none repeat scroll 0% 0%;"><b><a href="/releases.html?">Release</a></b></td><td width="36%" class="pad" style="background: rgb(240, 243, 247) none repeat scroll 0% 0%;"><b><a href="/releases.html?orderby=groups">Groups</a></b></td></tr>');
       $(this).next().children().children().prepend("<tr><td colspan='3' style='background: #F0F3F7;font-size: 16px;padding:5px 0;'>" + $(this).text() + " (Novel)</td></tr>");
   });
    
    var novellit = [];
    
    $("#main_content div div tr:contains('(Novel)')").each(function () {
        $(this).children().removeAttr("bgcolor");        
        novellit.push($(this).html());
        
        $(this).remove();
    });
    
    var muut = "";
    
    $("#main_content .alt").each(function(){
         // Otsikoiden laitto (paivamaarat)
        $(this).children().prepend("<tr><td colspan='3' style='background: #F0F3F7;font-size: 16px;padding:5px 0;'>"+ $(this).prev().text()+"</td></tr>");
        // Vanhat varit pois pohjasta
        $(this).children().children().children().children().removeAttr("bgcolor");
        
        $(this).children().children().children().each(function(i, el) {
            if (i % 2 === 0) {}
            else { 
                $(el).children().css('background', '#F0F3F7');
            }
        });
        
        muut += $(this).html();
    });
    
    var sisusNovellit = '<div class="alt" style="width:49%; float:left; border:1px solid #ccc;overflow:hidden;"><table class="text" cellspacing="0" cellpadding="0" border="0">';
    var sisusMuut = '<div class="alt" style="width:49%; float:right; border:1px solid #ccc;overflow:hidden;">' + muut + '</div>';
    
    for(i = 0; i < novellit.length;i++) {
        j = i;
        if(j % 2 === 0) {
            sisusNovellit += "<tr style='padding: 3px;'>"+novellit[i]+"</tr>";        
        }else {
            sisusNovellit += "<tr style='background: #F0F3F7; padding: 3px;'>"+novellit[i]+"</tr>";       
        }
    }
    
    sisusNovellit += "</table></div>";
    
    var loput = "<div style='width: 100%;overflow:hidden;'>";
    loput += "<br /><center>" + $("#main_content div table:last").html() + "</center><br />";

    $("#main_content center").each(function() {
        loput += "<center>" + $(this).html() + "</center><br />";
    });
    loput += "</div>";
    
    $("#main_content div").html(sisusNovellit + sisusMuut);
    
    $("#main_content").append(loput);
    
});