ShowFeedID improvements v2 (#331)

This commit is contained in:
Inverle 2025-06-03 01:41:50 +02:00 committed by GitHub
parent 850bd65734
commit 02455c5f8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 7 deletions

View file

@ -5,17 +5,26 @@ window.addEventListener("load", function () {
const i18n = context.extensions.showfeedid_i18n;
const div = document.querySelector('h1 ~ div');
const button = document.createElement('button');
const button = document.createElement('a');
button.classList.add('btn');
button.classList.add('btn-icon-text');
button.id = 'showFeedId';
button.innerHTML = '<img class="icon" src="../themes/icons/look.svg" /> <span>' + i18n.show + '</span>';
if (new URLSearchParams(location.search).get('error')) {
button.style.display = 'block';
button.style.marginTop = '1rem';
}
div.appendChild(button);
const parent = button.parentElement;
parent.style.display = 'inline-flex';
parent.style.flexWrap = 'wrap';
parent.style.gap = '0.5rem';
// Check if only feeds with errors are being shown
if (document.querySelector('main.post > p.alert.alert-warn')) {
parent.style.flexDirection = 'column';
button.style.marginTop = '0.5rem';
}
const buttonText = button.querySelector('span');
button.addEventListener('click', function () {