[ts-migrate][client] Init tsconfig.json file

Co-authored-by: ts-migrate <>
This commit is contained in:
Max Leiter 2022-05-02 22:13:10 -07:00
parent 0d2a33dd0a
commit 942f7b202a
No known key found for this signature in database
GPG key ID: A3512F2F2F17EBDA
4 changed files with 21 additions and 8 deletions

View file

@ -1,6 +1,6 @@
"use strict";
export default (event: MouseEvent) => {
export default (event: MouseEvent | Mousetrap.ExtendedKeyboardEvent) => {
if (
(event.target as HTMLElement).tagName !== "TEXTAREA" &&
(event.target as HTMLElement).tagName !== "INPUT"

View file

@ -54,31 +54,41 @@
window.addEventListener("error", errorHandler);
window.g_TheLoungeRemoveLoading = () => {
delete window.g_TheLoungeRemoveLoading;
(window as LoungeWindow).g_TheLoungeRemoveLoading = () => {
delete (window as LoungeWindow).g_TheLoungeRemoveLoading;
window.clearTimeout(loadingSlowTimeout);
window.removeEventListener("error", errorHandler);
document.getElementById("loading").remove();
document.getElementById("loading")?.remove();
};
// Apply user theme as soon as possible, before any other code loads
// This prevents flash of white while other code loads and socket connects
try {
const userSettings = JSON.parse(localStorage.getItem("settings"));
const userSettings = JSON.parse(localStorage.getItem("settings") || "{}");
const themeEl = document.getElementById("theme");
if (!themeEl) {
return;
}
if (
typeof userSettings.theme === "string" &&
themeEl.dataset.serverTheme !== userSettings.theme
themeEl?.dataset.serverTheme !== userSettings.theme
) {
themeEl.attributes.href.value = `themes/${userSettings.theme}.css`;
themeEl.setAttribute("href", `themes/${userSettings.theme}.css`);
}
if (
typeof userSettings.userStyles === "string" &&
!/[?&]nocss/.test(window.location.search)
) {
document.getElementById("user-specified-css").innerHTML = userSettings.userStyles;
const userSpecifiedCSSElement = document.getElementById("user-specified-css");
if (!userSpecifiedCSSElement) {
return;
}
userSpecifiedCSSElement.innerHTML = userSettings.userStyles;
}
} catch (e) {
//

3
client/types.d.ts vendored
View file

@ -2,3 +2,6 @@ declare module "*.vue" {
import Vue from "vue";
export default Vue;
}
interface LoungeWindow extends Window {
g_TheLoungeRemoveLoading?: () => void;
}