From 7e703ec1c35e7677b2833cb06fa2a19ce9c4b373 Mon Sep 17 00:00:00 2001 From: Serraniel Date: Wed, 29 Jul 2020 11:55:02 +0200 Subject: [PATCH] #6 Add border as horizontal seperator --- enhancements/animeRequests.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/enhancements/animeRequests.js b/enhancements/animeRequests.js index 3f55c2d..f03e7ea 100644 --- a/enhancements/animeRequests.js +++ b/enhancements/animeRequests.js @@ -2,7 +2,7 @@ registerScript(node => { // run the scripts if (isHtmlElement(node)) { changeFollowedStarColor(node); - changeOwnBorderColor(node); + changeBorderColor(node); removeUnknownUsers(node); } }); @@ -17,15 +17,19 @@ function changeFollowedStarColor(node) { followedItems.forEach(item => item.style.color = aniBlue); } -function changeOwnBorderColor(node) { +function changeBorderColor(node) { const targetTagName = 'MD-LIST-ITEM'; // tagName is upper case let updateFunc = item => { let profileLink = item.querySelectorAll('a[href*="/profile/"]:not([href="/profile/false"])'); + // highlight left border for own request if (profileLink.length > 0) { item.style.borderColor = aniBlue } + + // add border as horizontal seperator + item.style.borderBottom = "1px solid rgba(155,155,155, 0.2)"; } // are we target tag? @@ -35,7 +39,7 @@ function changeOwnBorderColor(node) { // find items -> all let requestItems = node.querySelectorAll('md-list-item'); - // change border color if profile link is not 'false' + // update borders requestItems.forEach(item => { updateFunc(item); });