AtCoder_CustomTest_Run_Shortcut

AtCoderのコードテストにおいてCtrl+Enterで実行ができるようになります。You can run by using Ctrl + Enter in Custom Test of AtCoder

Verze ze dne 28. 10. 2022. Zobrazit nejnovější verzi.

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

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 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         AtCoder_CustomTest_Run_Shortcut
// @namespace    https://greatest.deepsurf.us/ja/users/570127
// @version      0.1.2
// @description  AtCoderのコードテストにおいてCtrl+Enterで実行ができるようになります。You can run by using Ctrl + Enter in Custom Test of AtCoder
// @author       universato
// @grant        none
// @match        https://atcoder.jp/contests/*/custom_test
// @match        https://atcoder.jp/contests/*/custom_tets*
// @license      MIT
// @supportURL   https://twitter.com/universato
// ==/UserScript==

(function() {
    document.addEventListener('keydown', function (event) {
        if ((event.ctrlKey||event.metaKey)&&event.keyCode==13){
            var elements = document.getElementsByClassName('btn btn-primary');
            for(var i = 0; i < elements.length; ++i){
                // console.log(elements[i].innerHTML)
                if(elements[i].innerHTML == "実行"){
                    elements[i].click();
                }
            }
        }
    }, false);
})();