Simply Step 4

Simplify view of BGG Math Trades Step 4

As of 2014-07-01. See the latest version.

// ==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.1
// @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;
        console.log('Ola');
        var tohidelr = tohideth - 1;
        $('#wants tr:not(:last-child) td:nth-child(' + tohideth + ')') .hide();
        $('#wants th:nth-child(' + tohideth + ')') .hide();
        $('#wants tr:last-child td:nth-child(' + tohidelr + ')') .hide();
    });
    

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