ShowFeedID improvements v2 (#331)
This commit is contained in:
parent
850bd65734
commit
02455c5f8a
3 changed files with 17 additions and 7 deletions
|
|
@ -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 () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue