From a7910477ffb22e7d9368df7e2f2af968c4809ccb Mon Sep 17 00:00:00 2001 From: Miodec Date: Mon, 18 Jul 2022 11:36:47 +0200 Subject: [PATCH] added video ad to commandline --- frontend/src/ts/elements/commandline-lists.ts | 10 ++++++++++ frontend/src/ts/popups/video-ad-popup.ts | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/frontend/src/ts/elements/commandline-lists.ts b/frontend/src/ts/elements/commandline-lists.ts index 9ac2b2020..bde3a640e 100644 --- a/frontend/src/ts/elements/commandline-lists.ts +++ b/frontend/src/ts/elements/commandline-lists.ts @@ -24,6 +24,7 @@ import { Auth } from "../firebase"; import * as EditPresetPopup from "../popups/edit-preset-popup"; import * as EditTagPopup from "../popups/edit-tags-popup"; import { navigate } from "../controllers/route-controller"; +import * as VideoAdPopup from "../popups/video-ad-popup"; export let current: MonkeyTypes.CommandsGroup[] = []; @@ -2926,6 +2927,15 @@ export const defaultCommands: MonkeyTypes.CommandsGroup = { icon: "fa-ad", subgroup: commandsEnableAds, }, + { + id: "watchVideoAd", + display: "Watch video ad", + alias: "support donate", + icon: "fa-ad", + exec: (): void => { + VideoAdPopup.show(); + }, + }, { id: "changeTheme", display: "Theme...", diff --git a/frontend/src/ts/popups/video-ad-popup.ts b/frontend/src/ts/popups/video-ad-popup.ts index c2fd26454..c31db3990 100644 --- a/frontend/src/ts/popups/video-ad-popup.ts +++ b/frontend/src/ts/popups/video-ad-popup.ts @@ -1,6 +1,6 @@ import * as Notifications from "../elements/notifications"; -function show(): void { +export function show(): void { if ($("#videoAdPopupWrapper").hasClass("hidden")) { $("#videoAdPopupWrapper") .stop(true, true) @@ -38,7 +38,7 @@ export function egVideoListener(options: Record): void { } else if (event === "finished") { hide(); } else if (event === "empty") { - Notifications.add("Failed to load video ad. Please try again later", 0, 3); + Notifications.add("Failed to load video ad. Please try again later", -1, 3); hide(); } }