Sona Systems available studies

Hide studies with no available timeslots on sona-systems websites

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.

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.

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

// ==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()
});