您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Apply the same coloring as the atcoder-tasks-page-colorizer in the drop-down menu of tasks added by Comfortable AtCoder.
当前为
// ==UserScript== // @name atcoder-tasks-dropdown-menu-colorizer // @namespace https://twitter.com/KakurenboUni // @version 1.0.0 // @require https://greatest.deepsurf.us/scripts/437862-atcoder-problems-api/code/atcoder-problems-api.js?version=1004082 // @match https://atcoder.jp/* // @description Apply the same coloring as the atcoder-tasks-page-colorizer in the drop-down menu of tasks added by Comfortable AtCoder. // @author uni_kakurenbo // @license MIT // @supportURL https://twitter.com/KakurenboUni // ==/UserScript== getSubmissions(userScreenName).then(colorize); function colorize(problems_info) { let tabs = document.querySelector(".nav-tabs").querySelectorAll("li"); const tasks = [].find.call(tabs, (tab) => tab?.innerText.match(/問題|Tasks/ig)); tasks.querySelector(".dropdown-menu").querySelectorAll("li").forEach((y) => { const problem_id = y.querySelector('a').getAttribute('href').split('/').pop(); const trial = problems_info.filter(x => x.problem_id == problem_id); if(trial.length != 0) y.classList.add(trial.map(x => x.result).includes('AC') ? 'bg-success' : 'bg-warning'); }); }