Mangaupdates - Custom releases page

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

当前为 2015-07-13 提交的版本,查看 最新版本

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

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

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

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

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