您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
atcoder keyboard shortcuts
// ==UserScript== // @name atcoder-keyboard-shortcuts // @namespace https://halmk.github.io/ // @version 0.1 // @description atcoder keyboard shortcuts // @author springroll // @match https://atcoder.jp/contests/*/tasks/* // @grant none // @require https://unpkg.com/hotkeys-js/dist/hotkeys.min.js // ==/UserScript== (function() { 'use strict'; var copySample = function(index) { window.getSelection().removeAllRanges(); try { var range = document.createRange(); range.selectNode($('#pre-sample'+(2*(index-1))).get(0)); window.getSelection().addRange(range); document.execCommand('copy'); } catch (err) { console.log(err); } alert("Copied Sample" + index + "."); window.getSelection().removeAllRanges(); }; var pasteSourceCode = function() { try { var pasteArea = document.getElementsByTagName('textarea')[0]; pasteArea.focus(); document.execCommand('paste'); } catch (err) { console.log(err); } }; var submitCode = function() { try { var btn = document.getElementById('submit'); btn.click(); } catch (err) { console.log(err); } }; hotkeys('shift+1,shift+2,shift+3,shift+4,shift+5', function (event, handler){ switch (handler.key) { case 'shift+1': copySample(1); break; case 'shift+2': copySample(2); break; case 'shift+3': copySample(3); break; case 'shift+4': copySample(4); break; case 'shift+5': copySample(5); break; default: alert(event); } }); hotkeys('shift+a, cmd+shift+s', function (event, handler) { switch (handler.key) { case 'shift+a': pasteSourceCode(); break; case 'cmd+shift+s': submitCode(); break; default: alert(event); } }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址