Sona Systems available studies

Hide studies with no available timeslots on sona-systems websites

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

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

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

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

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

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name            Sona Systems available studies
// @description     Hide studies with no available timeslots on sona-systems websites
// @version         1.0
// @namespace       https://www.github.com/sh0oki/sona-hider
// @source          https://www.github.com/sh0oki/sona-hider
// @include         https://*.sona-systems.com/all_exp_participant.aspx
// @copyright       2018, sh0oki
// ==/UserScript==

function mainWrapper() {
    function toggleDisplay() {
        tr_selector = $('table tbody tr:not(:has(a.btn))');
        tr_selector.toggle();
    }

    function main() {
        toggleDisplay();
        $(".m-bot15").after("<div class=\"input-group input-large m-bot15\">" + 
                            "<a href=\"#\" class=\"btn btn-primary btn-xs\" " + 
                            "onclick=\"$('table tbody tr:not(:has(a.btn))').toggle(); return false\">" + 
                            "Toggle Hidden rows</a>" + 
                            "</div>");
    }

    main();
};

$(document).ready(function() {
    mainWrapper()
});