du00.bookcase

cleanup

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name        du00.bookcase
// @namespace   zhang
// @include     http://www.du00.com/bookcase.php
// @version     1
// @grant       GM_log
// @description cleanup
// ==/UserScript==

var grid = document.querySelector('table.grid');
if (grid) {
    var rows = grid.getElementsByTagName('tr');
    for (var i = rows.length - 1; i > 0; i--) {
        var row = rows[i];
        var cells = row.getElementsByTagName('td');
        switch(cells.length) {
            case 6:
                var latest = cells[2].getElementsByTagName('a');
                var marked = cells[3].getElementsByTagName('a');
                if (latest.length == 1 && marked.length == 1 &&
                    latest[0].href == marked[0].href) {
                    cells[3].innerHTML = ' ';
                }
                break;
            case 0:
                if (row.getElementsByTagName('th').length == 6) {
                    //bookcase header
                    break;
                }
            case 1:
                if (cells[0].className == 'foot') {
                    //bookcase footer
                    break;
                }
            default:
                alert('invalid bookcase structure');
        }
    }
}