Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

誤差許容設定を保存できるようにした #27

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
誤差許容設定を保存できるようにした
clcl777 committed Jul 20, 2023
commit 11f5bde4c2bd0e8e8f6de01713c65d4ba22a6564
3 changes: 3 additions & 0 deletions v2/atcoder-easy-test.user.js
Original file line number Diff line number Diff line change
@@ -2108,6 +2108,8 @@ var hTestAllSamples = "<button type=\"button\" id=\"atcoder-easy-test-btn-test-a
const eRun = E("run");
const eSetting = E("setting");
const eVersion = E("version");
let savedCheckboxValue = localStorage.getItem("allowableErrorCheckedState");
eAllowableErrorCheck.checked = (savedCheckboxValue === 'true');
eVersion.textContent = atCoderEasyTest.version.current;
events.on("enable", () => {
eRun.classList.remove("disabled");
@@ -2185,6 +2187,7 @@ var hTestAllSamples = "<button type=\"button\" id=\"atcoder-easy-test-btn-test-a
eAllowableError.disabled = !eAllowableErrorCheck.checked;
eAllowableErrorCheck.addEventListener("change", event => {
eAllowableError.disabled = !eAllowableErrorCheck.checked;
localStorage.setItem("allowableErrorCheckedState", String(eAllowableErrorCheck.checked));
});
}
// テスト実行
4 changes: 4 additions & 0 deletions v2/src/index.ts
Original file line number Diff line number Diff line change
@@ -94,6 +94,9 @@ const atCoderEasyTest = {
const eSetting = E<HTMLAnchorElement>("setting");
const eVersion = E<HTMLSpanElement>("version");

let savedCheckboxValue: string | null = localStorage.getItem("allowableErrorCheckedState");
eAllowableErrorCheck.checked = (savedCheckboxValue === 'true');

eVersion.textContent = atCoderEasyTest.version.current;

events.on("enable", () => {
@@ -176,6 +179,7 @@ const atCoderEasyTest = {
eAllowableError.disabled = !eAllowableErrorCheck.checked;
eAllowableErrorCheck.addEventListener("change", event => {
eAllowableError.disabled = !eAllowableErrorCheck.checked;
localStorage.setItem("allowableErrorCheckedState", String(eAllowableErrorCheck.checked));
});
}