Post
Topic
Board Meta
Merits 7 from 5 users
Re: @small improvement request. In merited posts, show your name in red or bold or..
by
hatshepsut93
on 26/08/2019, 01:45:36 UTC
⭐ Merited by TheBeardedBaby (2) ,Welsh (2) ,hd49728 (1) ,Pmalek (1) ,malevolent (1)
Strange that no one has made it yet, here's a script for this:

Code:
// ==UserScript==
// @name     Bitcointalk Highlight My Name in Merit
// @version  1.0
// @grant    none
// @include        https://bitcointalk.org/index.php?topic=*
// @run-at         document-end
// ==/UserScript==
;[...document.querySelectorAll(".td_headerandpost")].forEach(post => {
    let myName = document.querySelector("#hellomember b").textContent
    let allMerits = [...post.querySelectorAll(".smalltext i > a")]
    let myMerit = allMerits.find(e => e.textContent === myName)
    if (myMerit) {
        myMerit.style["font-weight"] = 1000
        if (allMerits.indexOf(myMerit) !== 0) {
            let myScore = myMerit.nextSibling
            post.querySelector(".smalltext i").removeChild(myMerit)
            post.querySelector(".smalltext i").removeChild(myScore)
            allMerits[0].before(myScore)
            myScore.before(myMerit)
        }
    }
})


Screenshot:



Also check my related userscript that sums all merits of a post -> https://bitcointalk.org/index.php?topic=5148488.msg52264117#msg52264117