Feature/#6 requests page remove empty user #10

Merged
Serraniel merged 4 commits from feature/#6-requests-page-remove-empty-user into develop 2020-07-29 11:55:42 +02:00
Showing only changes of commit 199c9db5c5 - Show all commits

View file

@ -3,6 +3,7 @@ registerScript(node => {
if (isHtmlElement(node)) { if (isHtmlElement(node)) {
changeFollowedStarColor(node); changeFollowedStarColor(node);
changeOwnBorderColor(node); changeOwnBorderColor(node);
removeUnknownUsers(node);
} }
}); });
@ -40,3 +41,28 @@ function changeOwnBorderColor(node) {
}); });
} }
} }
function removeUnknownUsers(node) {
const targetTagName = 'MD-LIST-ITEM'; // tagName is upper case
let updateFunc = item => {
let upperDiv = node.querySelector('[layout-align="start center"][flex]')
let lowerDiv = upperDiv.parentElement.nextElementSibling;
let anime = lowerDiv.innerText;
upperDiv.innerHTML = `<b>${anime}</b>`;
lowerDiv.innerHTML = '&nbsp;';
}
if (node.tagName === targetTagName) {
updateFunc(node);
} else {
// find items -> all
let requestItems = node.querySelectorAll('md-list-item');
// change border color if profile link is not 'false'
requestItems.forEach(item => {
updateFunc(item);
});
}
}