mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 11:44:40 +00:00
refactor: Optimize element search and remove unused code in SEQTA.ts and injected.scss
This commit is contained in:
@@ -16,18 +16,15 @@ export async function AddBetterSEQTAElements() {
|
||||
handleStudentData();
|
||||
createNewsButton();
|
||||
setupEventListeners();
|
||||
}
|
||||
|
||||
appendBackgroundToUI();
|
||||
addExtensionSettings();
|
||||
if (settingsState.onoff) {
|
||||
appendBackgroundToUI();
|
||||
await createSettingsButton();
|
||||
await addDarkLightToggle();
|
||||
customizeMenuToggle();
|
||||
} else {
|
||||
await createSettingsButton();
|
||||
}
|
||||
|
||||
addExtensionSettings();
|
||||
if (!settingsState.onoff) await createSettingsButton();
|
||||
|
||||
setupSettingsButton();
|
||||
}
|
||||
|
||||
@@ -212,9 +209,13 @@ function setupEventListeners() {
|
||||
}
|
||||
|
||||
async function createSettingsButton() {
|
||||
let SettingsButton = stringToHTML(
|
||||
'<button class="addedButton tooltip" id="AddedSettings"><svg width="24" height="24" viewBox="0 0 24 24"><g><g><path d="M23.182,6.923c-.29,0-3.662,2.122-4.142,2.4l-2.8-1.555V4.511l4.257-2.456a.518.518,0,0,0,.233-.408.479.479,0,0,0-.233-.407,6.511,6.511,0,1,0-3.327,12.107,6.582,6.582,0,0,0,6.148-4.374,5.228,5.228,0,0,0,.333-1.542A.461.461,0,0,0,23.182,6.923Z"></path><path d="M9.73,10.418,7.376,12.883c-.01.01-.021.016-.03.025L1.158,19.1a2.682,2.682,0,1,0,3.793,3.793l4.583-4.582,0,0,4.1-4.005-.037-.037A9.094,9.094,0,0,1,9.73,10.418ZM3.053,21.888A.894.894,0,1,1,3.946,21,.893.893,0,0,1,3.053,21.888Z"></path></g></g></svg><div class="tooltiptext topmenutooltip">BetterSEQTA+ Settings</div></button>'
|
||||
);
|
||||
let SettingsButton = stringToHTML( /* html */`
|
||||
<button class="addedButton tooltip" id="AddedSettings">
|
||||
<svg width="24" height="24" viewBox="0 0 24 24">
|
||||
<g><g><path d="M23.182,6.923c-.29,0-3.662,2.122-4.142,2.4l-2.8-1.555V4.511l4.257-2.456a.518.518,0,0,0,.233-.408.479.479,0,0,0-.233-.407,6.511,6.511,0,1,0-3.327,12.107,6.582,6.582,0,0,0,6.148-4.374,5.228,5.228,0,0,0,.333-1.542A.461.461,0,0,0,23.182,6.923Z"></path><path d="M9.73,10.418,7.376,12.883c-.01.01-.021.016-.03.025L1.158,19.1a2.682,2.682,0,1,0,3.793,3.793l4.583-4.582,0,0,4.1-4.005-.037-.037A9.094,9.094,0,0,1,9.73,10.418ZM3.053,21.888A.894.894,0,1,1,3.946,21,.893.893,0,0,1,3.053,21.888Z"></path></g></g>
|
||||
</svg>
|
||||
</button>
|
||||
`);
|
||||
let ContentDiv = document.getElementById('content');
|
||||
ContentDiv!.append(SettingsButton.firstChild!);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user