Simply Step 4

Simplify view of BGG Math Trades Step 4

目前為 2014-07-01 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        Simply Step 4
// @namespace   http://userscripts.org
// @description Simplify view of BGG Math Trades Step 4
// @include     http://bgg.activityclub.org/olwlg/mywants.cgi*
// @require     https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
// @version     0.2
// @grant       none
// ==/UserScript==
//hide lines that are associated with dummy itens

    $('#wants .ondummy').each(function () {
        $(this).hide();
    });

    //hide columns with green text. It hides based on index, and the last row is trick because it has on less td

    $('#wants tr.head tt font[color="green"]') .each(function () {
        var tt = $(this).parent().parent();
        var tohideth = tt.index() + 1;
        var tohidelr = tohideth - 1;
        $('#wants tr:not(:last-child) td:nth-child(' + tohideth + ')').hide().addClass("dummyitemcontainer");
        $('#wants th:nth-child(' + tohideth + ')') .hide().addClass("dummyitemcontainer");
        $('#wants tr:last-child td:nth-child(' + tohidelr + ')') .hide().addClass("dummyitemcontainer");
    });

    //adjust table size
    $('#wants tbody') .css('height', 'auto');

    $('<td/>', {
        id: "hideshow",
        html: "Toggle Dummy Association"
    }).insertAfter($('#tabofficial1'));

    $('#hideshow').click(function () {
        $('.dummyitemcontainer').toggle();
    });