fix: teacher name format, non-bold total, total row spacing, year-level show/custom/smart settings

This commit is contained in:
adrianbonpin
2026-08-19 02:12:06 +08:00
parent 106900860a
commit cb47d6faac
6 changed files with 97 additions and 15 deletions
+12 -4
View File
@@ -19,13 +19,21 @@ $('#masterToggle').addEventListener('change', async (e) => {
});
// ---- PDF settings: truncate long course descriptions (default ON) ----
async function loadTruncate() {
const { truncateDescription } = await browser.storage.local.get('truncateDescription');
$('#truncateToggle').checked = truncateDescription !== false;
async function loadPdfSettings() {
const s = await browser.storage.local.get(['truncateDescription', 'showYearLevel', 'customYearLevel']);
$('#truncateToggle').checked = s.truncateDescription !== false;
$('#showYearToggle').checked = s.showYearLevel !== false;
$('#customYear').value = s.customYearLevel || '';
}
$('#truncateToggle').addEventListener('change', async (e) => {
await browser.storage.local.set({ truncateDescription: e.target.checked });
});
$('#showYearToggle').addEventListener('change', async (e) => {
await browser.storage.local.set({ showYearLevel: e.target.checked });
});
$('#customYear').addEventListener('change', async (e) => {
await browser.storage.local.set({ customYearLevel: e.target.value.trim() });
});
// ---- Profiles ----
async function getProfiles() {
@@ -113,6 +121,6 @@ $('#saveProfile').addEventListener('click', async () => {
// ---- Init ----
(async function init() {
await loadMaster();
await loadTruncate();
await loadPdfSettings();
renderProfiles(await getProfiles());
})();