feat: add option to truncate long course descriptions to single line (default on, matches official PDF)
This commit is contained in:
@@ -18,6 +18,15 @@ $('#masterToggle').addEventListener('change', async (e) => {
|
||||
$('#masterLabel').textContent = e.target.checked ? 'Enabled' : 'Disabled';
|
||||
});
|
||||
|
||||
// ---- PDF settings: truncate long course descriptions (default ON) ----
|
||||
async function loadTruncate() {
|
||||
const { truncateDescription } = await browser.storage.local.get('truncateDescription');
|
||||
$('#truncateToggle').checked = truncateDescription !== false;
|
||||
}
|
||||
$('#truncateToggle').addEventListener('change', async (e) => {
|
||||
await browser.storage.local.set({ truncateDescription: e.target.checked });
|
||||
});
|
||||
|
||||
// ---- Profiles ----
|
||||
async function getProfiles() {
|
||||
const { profiles } = await browser.storage.local.get(PROFILES_KEY);
|
||||
@@ -104,5 +113,6 @@ $('#saveProfile').addEventListener('click', async () => {
|
||||
// ---- Init ----
|
||||
(async function init() {
|
||||
await loadMaster();
|
||||
await loadTruncate();
|
||||
renderProfiles(await getProfiles());
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user