您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add notes to AtCoder submissions
当前为
您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
- // ==UserScript==
- // @name AtCoder Submission Notes
- // @namespace https://greatest.deepsurf.us/users/your-username
- // @version 2.0.2
- // @description Add notes to AtCoder submissions
- // @author zerozero-0-0// ==UserScript==
- // @name AtCoder Submission Notes
- // @namespace https://greatest.deepsurf.us/users/your-username
- // @description Add notes to AtCoder submissions
- // @author zerozero-0-0
- // @match https://atcoder.jp/contests/*/submissions/me
- // @match https://atcoder.jp/contests/*/submissions/me?page=*
- // @grant none
- // @license MIT
- // ==/UserScript==
- (function () {
- "use strict";
- const contestIdMatch = location.pathname.match(/contests\/([^/]+)/);
- const contestId = contestIdMatch ? contestIdMatch[1] : "unknown_contest";
- const table = document.querySelector("table");
- if (!table) return;
- const headerRow = table.querySelector("thead tr");
- if (headerRow && !headerRow.querySelector(".note-header")) {
- const noteHeader = document.createElement("th");
- noteHeader.textContent = "Note";
- noteHeader.className = "note-header";
- headerRow.appendChild(noteHeader);
- }
- const rows = Array.from(document.querySelectorAll("tbody tr"));
- const n = rows.length;
- rows.forEach((row, i) => {
- const submissionLink = row.querySelector("a[href*='/submissions/']");
- const submissionId = submissionLink ? submissionLink.href.match(/submissions\/(\d+)/)[1] : `unknown_${i}`;
- const noteKey = `atcoder_note_${contestId}_row_${submissionId}`;
- const td = document.createElement("td");
- td.style.minWidth = "200px";
- const textarea = document.createElement("textarea");
- textarea.style.width = "100%";
- textarea.style.height = "50px";
- textarea.value = localStorage.getItem(noteKey) || "";
- textarea.addEventListener("input", (event) => {
- localStorage.setItem(noteKey, event.target.value);
- });
- td.appendChild(textarea);
- row.appendChild(td);
- });
- })();
- // @match https://atcoder.jp/contests/*/submissions/me
- // @match https://atcoder.jp/contests/*/submissions/me?page=*
- // @grant none
- // @license MIT
- // ==/UserScript==
- (function () {
- "use strict";
- const contestIdMatch = location.pathname.match(/contests\/([^/]+)/);
- const contestId = contestIdMatch ? contestIdMatch[1] : "unknown_contest";
- const table = document.querySelector("table");
- if (!table) return;
- const headerRow = table.querySelector("thead tr");
- if (headerRow && !headerRow.querySelector(".note-header")) {
- const noteHeader = document.createElement("th");
- noteHeader.textContent = "Note";
- noteHeader.className = "note-header";
- headerRow.appendChild(noteHeader);
- }
- const rows = Array.from(document.querySelectorAll("tbody tr"));
- const n = rows.length;
- rows.forEach((row, i) => {
- const submissionLink = row.querySelector("a[href*='/submissions/']");
- const submissionId = submissionLink ? submissionLink.href.match(/submissions\/(\d+)/)[1] : "unknown_${i}";
- const noteKey = `atcoder_note_${contestId}_row_${submissionId}`;
- const td = document.createElement("td");
- td.style.minWidth = "200px";
- const textarea = document.createElement("textarea");
- textarea.style.width = "100%";
- textarea.style.height = "50px";
- textarea.value = localStorage.getItem(noteKey) || "";
- textarea.addEventListener("input", (event) => {
- localStorage.setItem(noteKey, event.target.value);
- });
- td.appendChild(textarea);
- row.appendChild(td);
- });
- })();