mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
clean up dependencies
This commit is contained in:
+25
-31
@@ -1,32 +1,27 @@
|
|||||||
import * as Sentry from "@sentry/browser";
|
import * as Sentry from "@sentry/browser";
|
||||||
import browser from 'webextension-polyfill';
|
|
||||||
|
|
||||||
import { animate, spring, stagger } from 'motion';
|
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 loading, { AppendLoadingSymbol } from './seqta/ui/Loading';
|
||||||
|
|
||||||
|
import Color from 'color';
|
||||||
|
import MenuitemSVGKey from './seqta/content/MenuItemSVGKey.json';
|
||||||
import { MessageHandler } from './seqta/utils/MessageListener';
|
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 { SettingsState } from "./types/storage";
|
||||||
import { onError } from './seqta/utils/onError';
|
import ShortcutLinks from './seqta/content/links.json';
|
||||||
import { delay } from "./seqta/utils/delay";
|
import Sortable from 'sortablejs';
|
||||||
|
import StorageListener from './seqta/utils/StorageListener';
|
||||||
import iframeCSS from "./css/iframe.scss?inline";
|
import { appendBackgroundToUI } from './seqta/ui/ImageBackgrounds';
|
||||||
|
|
||||||
// Icons
|
// Icons
|
||||||
import assessmentsicon from './seqta/icons/assessmentsIcon';
|
import assessmentsicon from './seqta/icons/assessmentsIcon';
|
||||||
|
import browser from 'webextension-polyfill';
|
||||||
import coursesicon from './seqta/icons/coursesIcon';
|
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) => {
|
browser.storage.local.get([ "telemetry" ]).then((telemetry) => {
|
||||||
if (telemetry.telemetry === true) {
|
if (telemetry.telemetry === true) {
|
||||||
@@ -726,7 +721,6 @@ function main(storedSetting: SettingsState) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateAllColors(storedSetting);
|
updateAllColors(storedSetting);
|
||||||
InjectStyles();
|
|
||||||
loading();
|
loading();
|
||||||
InjectCustomIcons();
|
InjectCustomIcons();
|
||||||
HideMenuItems();
|
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() {
|
function InjectCustomIcons() {
|
||||||
const fontURL = browser.runtime.getURL('fonts/IconFamily.woff');
|
const fontURL = browser.runtime.getURL('fonts/IconFamily.woff');
|
||||||
|
|
||||||
@@ -2183,8 +2170,7 @@ function AddCustomShortcutsToPage() {
|
|||||||
result.then(open, onError)
|
result.then(open, onError)
|
||||||
}
|
}
|
||||||
|
|
||||||
function SendHomePage() {
|
async function SendHomePage() {
|
||||||
setTimeout(function () {
|
|
||||||
// Sends the html data for the home page
|
// Sends the html data for the home page
|
||||||
console.log('[BetterSEQTA] Started Loading Home Page');
|
console.log('[BetterSEQTA] Started Loading Home Page');
|
||||||
document.title = 'Home ― SEQTA Learn';
|
document.title = 'Home ― SEQTA Learn';
|
||||||
@@ -2352,6 +2338,15 @@ function SendHomePage() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
callHomeTimetable(TodayFormatted);
|
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 labelArray = response.payload[1].value.split(' ')
|
||||||
|
|
||||||
const xhr2 = new XMLHttpRequest()
|
const xhr2 = new XMLHttpRequest()
|
||||||
@@ -2555,7 +2550,6 @@ function SendHomePage() {
|
|||||||
CreateUpcomingSection(CurrentAssessments, activeSubjects);
|
CreateUpcomingSection(CurrentAssessments, activeSubjects);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}, 8);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function addShortcuts(shortcuts: any) {
|
export function addShortcuts(shortcuts: any) {
|
||||||
|
|||||||
@@ -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()
|
|
||||||
Reference in New Issue
Block a user