Compare commits

..

10 Commits

Author SHA1 Message Date
SethBurkart123 0ef0078fb7 bump(version): 3.4.3 + changelog 2025-02-03 13:00:09 +11:00
SethBurkart123 834b8b41af chore: clean up source files 2024-12-05 18:10:32 +11:00
SethBurkart123 f1512ba6e1 chore: clean up code 2024-12-05 14:43:12 +11:00
SethBurkart123 13fc077686 bump(version): 3.4.2 + changelog 2024-12-05 14:38:02 +11:00
SethBurkart123 7cf765121c fix(style): z-index of panels increased 2024-12-05 14:36:04 +11:00
SethBurkart123 4e393f14bb fix: enable assessments average by default 2024-12-05 14:35:23 +11:00
Seth Burkart 98347e038d Merge pull request #192 from ar-cyber/patch-16
Add mention for grades calc in readme
2024-12-03 17:23:35 +11:00
Andrew R f2bdb22ea8 fix(doc): make the readme mention the grade calculator 2024-12-03 13:52:16 +10:30
SethBurkart123 4afab2c52a perf: refactor AddBetterSEQTAElements for improved performance 2024-12-03 07:15:50 +11:00
SethBurkart123 4c6b43d7c7 fix(initial): make assessments average enabled by default 2024-12-03 06:59:06 +11:00
7 changed files with 92 additions and 62 deletions
+1
View File
@@ -43,6 +43,7 @@
- Easier Access Notices - Easier Access Notices
- Assessments - Assessments
- Options to remove certain items from the side menu - Options to remove certain items from the side menu
- Grades calculator
- Fully customisable themes and an offical theme store - Fully customisable themes and an offical theme store
- Notification for next lesson (sent 5 minutes before end of the lesson) - Notification for next lesson (sent 5 minutes before end of the lesson)
- Browser Support - Browser Support
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "betterseqtaplus", "name": "betterseqtaplus",
"version": "3.4.1", "version": "3.4.3",
"type": "module", "type": "module",
"description": "Enhance SEQTA Learn's usability and aesthetics! A fork of BetterSEQTA to continue development, while incorporating a plethora of new and improved features!", "description": "Enhance SEQTA Learn's usability and aesthetics! A fork of BetterSEQTA to continue development, while incorporating a plethora of new and improved features!",
"browserslist": "> 0.5%, last 2 versions, not dead", "browserslist": "> 0.5%, last 2 versions, not dead",
@@ -69,7 +69,7 @@
"@uiw/codemirror-theme-github": "^4.23.3", "@uiw/codemirror-theme-github": "^4.23.3",
"@vitejs/plugin-react": "^4.3.1", "@vitejs/plugin-react": "^4.3.1",
"autoprefixer": "^10.4.20", "autoprefixer": "^10.4.20",
"caniuse-lite": "^1.0.30001684", "caniuse-lite": "^1.0.30001696",
"classnames": "^2.5.1", "classnames": "^2.5.1",
"codemirror": "^6.0.1", "codemirror": "^6.0.1",
"color": "^4.2.3", "color": "^4.2.3",
+17 -5
View File
@@ -76,6 +76,10 @@ async function init() {
if (settingsState.onoff) { if (settingsState.onoff) {
enableCurrentTheme() enableCurrentTheme()
if (typeof settingsState.assessmentsAverage == 'undefined') {
settingsState.assessmentsAverage = true
}
// TEMP FIX for bug! -> this is a hack to get the injected.css file to have HMR in development mode as this import system is currently broken with crxjs // TEMP FIX for bug! -> this is a hack to get the injected.css file to have HMR in development mode as this import system is currently broken with crxjs
if (import.meta.env.MODE === 'development') { if (import.meta.env.MODE === 'development') {
import('./css/injected.scss') import('./css/injected.scss')
@@ -161,6 +165,14 @@ export function OpenWhatsNewPopup() {
/* html */ ` /* html */ `
<div class="whatsnewTextContainer" style="height: 50%;overflow-y: scroll;"> <div class="whatsnewTextContainer" style="height: 50%;overflow-y: scroll;">
<h1>3.4.3 - Minor Bug Fixes</h1>
<li>Fixed a bug where timetable colours couldn't be changed</li>
<li>Other minor bug fixes</li>
<h1>3.4.2 - Minor Bug Fixes</h1>
<li>Fixed a bug where Assessment Average wasn't enabled by default</li>
<li>Fixed floating menus would sometimes be placed behind other elements</li>
<h1>3.4.1 - Bug Fixes and Performance Improvements</h1> <h1>3.4.1 - Bug Fixes and Performance Improvements</h1>
<li>Added a new "Subject Average" section to the assessments page</li> <li>Added a new "Subject Average" section to the assessments page</li>
<li>Fixed a bug where animations wouldn't play correctly</li> <li>Fixed a bug where animations wouldn't play correctly</li>
@@ -2189,10 +2201,10 @@ export async function loadHomePage() {
const skeletonStructure = stringToHTML(/* html */` const skeletonStructure = stringToHTML(/* html */`
<div class="home-container" id="home-container"> <div class="home-container" id="home-container">
<div class="shortcut-container border"> <div class="border shortcut-container">
<div class="shortcuts border" id="shortcuts"></div> <div class="border shortcuts" id="shortcuts"></div>
</div> </div>
<div class="timetable-container border"> <div class="border timetable-container">
<div class="home-subtitle"> <div class="home-subtitle">
<h2 id="home-lesson-subtitle">Today's Lessons</h2> <h2 id="home-lesson-subtitle">Today's Lessons</h2>
<div class="timetable-arrows"> <div class="timetable-arrows">
@@ -2207,7 +2219,7 @@ export async function loadHomePage() {
<div class="day-container loading" id="day-container"> <div class="day-container loading" id="day-container">
</div> </div>
</div> </div>
<div class="upcoming-container border"> <div class="border upcoming-container">
<div class="upcoming-title"> <div class="upcoming-title">
<h2 class="home-subtitle">Upcoming Assessments</h2> <h2 class="home-subtitle">Upcoming Assessments</h2>
<div class="upcoming-filters" id="upcoming-filters"></div> <div class="upcoming-filters" id="upcoming-filters"></div>
@@ -2215,7 +2227,7 @@ export async function loadHomePage() {
<div class="upcoming-items loading" id="upcoming-items"> <div class="upcoming-items loading" id="upcoming-items">
</div> </div>
</div> </div>
<div class="notices-container border"> <div class="border notices-container">
<div style="display: flex; justify-content: space-between"> <div style="display: flex; justify-content: space-between">
<h2 class="home-subtitle">Notices</h2> <h2 class="home-subtitle">Notices</h2>
<input type="date" /> <input type="date" />
+1
View File
@@ -167,6 +167,7 @@ const DefaultValues: SettingsState = {
originalSelectedColor: '', originalSelectedColor: '',
DarkMode: true, DarkMode: true,
animations: true, animations: true,
assessmentsAverage: true,
defaultPage: 'home', defaultPage: 'home',
shortcuts: [ shortcuts: [
{ {
+4 -1
View File
@@ -1,5 +1,4 @@
@use "sass:meta"; @use "sass:meta";
@charset "UTF-8";
@import url("https://fonts.googleapis.com/css?family=Rubik:300,400,500,600"); @import url("https://fonts.googleapis.com/css?family=Rubik:300,400,500,600");
@include meta.load-css("injected/sidebar-animation.scss"); @include meta.load-css("injected/sidebar-animation.scss");
@@ -1879,6 +1878,9 @@ blurred {
.uiSlidePane > .pane > .header { .uiSlidePane > .pane > .header {
background: var(--better-main); background: var(--better-main);
} }
.modaliser-container {
pointer-events: none;
}
.content [placeholder="Subject…"] { .content [placeholder="Subject…"] {
padding-left: 12px !important; padding-left: 12px !important;
border-radius: 16px; border-radius: 16px;
@@ -1933,6 +1935,7 @@ div.bar.flat {
transition: background-color 0.5s ease-in-out; transition: background-color 0.5s ease-in-out;
background-color: rgba(0, 0, 0, 0); background-color: rgba(0, 0, 0, 0);
transition-duration: 500ms !important; transition-duration: 500ms !important;
z-index: 22 !important;
} }
.uiSlidePane.shown > .pane { .uiSlidePane.shown > .pane {
transform: translatey(0%) !important; transform: translatey(0%) !important;
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"manifest_version": 3, "manifest_version": 3,
"name": "BetterSEQTA+", "name": "BetterSEQTA+",
"version": "3.4.1", "version": "3.4.3",
"description": "Enhance SEQTA Learn's usability and aesthetics! A fork of BetterSEQTA to continue development add add heaps more features!", "description": "Enhance SEQTA Learn's usability and aesthetics! A fork of BetterSEQTA to continue development add add heaps more features!",
"icons": { "icons": {
"32": "resources/icons/icon-32.png", "32": "resources/icons/icon-32.png",
+66 -53
View File
@@ -6,21 +6,59 @@ import { settingsState } from "@/seqta/utils/listeners/SettingsState";
import { updateAllColors } from "./colors/Manager"; import { updateAllColors } from "./colors/Manager";
import { delay } from "@/seqta/utils/delay"; import { delay } from "@/seqta/utils/delay";
let cachedUserInfo: any = null;
async function getUserInfo() {
if (cachedUserInfo) return cachedUserInfo;
try {
const response = await fetch(`${location.origin}/seqta/student/login`, {
method: 'POST',
headers: {
'Content-Type': 'application/json; charset=utf-8',
},
body: JSON.stringify({
mode: 'normal',
query: null,
redirect_url: location.origin,
}),
});
const responseData = await response.json();
cachedUserInfo = responseData.payload;
return cachedUserInfo;
} catch (error) {
console.error('Error fetching user info:', error);
throw error;
}
}
export async function AddBetterSEQTAElements() { export async function AddBetterSEQTAElements() {
if (settingsState.onoff) { if (settingsState.onoff) {
initializeSettings(); initializeSettings();
if (settingsState.DarkMode) { if (settingsState.DarkMode) {
document.documentElement.classList.add('dark'); document.documentElement.classList.add('dark');
} }
createHomeButton();
const fragment = document.createDocumentFragment();
const menu = document.getElementById('menu')!;
const menuList = menu.firstChild as HTMLElement;
createHomeButton(fragment, menuList);
createNewsButton(fragment, menu);
menuList.insertBefore(fragment, menuList.firstChild);
try { try {
await appendBackgroundToUI(); await Promise.all([
appendBackgroundToUI(),
handleUserInfo(),
handleStudentData()
]);
} catch (error) { } catch (error) {
console.error('Error appending background to UI:', error); console.error('Error initializing UI elements:', error);
} }
await handleUserInfo();
handleStudentData();
createNewsButton();
setupEventListeners(); setupEventListeners();
await addDarkLightToggle(); await addDarkLightToggle();
customizeMenuToggle(); customizeMenuToggle();
@@ -28,7 +66,6 @@ export async function AddBetterSEQTAElements() {
addExtensionSettings(); addExtensionSettings();
await createSettingsButton(); await createSettingsButton();
setupSettingsButton(); setupSettingsButton();
} }
@@ -37,18 +74,15 @@ function initializeSettings() {
updateBgDurations(); updateBgDurations();
} }
function createHomeButton() { function createHomeButton(fragment: DocumentFragment, menuList: HTMLElement) {
const container = document.getElementById('content')!; const container = document.getElementById('content')!;
const div = document.createElement('div'); const div = document.createElement('div');
div.classList.add('titlebar'); div.classList.add('titlebar');
container.append(div); container.append(div);
const NewButton = stringToHTML('<li class="item" data-key="home" id="homebutton" data-path="/home" data-betterseqta="true"><label><svg style="width:24px;height:24px" viewBox="0 0 24 24"><path fill="currentColor" d="M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z" /></svg><span>Home</span></label></li>'); const NewButton = stringToHTML('<li class="item" data-key="home" id="homebutton" data-path="/home" data-betterseqta="true"><label><svg style="width:24px;height:24px" viewBox="0 0 24 24"><path fill="currentColor" d="M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z" /></svg><span>Home</span></label></li>');
const menu = document.getElementById('menu')!;
const List = menu.firstChild! as HTMLElement;
if (NewButton.firstChild) { if (NewButton.firstChild) {
List.insertBefore(NewButton.firstChild, List.firstChild); fragment.appendChild(NewButton.firstChild);
} }
} }
@@ -125,28 +159,6 @@ async function handleStudentData() {
} }
} }
async function getUserInfo() {
try {
const response = await fetch(`${location.origin}/seqta/student/login`, {
method: 'POST',
headers: {
'Content-Type': 'application/json; charset=utf-8',
},
body: JSON.stringify({
mode: 'normal',
query: null,
redirect_url: location.origin,
}),
});
const responseData = await response.json();
return responseData.payload;
} catch (error) {
console.error('Error fetching user info:', error);
throw error; // Rethrow the error after logging it
}
}
async function updateStudentInfo(students: any) { async function updateStudentInfo(students: any) {
const info = await getUserInfo(); const info = await getUserInfo();
var index = students.findIndex(function (person: any) { var index = students.findIndex(function (person: any) {
@@ -179,41 +191,42 @@ async function updateStudentInfo(students: any) {
} }
} }
function createNewsButton() { function createNewsButton(fragment: DocumentFragment, menu: HTMLElement) {
const NewsButtonStr = '<li class="item" data-key="news" id="newsbutton" data-path="/news" data-betterseqta="true"><label><svg style="width:24px;height:24px" viewBox="0 0 24 24"><path fill="currentColor" d="M20 3H4C2.89 3 2 3.89 2 5V19C2 20.11 2.89 21 4 21H20C21.11 21 22 20.11 22 19V5C22 3.89 21.11 3 20 3M5 7H10V13H5V7M19 17H5V15H19V17M19 13H12V11H19V13M19 9H12V7H19V9Z" /></svg><span>News</span></label></li>'; const NewsButtonStr = '<li class="item" data-key="news" id="newsbutton" data-path="/news" data-betterseqta="true"><label><svg style="width:24px;height:24px" viewBox="0 0 24 24"><path fill="currentColor" d="M20 3H4C2.89 3 2 3.89 2 5V19C2 20.11 2.89 21 4 21H20C21.11 21 22 20.11 22 19V5C22 3.89 21.11 3 20 3M5 7H10V13H5V7M19 17H5V15H19V17M19 13H12V11H19V13M19 9H12V7H19V9Z" /></svg><span>News</span></label></li>';
const NewsButton = stringToHTML(NewsButtonStr); const NewsButton = stringToHTML(NewsButtonStr);
const menu = document.getElementById('menu')!;
const List = menu.firstChild! as HTMLElement;
List!.appendChild(NewsButton.firstChild!); if (NewsButton.firstChild) {
fragment.appendChild(NewsButton.firstChild);
}
let a = document.createElement('div'); let iconCover = document.createElement('div');
a.classList.add('icon-cover'); iconCover.classList.add('icon-cover');
a.id = 'icon-cover'; iconCover.id = 'icon-cover';
menu!.appendChild(a); menu.appendChild(iconCover);
} }
function setupEventListeners() { function setupEventListeners() {
const menuCover = document.querySelector('#icon-cover'); const menuCover = document.querySelector('#icon-cover');
menuCover!.addEventListener('click', function () {
location.href = '../#?page=/home';
loadHomePage();
(document!.getElementById('menu')!.firstChild! as HTMLElement).classList.remove('noscroll');
});
const homebutton = document.getElementById('homebutton'); const homebutton = document.getElementById('homebutton');
homebutton!.addEventListener('click', function () { const newsbutton = document.getElementById('newsbutton');
if (!homebutton?.classList.contains('draggable') && !homebutton?.classList.contains('active')) {
homebutton?.addEventListener('click', function() {
if (!homebutton.classList.contains('draggable') && !homebutton.classList.contains('active')) {
loadHomePage(); loadHomePage();
} }
}); });
const newsbutton = document.getElementById('newsbutton'); newsbutton?.addEventListener('click', function() {
newsbutton!.addEventListener('click', function () { if (!newsbutton.classList.contains('draggable') && !newsbutton.classList.contains('active')) {
if (!newsbutton?.classList.contains('draggable') && !newsbutton?.classList.contains('active')) {
SendNewsPage(); SendNewsPage();
} }
}); });
menuCover?.addEventListener('click', function() {
location.href = '../#?page=/home';
loadHomePage();
(document.getElementById('menu')!.firstChild! as HTMLElement).classList.remove('noscroll');
});
} }
async function createSettingsButton() { async function createSettingsButton() {