#6 Add border as horizontal seperator
This commit is contained in:
parent
2b08f5a559
commit
7e703ec1c3
1 changed files with 7 additions and 3 deletions
|
@ -2,7 +2,7 @@ registerScript(node => {
|
||||||
// run the scripts
|
// run the scripts
|
||||||
if (isHtmlElement(node)) {
|
if (isHtmlElement(node)) {
|
||||||
changeFollowedStarColor(node);
|
changeFollowedStarColor(node);
|
||||||
changeOwnBorderColor(node);
|
changeBorderColor(node);
|
||||||
removeUnknownUsers(node);
|
removeUnknownUsers(node);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -17,15 +17,19 @@ function changeFollowedStarColor(node) {
|
||||||
followedItems.forEach(item => item.style.color = aniBlue);
|
followedItems.forEach(item => item.style.color = aniBlue);
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeOwnBorderColor(node) {
|
function changeBorderColor(node) {
|
||||||
const targetTagName = 'MD-LIST-ITEM'; // tagName is upper case
|
const targetTagName = 'MD-LIST-ITEM'; // tagName is upper case
|
||||||
|
|
||||||
let updateFunc = item => {
|
let updateFunc = item => {
|
||||||
let profileLink = item.querySelectorAll('a[href*="/profile/"]:not([href="/profile/false"])');
|
let profileLink = item.querySelectorAll('a[href*="/profile/"]:not([href="/profile/false"])');
|
||||||
|
|
||||||
|
// highlight left border for own request
|
||||||
if (profileLink.length > 0) {
|
if (profileLink.length > 0) {
|
||||||
item.style.borderColor = aniBlue
|
item.style.borderColor = aniBlue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add border as horizontal seperator
|
||||||
|
item.style.borderBottom = "1px solid rgba(155,155,155, 0.2)";
|
||||||
}
|
}
|
||||||
|
|
||||||
// are we target tag?
|
// are we target tag?
|
||||||
|
@ -35,7 +39,7 @@ function changeOwnBorderColor(node) {
|
||||||
// find items -> all
|
// find items -> all
|
||||||
let requestItems = node.querySelectorAll('md-list-item');
|
let requestItems = node.querySelectorAll('md-list-item');
|
||||||
|
|
||||||
// change border color if profile link is not 'false'
|
// update borders
|
||||||
requestItems.forEach(item => {
|
requestItems.forEach(item => {
|
||||||
updateFunc(item);
|
updateFunc(item);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue