AtCoder_submit_keyboard_shortcut

atcoderにおいてCtrl+Enterで提出ができるようになります

Від 26.04.2020. Дивіться остання версія.

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 or Violentmonkey 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.

(У мене вже є менеджер скриптів, дайте мені встановити його!)

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           AtCoder_submit_keyboard_shortcut
// @version        1.2
// @description    atcoderにおいてCtrl+Enterで提出ができるようになります
// @author         Osmium_1008
// @license        MIT
// @include        https://atcoder.jp/contests/*/tasks/*
// @include        https://atcoder.jp/contests/*/submit
// @include        https://*.contest.atcoder.jp/submit*
// @supportURL     https://twitter.com/Osmium_1008
// @namespace https://greatest.deepsurf.us/users/251827
// ==/UserScript==
(function() {
    document.addEventListener('keydown', function (event) {
        if ((event.ctrlKey||event.metaKey)&&event.keyCode==13){
            if((window.location.href).match(new RegExp('contests'))!=null){
                console.log("new");
                document.getElementById('submit').click();
            }
            else{
                console.log("old");
                (document.getElementsByClassName('btn btn-primary btn-large'))[0].click();
            }
        }
    }, false);
})();