mirror of
https://github.com/thelounge/thelounge.git
synced 2024-06-08 00:32:19 +02:00
[ts-migrate][client] Init tsconfig.json file
Co-authored-by: ts-migrate <>
This commit is contained in:
parent
0d2a33dd0a
commit
942f7b202a
|
@ -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"
|
||||
|
|
|
@ -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
3
client/types.d.ts
vendored
|
@ -2,3 +2,6 @@ declare module "*.vue" {
|
|||
import Vue from "vue";
|
||||
export default Vue;
|
||||
}
|
||||
interface LoungeWindow extends Window {
|
||||
g_TheLoungeRemoveLoading?: () => void;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue