Skip to content

Instantly share code, notes, and snippets.

@tan9
Last active February 10, 2022 02:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tan9/df262289574f8c1db32e5705b8cddabc to your computer and use it in GitHub Desktop.
Save tan9/df262289574f8c1db32e5705b8cddabc to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name 臺中市校園閱讀認證小幫手
// @description 在「臺中市國民小學推動校園閱讀線上認證系統」將認證題目改用注音字型顯示、增加快捷鍵等,方便認證。
// @version 0.2.1
// @author Pei-Tang Huang
// @downloadURL https://gist.githubusercontent.com/tan9/df262289574f8c1db32e5705b8cddabc/raw/
// @updateURL https://gist.githubusercontent.com/tan9/df262289574f8c1db32e5705b8cddabc/raw/
// @match *://read.tc.edu.tw/*
// @require https://cdnjs.cloudflare.com/ajax/libs/mousetrap/1.6.3/mousetrap.min.js
// @require https://code.jquery.com/jquery-3.4.1.min.js
// ==/UserScript==
(function() {
"use strict";
const $ = jQuery;
// 改用注音字體
$("span")
.filter((i, e) => $(e).css("font-family") === "標楷體")
.css(
"font-family",
"華康標楷W5注音,文鼎標楷注音,王漢宗中楷體注音,標楷體"
);
// 為選項加上快捷鍵
$('input[type="radio"][name="my_answer"]')
.before(i => `<kbd>${i + 1}</kbd>`)
.each((i, e) =>
Mousetrap.bind(e.value, () => {
e.checked = true;
$('input[type="submit"]').click();
})
);
// 自動跳過跳到下一題
if ($('input[value="下一題"')) {
setTimeout(() => $('input[value="下一題"').click(), 1500);
}
})();
@tan9
Copy link
Author

tan9 commented Feb 10, 2022

@ljc0224 阿吉老師好,看起來是第 4 步的連結指到了某個特定的版本,已經改指到最新的版本囉。

@ljc0224
Copy link

ljc0224 commented Feb 10, 2022

謝謝您!:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment