From 0098d0d1c9284f8d9e9569b3d654a3efc1cb9cd1 Mon Sep 17 00:00:00 2001 From: coomdev Date: Sun, 17 Apr 2022 20:49:24 +0200 Subject: [PATCH] Show number of embeds when hovering the discard button --- main.meta.js | 2 +- main.user.js | 10 +++++++--- src/Components/PostOptions.svelte | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/main.meta.js b/main.meta.js index 8e72b24..6c655b5 100644 --- a/main.meta.js +++ b/main.meta.js @@ -1,7 +1,7 @@ // ==UserScript== // @name PNGExtraEmbed // @namespace https://coom.tech/ -// @version 0.189 +// @version 0.190 // @description uhh // @author You // @match https://boards.4channel.org/* diff --git a/main.user.js b/main.user.js index bc05d2d..7529288 100644 --- a/main.user.js +++ b/main.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name PNGExtraEmbed // @namespace https://coom.tech/ -// @version 0.189 +// @version 0.190 // @description uhh // @author You // @match https://boards.4channel.org/* @@ -81,7 +81,7 @@ var define_BUILD_VERSION_default; var init_define_BUILD_VERSION = __esm({ ""() { - define_BUILD_VERSION_default = [0, 189]; + define_BUILD_VERSION_default = [0, 190]; } }); @@ -20019,6 +20019,7 @@ let i; let t_value = ctx[1].is4chanX ? "" : "\u274C"; let t; + let a_title_value; let mounted; let dispose; return { @@ -20027,7 +20028,7 @@ i = element("i"); t = text(t_value); attr(i, "class", "fa fa-times svelte-bgqqj3"); - attr(a, "title", "Discard ALL selected content"); + attr(a, "title", a_title_value = "Discard ALL " + ctx[0].length + " files"); attr(a, "class", "svelte-bgqqj3"); }, m(target, anchor) { @@ -20042,6 +20043,9 @@ p(ctx2, dirty) { if (dirty & 2 && t_value !== (t_value = ctx2[1].is4chanX ? "" : "\u274C")) set_data(t, t_value); + if (dirty & 1 && a_title_value !== (a_title_value = "Discard ALL " + ctx2[0].length + " files")) { + attr(a, "title", a_title_value); + } }, d(detaching) { if (detaching) diff --git a/src/Components/PostOptions.svelte b/src/Components/PostOptions.svelte index aa5fd16..b400ee3 100644 --- a/src/Components/PostOptions.svelte +++ b/src/Components/PostOptions.svelte @@ -145,7 +145,7 @@ ((links = []), restore())} - title="Discard ALL selected content" + title="Discard ALL {links.length} files" > {$appState.is4chanX ? "" : "❌"}