mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-28 01:39:29 +08:00
removed unnecessary exports
This commit is contained in:
parent
0615c56de8
commit
366264dade
33 changed files with 68 additions and 88 deletions
|
|
@ -70,7 +70,7 @@ export const defaultResultFilters: MonkeyTypes.ResultFilters = {
|
|||
};
|
||||
|
||||
// current activated filter
|
||||
export let filters = defaultResultFilters;
|
||||
let filters = defaultResultFilters;
|
||||
|
||||
function save(): void {
|
||||
window.localStorage.setItem("resultFilters", JSON.stringify(filters));
|
||||
|
|
@ -138,7 +138,7 @@ export async function load(): Promise<void> {
|
|||
}
|
||||
}
|
||||
|
||||
export async function updateFilterPresets(): Promise<void> {
|
||||
async function updateFilterPresets(): Promise<void> {
|
||||
const parent = document.querySelector(".pageAccount .presetFilterButtons");
|
||||
const buttons = document.querySelector(
|
||||
".pageAccount .presetFilterButtons .filterBtns"
|
||||
|
|
@ -229,7 +229,7 @@ async function createFilterPresetCallback(name: string): Promise<void> {
|
|||
}
|
||||
|
||||
// shows popup for user to select name
|
||||
export async function startCreateFilterPreset(): Promise<void> {
|
||||
async function startCreateFilterPreset(): Promise<void> {
|
||||
showNewResultFilterPresetPopup(async (name: string) =>
|
||||
createFilterPresetCallback(name)
|
||||
);
|
||||
|
|
@ -248,7 +248,7 @@ function removeFilterPresetFromSnapshot(id: string): void {
|
|||
}
|
||||
|
||||
// deletes the currently selected filter preset
|
||||
export async function deleteFilterPreset(id: string): Promise<void> {
|
||||
async function deleteFilterPreset(id: string): Promise<void> {
|
||||
Loader.show();
|
||||
const result = await Ape.users.removeResultFilterPreset(id);
|
||||
Loader.hide();
|
||||
|
|
@ -270,7 +270,7 @@ function deSelectFilterPreset(): void {
|
|||
).removeClass("active");
|
||||
}
|
||||
|
||||
export function getFilters(): MonkeyTypes.ResultFilters {
|
||||
function getFilters(): MonkeyTypes.ResultFilters {
|
||||
return filters;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,10 +18,6 @@ import {
|
|||
|
||||
export let localStorageConfig: MonkeyTypes.Config;
|
||||
|
||||
export function setLocalStorageConfig(val: MonkeyTypes.Config): void {
|
||||
localStorageConfig = val;
|
||||
}
|
||||
|
||||
let loadDone: (value?: unknown) => void;
|
||||
|
||||
const config = {
|
||||
|
|
@ -291,7 +287,7 @@ export function setBlindMode(blind: boolean, nosave?: boolean): boolean {
|
|||
return true;
|
||||
}
|
||||
|
||||
export function setAccountChart(
|
||||
function setAccountChart(
|
||||
array: MonkeyTypes.AccountChart,
|
||||
nosave?: boolean
|
||||
): boolean {
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ let signedOutThisSession = false;
|
|||
|
||||
export const gmailProvider = new GoogleAuthProvider();
|
||||
|
||||
export async function sendVerificationEmail(): Promise<void> {
|
||||
async function sendVerificationEmail(): Promise<void> {
|
||||
if (Auth === undefined) {
|
||||
Notifications.add("Authentication uninitialized", -1, {
|
||||
duration: 3,
|
||||
|
|
@ -71,7 +71,7 @@ export async function sendVerificationEmail(): Promise<void> {
|
|||
}
|
||||
}
|
||||
|
||||
export async function getDataAndInit(): Promise<boolean> {
|
||||
async function getDataAndInit(): Promise<boolean> {
|
||||
try {
|
||||
console.log("getting account data");
|
||||
if (window.location.pathname !== "/account") {
|
||||
|
|
@ -297,7 +297,7 @@ if (Auth && ConnectionState.get()) {
|
|||
});
|
||||
}
|
||||
|
||||
export async function signIn(): Promise<void> {
|
||||
async function signIn(): Promise<void> {
|
||||
if (Auth === undefined) {
|
||||
Notifications.add("Authentication uninitialized", -1);
|
||||
return;
|
||||
|
|
@ -353,7 +353,7 @@ export async function signIn(): Promise<void> {
|
|||
});
|
||||
}
|
||||
|
||||
export async function signInWithGoogle(): Promise<void> {
|
||||
async function signInWithGoogle(): Promise<void> {
|
||||
if (Auth === undefined) {
|
||||
Notifications.add("Authentication uninitialized", -1, {
|
||||
duration: 3,
|
||||
|
|
@ -405,7 +405,7 @@ export async function signInWithGoogle(): Promise<void> {
|
|||
});
|
||||
}
|
||||
|
||||
export async function addGoogleAuth(): Promise<void> {
|
||||
async function addGoogleAuth(): Promise<void> {
|
||||
if (Auth === undefined) {
|
||||
Notifications.add("Authentication uninitialized", -1, {
|
||||
duration: 3,
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ export let adBlock: boolean;
|
|||
export let cookieBlocker: boolean;
|
||||
|
||||
// export let choice: "eg" | "pw" = Math.random() < 0.5 ? "eg" : "pw";
|
||||
export const choice: "eg" | "pw" = "pw";
|
||||
const choice: "eg" | "pw" = "pw";
|
||||
|
||||
// console.log("AB choice: " + choice);
|
||||
|
||||
|
|
@ -32,7 +32,7 @@ export const choice: "eg" | "pw" = "pw";
|
|||
// console.log("AB choice forced: " + choice);
|
||||
// }
|
||||
|
||||
export function init(): void {
|
||||
function init(): void {
|
||||
if (choice === "eg") {
|
||||
EG.init();
|
||||
} else {
|
||||
|
|
@ -53,13 +53,13 @@ export function init(): void {
|
|||
initialised = true;
|
||||
}
|
||||
|
||||
export function removeAll(): void {
|
||||
function removeAll(): void {
|
||||
removeSellout();
|
||||
removeOn();
|
||||
removeResult();
|
||||
}
|
||||
|
||||
export function removeSellout(): void {
|
||||
function removeSellout(): void {
|
||||
$("#ad-footer-wrapper").remove();
|
||||
$("#ad-footer-small-wrapper").remove();
|
||||
$("#ad-about-1-wrapper").remove();
|
||||
|
|
@ -78,12 +78,12 @@ export function removeSellout(): void {
|
|||
$("#ad-account-2-small-wrapper").remove();
|
||||
}
|
||||
|
||||
export function removeOn(): void {
|
||||
function removeOn(): void {
|
||||
$("#ad-vertical-right-wrapper").remove();
|
||||
$("#ad-vertical-left-wrapper").remove();
|
||||
}
|
||||
|
||||
export function removeResult(): void {
|
||||
function removeResult(): void {
|
||||
$("#ad-result-wrapper").remove();
|
||||
$("#ad-result-small-wrapper").remove();
|
||||
}
|
||||
|
|
@ -130,7 +130,7 @@ function updateBreakpoint2(noReinstate = false): void {
|
|||
}
|
||||
}
|
||||
|
||||
export async function refreshVisible(): Promise<void> {
|
||||
async function _refreshVisible(): Promise<void> {
|
||||
if (choice === "eg") {
|
||||
await EG.refreshVisible();
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -7,14 +7,14 @@ import {
|
|||
import { app as firebaseApp } from "../firebase";
|
||||
import { createErrorMessage } from "../utils/misc";
|
||||
|
||||
export let Analytics: AnalyticsType;
|
||||
let analytics: AnalyticsType;
|
||||
|
||||
export async function log(
|
||||
eventName: string,
|
||||
params?: { [key: string]: string }
|
||||
): Promise<void> {
|
||||
try {
|
||||
logEvent(Analytics, eventName, params);
|
||||
logEvent(analytics, eventName, params);
|
||||
} catch (e) {
|
||||
console.log("Analytics unavailable");
|
||||
}
|
||||
|
|
@ -39,8 +39,8 @@ if (acceptedCookies !== null) {
|
|||
|
||||
export function activateAnalytics(): void {
|
||||
try {
|
||||
Analytics = getAnalytics(firebaseApp);
|
||||
setAnalyticsCollectionEnabled(Analytics, true);
|
||||
analytics = getAnalytics(firebaseApp);
|
||||
setAnalyticsCollectionEnabled(analytics, true);
|
||||
$("body").append(`
|
||||
<script
|
||||
async
|
||||
|
|
|
|||
|
|
@ -1035,7 +1035,7 @@ function updateAverage100(updateChart = true): void {
|
|||
if (updateChart) accountHistory.updateColors();
|
||||
}
|
||||
|
||||
export async function updateColors<
|
||||
async function updateColors<
|
||||
TType extends ChartType = "bar" | "line" | "scatter",
|
||||
TData =
|
||||
| MonkeyTypes.HistoryChartData[]
|
||||
|
|
@ -1184,7 +1184,7 @@ export async function updateColors<
|
|||
chart.update("none");
|
||||
}
|
||||
|
||||
export function setDefaultFontFamily(font: string): void {
|
||||
function setDefaultFontFamily(font: string): void {
|
||||
Chart.defaults.font.family = font.replace(/_/g, " ");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -235,11 +235,6 @@ export async function renderResult(): Promise<void> {
|
|||
// }
|
||||
}
|
||||
|
||||
export function setMobile(tf: boolean): void {
|
||||
if (!rampReady) return;
|
||||
ramp.setMobile(tf);
|
||||
}
|
||||
|
||||
// let showSky = false;
|
||||
|
||||
// export function updateSky(visible: boolean): void {
|
||||
|
|
|
|||
|
|
@ -20,12 +20,12 @@ interface ClickSounds {
|
|||
let errorSound: Howler.Howl | null = null;
|
||||
let clickSounds: ClickSounds | null = null;
|
||||
|
||||
export function initErrorSound(): void {
|
||||
function initErrorSound(): void {
|
||||
if (errorSound !== null) return;
|
||||
errorSound = new Howl({ src: ["../sound/error.wav"] });
|
||||
}
|
||||
|
||||
export function init(): void {
|
||||
function init(): void {
|
||||
if (clickSounds !== null) return;
|
||||
clickSounds = {
|
||||
1: [
|
||||
|
|
@ -403,7 +403,7 @@ export const scaleConfigurations: Record<
|
|||
},
|
||||
};
|
||||
|
||||
export function playScale(scale: ValidScales, scaleMeta: ScaleData): void {
|
||||
function playScale(scale: ValidScales, scaleMeta: ScaleData): void {
|
||||
if (audioCtx === undefined) {
|
||||
initAudioContext();
|
||||
}
|
||||
|
|
@ -510,13 +510,11 @@ export function playError(): void {
|
|||
(errorSound as Howler.Howl).play();
|
||||
}
|
||||
|
||||
export function setVolume(val: string): void {
|
||||
// not sure why it complains but it works
|
||||
// @ts-ignore
|
||||
function setVolume(val: number): void {
|
||||
Howler.Howler.volume(val);
|
||||
}
|
||||
|
||||
ConfigEvent.subscribe((eventKey, eventValue) => {
|
||||
if (eventKey === "playSoundOnClick" && eventValue !== "off") init();
|
||||
if (eventKey === "soundVolume") setVolume(eventValue as string);
|
||||
if (eventKey === "soundVolume") setVolume(parseFloat(eventValue as string));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@ import * as Loader from "../elements/loader";
|
|||
import * as AnalyticsController from "../controllers/analytics-controller";
|
||||
import { debounce } from "throttle-debounce";
|
||||
|
||||
let isPreviewingTheme = false;
|
||||
export let randomTheme: string | null = null;
|
||||
export let randomThemeIndex = 0;
|
||||
let isPreviewingTheme = false;
|
||||
let randomThemeIndex = 0;
|
||||
|
||||
export const colorVars = [
|
||||
"--bg-color",
|
||||
|
|
@ -360,7 +360,7 @@ export async function randomizeTheme(): Promise<void> {
|
|||
}
|
||||
}
|
||||
|
||||
export function clearRandom(): void {
|
||||
function clearRandom(): void {
|
||||
if (randomTheme === null) return;
|
||||
randomTheme = null;
|
||||
if (Config.customTheme) {
|
||||
|
|
@ -370,7 +370,7 @@ export function clearRandom(): void {
|
|||
}
|
||||
}
|
||||
|
||||
export function applyCustomBackgroundSize(): void {
|
||||
function applyCustomBackgroundSize(): void {
|
||||
if (Config.customBackgroundSize === "max") {
|
||||
$(".customBackground img").css({
|
||||
// width: "calc(100%)",
|
||||
|
|
@ -384,7 +384,7 @@ export function applyCustomBackgroundSize(): void {
|
|||
}
|
||||
}
|
||||
|
||||
export function applyCustomBackground(): void {
|
||||
function applyCustomBackground(): void {
|
||||
// $(".customBackground").css({
|
||||
// backgroundImage: `url(${Config.customBackground})`,
|
||||
// backgroundAttachment: "fixed",
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ export async function getUserResults(): Promise<boolean> {
|
|||
}
|
||||
}
|
||||
|
||||
export function getCustomThemeById(
|
||||
function _getCustomThemeById(
|
||||
themeID: string
|
||||
): MonkeyTypes.CustomTheme | undefined {
|
||||
return dbSnapshot?.customThemes.find((t) => t._id === themeID);
|
||||
|
|
@ -357,7 +357,7 @@ export async function deleteCustomTheme(themeId: string): Promise<boolean> {
|
|||
return true;
|
||||
}
|
||||
|
||||
export async function getUserHighestWpm<M extends MonkeyTypes.Mode>(
|
||||
async function _getUserHighestWpm<M extends MonkeyTypes.Mode>(
|
||||
mode: M,
|
||||
mode2: MonkeyTypes.Mode2<M>,
|
||||
punctuation: boolean,
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ const state: State = {
|
|||
psas: [],
|
||||
};
|
||||
|
||||
export function hide(): void {
|
||||
function hide(): void {
|
||||
if (isPopupVisible(wrapperId)) {
|
||||
setNotificationBubbleVisible(false);
|
||||
|
||||
|
|
@ -120,7 +120,7 @@ export function hide(): void {
|
|||
}
|
||||
}
|
||||
|
||||
export async function show(): Promise<void> {
|
||||
async function show(): Promise<void> {
|
||||
Skeleton.append(wrapperId);
|
||||
if (!isPopupVisible(wrapperId)) {
|
||||
$("#alertsPopup").css("marginRight", "-10rem").animate(
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ const filters = {
|
|||
},
|
||||
};
|
||||
|
||||
export function getCSS(): string {
|
||||
function getCSS(): string {
|
||||
let ret = "";
|
||||
Object.keys(filters).forEach((filterKey) => {
|
||||
const key = filterKey as keyof typeof filters;
|
||||
|
|
@ -75,7 +75,7 @@ function updateNumbers(): void {
|
|||
);
|
||||
}
|
||||
|
||||
export function loadConfig(config: number[]): void {
|
||||
function loadConfig(config: number[]): void {
|
||||
filters.blur.value = config[0];
|
||||
filters.brightness.value = config[1];
|
||||
filters.saturate.value = config[2];
|
||||
|
|
|
|||
|
|
@ -47,6 +47,6 @@ async function updateElement(fps: string): Promise<void> {
|
|||
}
|
||||
}
|
||||
|
||||
export function getAverageFps(): number {
|
||||
function _getAverageFps(): number {
|
||||
return frameCount / (performance.now() - startTime);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -581,7 +581,7 @@ async function requestNew(lb: LbKey, skip: number): Promise<void> {
|
|||
hideLoader(lb);
|
||||
}
|
||||
|
||||
export function show(): void {
|
||||
function show(): void {
|
||||
if (!ConnectionState.get()) {
|
||||
Notifications.add("You can't view leaderboards while offline", 0);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ async function updateChartColors(): Promise<void> {
|
|||
await Misc.sleep(0);
|
||||
}
|
||||
|
||||
export function reset(): void {
|
||||
function reset(): void {
|
||||
$(".pageAccount .history table tbody").empty();
|
||||
ChartController.accountHistogram.data.datasets[0].data = [];
|
||||
ChartController.accountActivity.data.datasets[0].data = [];
|
||||
|
|
@ -1060,7 +1060,7 @@ export async function downloadResults(): Promise<void> {
|
|||
}
|
||||
}
|
||||
|
||||
export async function update(): Promise<void> {
|
||||
async function update(): Promise<void> {
|
||||
LoadingPage.updateBar(0, true);
|
||||
if (DB.getSnapshot() === null) {
|
||||
Notifications.add(`Missing account data. Please refresh.`, -1);
|
||||
|
|
|
|||
|
|
@ -397,7 +397,7 @@ async function initGroups(): Promise<void> {
|
|||
// );
|
||||
}
|
||||
|
||||
export function reset(): void {
|
||||
function reset(): void {
|
||||
$(".pageSettings .section.themes .favThemes.buttons").empty();
|
||||
$(".pageSettings .section.themes .allThemes.buttons").empty();
|
||||
$(".pageSettings .section.themes .allCustomThemes.buttons").empty();
|
||||
|
|
@ -408,7 +408,7 @@ export function reset(): void {
|
|||
}
|
||||
|
||||
let groupsInitialized = false;
|
||||
export async function fillSettingsPage(): Promise<void> {
|
||||
async function fillSettingsPage(): Promise<void> {
|
||||
if (Config.showKeyTips) {
|
||||
$(".pageSettings .tip").removeClass("hidden");
|
||||
} else {
|
||||
|
|
@ -827,7 +827,7 @@ function refreshPresetsSettingsSection(): void {
|
|||
}
|
||||
}
|
||||
|
||||
export function showAccountSection(): void {
|
||||
function showAccountSection(): void {
|
||||
$(`.sectionGroupTitle[group='account']`).removeClass("hidden");
|
||||
$(`.settingsGroup.account`).removeClass("hidden");
|
||||
$(`.pageSettings .section.needsAccount`).removeClass("hidden");
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ function refreshList(): void {
|
|||
});
|
||||
}
|
||||
|
||||
export function hide(): void {
|
||||
function hide(): void {
|
||||
if (isPopupVisible(wrapperId)) {
|
||||
$("#apeKeysPopupWrapper")
|
||||
.stop(true, true)
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ export function show(): void {
|
|||
}
|
||||
}
|
||||
|
||||
export async function hide(): Promise<void> {
|
||||
async function hide(): Promise<void> {
|
||||
if (isPopupVisible(wrapperId)) {
|
||||
focusWords();
|
||||
$("#cookiePopupWrapper")
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ export function show(): void {
|
|||
previewDuration();
|
||||
}
|
||||
|
||||
export function hide(): void {
|
||||
function hide(): void {
|
||||
if (isPopupVisible(wrapperId)) {
|
||||
$("#customTestDurationPopupWrapper")
|
||||
.stop(true, true)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ const skeletonId = "customTextPopupWrapper";
|
|||
const wrapper = "#customTextPopupWrapper";
|
||||
const popup = "#customTextPopup";
|
||||
|
||||
export function updateLongTextWarning(): void {
|
||||
function updateLongTextWarning(): void {
|
||||
if (CustomTextState.isCustomTextLong() === true) {
|
||||
$(`${popup} .longCustomTextWarning`).removeClass("hidden");
|
||||
$(`${popup} .randomWordsCheckbox input`).prop("checked", false);
|
||||
|
|
@ -123,7 +123,7 @@ interface HideOptions {
|
|||
resetState?: boolean | undefined;
|
||||
}
|
||||
|
||||
export function hide(options = {} as HideOptions): void {
|
||||
function hide(options = {} as HideOptions): void {
|
||||
if (options.noAnim === undefined) options.noAnim = false;
|
||||
if (options.resetState === undefined) options.resetState = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ export function show(): void {
|
|||
}
|
||||
}
|
||||
|
||||
export function hide(): void {
|
||||
function hide(): void {
|
||||
if (isPopupVisible(wrapperId)) {
|
||||
$("#customWordAmountPopupWrapper")
|
||||
.stop(true, true)
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ export function show(callbackOnHide: () => void): void {
|
|||
}
|
||||
}
|
||||
|
||||
export function hide(): void {
|
||||
function hide(): void {
|
||||
if (isPopupVisible(wrapperId)) {
|
||||
callbackFuncOnHide && callbackFuncOnHide();
|
||||
$("#editProfilePopupWrapper")
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ export async function show(noAnim = false): Promise<void> {
|
|||
}
|
||||
}
|
||||
|
||||
export function hide(): void {
|
||||
function hide(): void {
|
||||
if (isPopupVisible(wrapperId)) {
|
||||
$("#quoteApprovePopupWrapper")
|
||||
.stop(true, true)
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ function updateData(): void {
|
|||
updateRatingStats();
|
||||
}
|
||||
|
||||
export function show(quote: MonkeyTypes.Quote, shouldReset = true): void {
|
||||
function show(quote: MonkeyTypes.Quote, shouldReset = true): void {
|
||||
Skeleton.append(wrapperId);
|
||||
|
||||
if (!isPopupVisible(wrapperId)) {
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ export async function show(options = defaultOptions): Promise<void> {
|
|||
}
|
||||
}
|
||||
|
||||
export async function hide(): Promise<void> {
|
||||
async function hide(): Promise<void> {
|
||||
if (isPopupVisible(wrapperId)) {
|
||||
const noAnim = state.previousPopupShowCallback ? true : false;
|
||||
|
||||
|
|
|
|||
|
|
@ -256,7 +256,7 @@ export async function show(clearText = true): Promise<void> {
|
|||
}
|
||||
}
|
||||
|
||||
export function hide(noAnim = false, focusWords = true): void {
|
||||
function hide(noAnim = false, focusWords = true): void {
|
||||
if (isPopupVisible(wrapperId)) {
|
||||
$("#quoteSearchPopupWrapper")
|
||||
.stop(true, true)
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ export async function show(noAnim = false): Promise<void> {
|
|||
}
|
||||
}
|
||||
|
||||
export function hide(): void {
|
||||
function hide(): void {
|
||||
if (Misc.isPopupVisible(wrapperId)) {
|
||||
$("#quoteSubmitPopupWrapper")
|
||||
.stop(true, true)
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ export function show(): void {
|
|||
}
|
||||
}
|
||||
|
||||
export function hide(resolveToUndefined = false): void {
|
||||
function hide(resolveToUndefined = false): void {
|
||||
if (isPopupVisible(wrapperId)) {
|
||||
if (resolveToUndefined) resolvePromise();
|
||||
$("#registerCaptchaPopupWrapper")
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ export function show(): void {
|
|||
}
|
||||
}
|
||||
|
||||
export async function hide(): Promise<void> {
|
||||
async function hide(): Promise<void> {
|
||||
if (isPopupVisible(wrapperId)) {
|
||||
$("#shareTestSettingsPopupWrapper")
|
||||
.stop(true, true)
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ export async function show(options: ShowOptions): Promise<void> {
|
|||
}
|
||||
}
|
||||
|
||||
export async function hide(): Promise<void> {
|
||||
async function hide(): Promise<void> {
|
||||
if (isPopupVisible(wrapperId)) {
|
||||
$("#userReportPopupWrapper")
|
||||
.stop(true, true)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import * as ConfigEvent from "../observables/config-event";
|
|||
import { Auth } from "../firebase";
|
||||
import * as ActivePage from "../states/active-page";
|
||||
|
||||
export function updateActiveButton(): void {
|
||||
function updateActiveButton(): void {
|
||||
let activeThemeName = Config.theme;
|
||||
if (
|
||||
Config.randomTheme !== "off" &&
|
||||
|
|
@ -278,7 +278,7 @@ function toggleFavourite(themeName: string): void {
|
|||
UpdateConfig.saveFullConfigToLocalStorage();
|
||||
}
|
||||
|
||||
export function saveCustomThemeColors(): void {
|
||||
function saveCustomThemeColors(): void {
|
||||
const newColors: string[] = [];
|
||||
for (const color of ThemeController.colorVars) {
|
||||
newColors.push(
|
||||
|
|
|
|||
|
|
@ -1,17 +1,8 @@
|
|||
interface CompositionState {
|
||||
composing: boolean;
|
||||
startPos: number;
|
||||
}
|
||||
|
||||
const compositionState = {
|
||||
composing: false,
|
||||
startPos: -1,
|
||||
};
|
||||
|
||||
export function get(): CompositionState {
|
||||
return compositionState;
|
||||
}
|
||||
|
||||
export function getComposing(): boolean {
|
||||
return compositionState.composing;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ export function toggleDebugLogs(): void {
|
|||
localStorage.setItem("debugLogs", debugLogs.toString());
|
||||
}
|
||||
|
||||
export function info(...args: unknown[]): void {
|
||||
function info(...args: unknown[]): void {
|
||||
nativeLog(
|
||||
"%cINFO",
|
||||
"background:#4CAF50;color: #111;padding:0 5px;border-radius:10px",
|
||||
|
|
@ -26,7 +26,7 @@ export function info(...args: unknown[]): void {
|
|||
);
|
||||
}
|
||||
|
||||
export function warn(...args: unknown[]): void {
|
||||
function warn(...args: unknown[]): void {
|
||||
nativeWarn(
|
||||
"%cWRN",
|
||||
"background:#FFC107;color: #111;padding:0 5px;border-radius:10px",
|
||||
|
|
@ -34,7 +34,7 @@ export function warn(...args: unknown[]): void {
|
|||
);
|
||||
}
|
||||
|
||||
export function error(...args: unknown[]): void {
|
||||
function error(...args: unknown[]): void {
|
||||
nativeError(
|
||||
"%cERR",
|
||||
"background:#F44336;color: #111;padding:0 5px;border-radius:10px",
|
||||
|
|
@ -42,7 +42,7 @@ export function error(...args: unknown[]): void {
|
|||
);
|
||||
}
|
||||
|
||||
export function debug(...args: unknown[]): void {
|
||||
function debug(...args: unknown[]): void {
|
||||
if (!debugLogs) return;
|
||||
nativeLog(
|
||||
"%cDEBG",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue