From 78ddda416171610203f10db8333d7a3f667f7546 Mon Sep 17 00:00:00 2001 From: Clemens Neubauer Date: Thu, 16 May 2024 08:49:21 +0200 Subject: [PATCH] Show IDs of category too --- xExtension-showFeedID/static/showfeedid.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/xExtension-showFeedID/static/showfeedid.js b/xExtension-showFeedID/static/showfeedid.js index 6811f1e..92c0241 100644 --- a/xExtension-showFeedID/static/showfeedid.js +++ b/xExtension-showFeedID/static/showfeedid.js @@ -7,7 +7,7 @@ if (url.searchParams.get('c') === 'subscription') { button.classList.add('btn'); button.id = 'showFeedId'; - button.innerHTML = ' FeedID'; + button.innerHTML = ' Show IDs'; div.appendChild(button); document.getElementById('showFeedId').addEventListener('click', function (e) { @@ -22,5 +22,17 @@ if (url.searchParams.get('c') === 'subscription') { feedname_elem.innerHTML = feedname_elem.textContent + ' (ID: ' + feedId + ')'; } }); + + const cats = document.querySelectorAll('div.box > ul.box-content'); + + let catId; + let catname_elem; + cats.forEach(function(cat) { + catId = cat.dataset.catId; + catname_elem = cat.parentElement.querySelectorAll('div.box-title > h2')[0]; + if (catname_elem) { + catname_elem.innerHTML = catname_elem.textContent + ' (ID: ' + catId + ')'; + } + }) }); }