Greasy Fork is available in English.

TornAPI Toggles

Hide/Unhide API requests on Torn API "try it" page

18.04.2020 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         TornAPI Toggles
// @namespace    Heasleys.TornApiToggles
// @version      1.0
// @description  Hide/Unhide API requests on Torn API "try it" page
// @author       Heasleys4hemp [1468764]
// @match       *.torn.com/api.html*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var i = 0;

    $(document).ajaxComplete(function( event, request, settings ) {

        if (settings.url.includes('api.torn.com')){
            $('div > span > h4').each(function() {
                let pre = $(this).next();

                let a = '<a data-toggle="collapse" href="#selection_' + i + '" aria-expanded="false" aria-controls="selection_' + i + '" class="collapsed"></a>';
                let d = '<div id="selection_' + i + '" class="panel-collapse collapse" role="tabpanel" aria-labelledby="selection_' + i + '"></div>';

                $(this).wrap(a);
                pre.wrap(d);

                i++;
            });
        }

    });

})();