Feature/#6 requests page remove empty user #10
|
@ -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 = ' ';
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue