AtCoder Submission Notes

Add notes to AtCoder submissions

2025-03-03 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

  1. // ==UserScript==
  2. // @name AtCoder Submission Notes
  3. // @namespace https://greatest.deepsurf.us/users/your-username
  4. // @version 1.1
  5. // @description Add notes to AtCoder submissions
  6. // @author zerozero-0-0
  7. // @match https://atcoder.jp/contests/*/submissions/me
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function () {
  13. "use strict";
  14.  
  15. // メモを保存・取得するためのキー生成関数
  16. function getNoteKey(submissionId) {
  17. return `atcoder_note_${submissionId}`;
  18. }
  19.  
  20. // 各提出にメモ欄を追加
  21. document.querySelectorAll("tbody tr").forEach((row) => {
  22. const link = row.querySelector('a[href*="/submissions/"]');
  23. if (!link) return;
  24.  
  25. const submissionId = link.href.split("/").pop();
  26. const noteKey = getNoteKey(submissionId);
  27.  
  28. // メモ欄の作成
  29. const td = document.createElement("td");
  30. const textarea = document.createElement("textarea");
  31. textarea.style.width = "100%";
  32. textarea.style.height = "50px";
  33. textarea.value = localStorage.getItem(noteKey) || "";
  34.  
  35. // 保存ボタン
  36. const saveButton = document.createElement("button");
  37. saveButton.textContent = "💾";
  38. saveButton.style.marginLeft = "5px";
  39. saveButton.onclick = () => {
  40. localStorage.setItem(noteKey, textarea.value);
  41. };
  42.  
  43. td.appendChild(textarea);
  44. td.appendChild(saveButton);
  45. row.appendChild(td);
  46. });
  47. })();