|
@@ -2,7 +2,7 @@ import { addParent, autoPlural, debounce, fetchAdvanced, pauseFor } from "@sv443
|
|
|
import { getFeature, getFeatures } from "../config.js";
|
|
|
import { siteEvents } from "../siteEvents.js";
|
|
|
import { addSelectorListener } from "../observers.js";
|
|
|
-import { error, getResourceUrl, log, warn, t, onInteraction, openInTab, getBestThumbnailUrl, getDomain, currentMediaType, domLoaded, waitVideoElementReady, getVideoTime, addStyleFromResource, fetchVideoVotes, getWatchId, getLocale, tp } from "../utils/index.js";
|
|
|
+import { error, getResourceUrl, log, warn, t, onInteraction, openInTab, getBestThumbnailUrl, getDomain, currentMediaType, domLoaded, waitVideoElementReady, addStyleFromResource, fetchVideoVotes, getWatchId, getLocale, tp } from "../utils/index.js";
|
|
|
import { mode, scriptInfo } from "../constants.js";
|
|
|
import { openCfgMenu } from "../menu/menu_old.js";
|
|
|
import { createCircularBtn, createRipple } from "../components/index.js";
|
|
@@ -365,7 +365,7 @@ export async function fixSpacing() {
|
|
|
//#region ab.queue btns
|
|
|
|
|
|
export async function initAboveQueueBtns() {
|
|
|
- const { scrollToActiveSongBtn, clearQueueBtn } = getFeatures();
|
|
|
+ const { scrollToActiveSongBtn } = getFeatures();
|
|
|
|
|
|
const contBtns = [
|
|
|
{
|
|
@@ -385,26 +385,6 @@ export async function initAboveQueueBtns() {
|
|
|
});
|
|
|
},
|
|
|
},
|
|
|
- {
|
|
|
- condition: clearQueueBtn,
|
|
|
- id: "clear-queue",
|
|
|
- resourceName: "icon-clear_list",
|
|
|
- titleKey: "clear_list",
|
|
|
- async interaction(evt: KeyboardEvent | MouseEvent) {
|
|
|
- try {
|
|
|
- // TODO: better confirmation dialog?
|
|
|
- if(evt.shiftKey || confirm(t("clear_list_confirm"))) {
|
|
|
- const url = new URL(location.href);
|
|
|
- url.searchParams.delete("list");
|
|
|
- url.searchParams.set("time_continue", String(await getVideoTime(0)));
|
|
|
- location.assign(url);
|
|
|
- }
|
|
|
- }
|
|
|
- catch(err) {
|
|
|
- error("Couldn't clear queue due to an error:", err);
|
|
|
- }
|
|
|
- },
|
|
|
- },
|
|
|
];
|
|
|
|
|
|
if(!contBtns.some(b => Boolean(b.condition)))
|