clean up dependencies

This commit is contained in:
SethBurkart123
2023-12-18 16:21:26 +11:00
parent 7342bcd0e8
commit 7247f426cd
2 changed files with 337 additions and 349 deletions
+25 -31
View File
@@ -1,32 +1,27 @@
import * as Sentry from "@sentry/browser";
import browser from 'webextension-polyfill';
import { animate, spring, stagger } from 'motion';
import Sortable from 'sortablejs';
import Color from 'color';
import MenuitemSVGKey from './seqta/content/MenuItemSVGKey.json';
import ShortcutLinks from './seqta/content/links.json';
import { appendBackgroundToUI } from './seqta/ui/ImageBackgrounds';
import loading, { AppendLoadingSymbol } from './seqta/ui/Loading';
import Color from 'color';
import MenuitemSVGKey from './seqta/content/MenuItemSVGKey.json';
import { MessageHandler } from './seqta/utils/MessageListener';
import { updateAllColors } from './seqta/ui/colors/Manager';
import StorageListener from './seqta/utils/StorageListener';
import { updateBgDurations } from './seqta/ui/Animation';
import { enableCurrentTheme } from './seqta/ui/Themes';
import stringToHTML from './seqta/utils/stringToHTML';
import { response } from './seqta/utils/GetPrefs';
import { SettingsState } from "./types/storage";
import { onError } from './seqta/utils/onError';
import { delay } from "./seqta/utils/delay";
import iframeCSS from "./css/iframe.scss?inline";
import ShortcutLinks from './seqta/content/links.json';
import Sortable from 'sortablejs';
import StorageListener from './seqta/utils/StorageListener';
import { appendBackgroundToUI } from './seqta/ui/ImageBackgrounds';
// Icons
import assessmentsicon from './seqta/icons/assessmentsIcon';
import browser from 'webextension-polyfill';
import coursesicon from './seqta/icons/coursesIcon';
import { delay } from "./seqta/utils/delay";
import { enableCurrentTheme } from './seqta/ui/Themes';
import iframeCSS from "./css/iframe.scss?inline";
import { onError } from './seqta/utils/onError';
import stringToHTML from './seqta/utils/stringToHTML';
import { updateAllColors } from './seqta/ui/colors/Manager';
import { updateBgDurations } from './seqta/ui/Animation';
browser.storage.local.get([ "telemetry" ]).then((telemetry) => {
if (telemetry.telemetry === true) {
@@ -726,7 +721,6 @@ function main(storedSetting: SettingsState) {
}
updateAllColors(storedSetting);
InjectStyles();
loading();
InjectCustomIcons();
HideMenuItems();
@@ -740,13 +734,6 @@ function main(storedSetting: SettingsState) {
}
}
function InjectStyles() {
import('./css/injected.scss');
const inject = GetCSSElement('css/injected.css');
document.head.appendChild(inject);
document.getElementsByTagName('html')[0].appendChild(inject);
}
function InjectCustomIcons() {
const fontURL = browser.runtime.getURL('fonts/IconFamily.woff');
@@ -2183,8 +2170,7 @@ function AddCustomShortcutsToPage() {
result.then(open, onError)
}
function SendHomePage() {
setTimeout(function () {
async function SendHomePage() {
// Sends the html data for the home page
console.log('[BetterSEQTA] Started Loading Home Page');
document.title = 'Home ― SEQTA Learn';
@@ -2352,6 +2338,15 @@ function SendHomePage() {
);
callHomeTimetable(TodayFormatted);
const GetPrefs = await fetch(`${location.origin}/seqta/student/load/prefs?`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ asArray: true, request: 'userPrefs' })
})
const response = await GetPrefs.json()
const labelArray = response.payload[1].value.split(' ')
const xhr2 = new XMLHttpRequest()
@@ -2555,7 +2550,6 @@ function SendHomePage() {
CreateUpcomingSection(CurrentAssessments, activeSubjects);
});
});
}, 8);
}
export function addShortcuts(shortcuts: any) {
-6
View File
@@ -1,6 +0,0 @@
const GetPrefs = await fetch(`${location.origin}/seqta/student/load/prefs?`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ asArray: true, request: 'userPrefs' })
})
export const response = await GetPrefs.json()