Author

Topic: @theymos. Can you integrate these userscripts to forum? (Read 351 times)

legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
@LoyceV, meriting/agreeing to the OP from trusted device but disagreeing from non-trusted device  Huh Strange that I agree with the non-trusted one.
You should think of (my) Merit as "this post is worth reading".

Meriting a post does not necessarily imply agreement.
I agree to that Cheesy (but I didn't Merit it)

A bit longer answer than I made on Mobile:
Changes made by Admin risk compromising the stability or security of the forum itself. Anything a user does, can at worst destroy his own system. I remember the Seeking reporter badge images that theymos wanted to add. That was more than a year ago, and this is theymos' last post on the subject:
when I went to implement this it ended up being quite a bit more of a can of worms than I originally thought
Anything that can be done user-side, should stay user-side Smiley
legendary
Activity: 1624
Merit: 2481
I don't think it is necessary for them to be integrated into the forum. Everyone can install them, if needed.


hatshepsut93  made two userscripts for forum users. They are all great, but there are not too many users have technical skills to use userscripts, they are not coders.


It takes roughly 1 minute (15 seconds if you have greasemonkey installed already) to activate such a script.

1. Download greasemonkey
2. Copy the script
3. Click on the greasemonkey button -> new user script
4. Paste the script
5. Profit

You don't need to be a coder or techsavy at all to install these scripts.
legendary
Activity: 2044
Merit: 1018
Not your keys, not your coins!
There is a post compiling a list of them, but I'll be looking into a way to make this a lot more easier.
Not sure, but maybe you implied about my list
List of Bitcointalk.org Userscripts/ Add-ons
Fortunately, @mrvuit made this one, and continuously upgraded it. It will be more convenient if that extension expands to other browsers, like Firefox, Brave, because some people don't want to use Chrome.
Bitcointalk Extension - All In One - Available on Chrome store - Version 2.3
hero member
Activity: 1582
Merit: 759
The whole idea about userscripts is that Admin doesn't have to do anything.

+1, w/ the amount of mods available (and which are going to be avail to the forum), there's absolutely 0 point in Theymos implementing. If people want them, they should pick & choose themselves.

There is a post compiling a list of them, but I'll be looking into a way to make this a lot more easier.
legendary
Activity: 2184
Merit: 1302
@LoyceV, meriting/agreeing to the OP from trusted device but disagreeing from non-trusted device  Huh Strange that I agree with the non-trusted one.
Meriting a post does not necessarily imply agreement.
Correct.
Effort and thought put into a post can make a user merit such post, even if the meriter feels the content of the OP is not 100% correct nor is he or she in absolute agreement, though agreement in most situations is the determinant factor.
legendary
Activity: 2702
Merit: 4002
I don't think everyone will agree that these improvements will be a real addition to the forum if implemented.
There are a lot of things that should be added to this forum, but what makes them on top of @theymos's  "What to Do" list is what matters.

I'm happy with some userscripts that make life easier. Cool
legendary
Activity: 3038
Merit: 2162
I don't think any userscripts should be integrated with forum, if you mean copying their code and inserting it into pages. Userscripts aren't very efficient, all this DOM manipulation can get pretty slow to the point where users will start to notice it. And some users might view this forum with Javascript turned off. It's just some of the reasons why stuff like that should generally be handled on server.

Meanwhile, we users can just unite all scripts into one addon, and this process has already started [ur=https://bitcointalk.org/index.php?topic=5178297.0l]here[/url].
legendary
Activity: 2268
Merit: 18748
Meriting a post does not necessarily imply agreement.
sr. member
Activity: 1050
Merit: 416
Buy Bitcoin
~skip~
Non-coders will be happy if forum integrates those features.
~skip~

OP, you don't have to be a coder to use an userscript, even non-coders can use them too. All they need is greasemonkey (firefox), or tampermonkey (chrome)  installed and copy-paste the code to get the desired output.

The whole idea about userscripts is that Admin doesn't have to do anything.

@LoyceV, meriting/agreeing to the OP from trusted device but disagreeing from non-trusted device  Huh Strange that I agree with the non-trusted one.
hero member
Activity: 1659
Merit: 687
LoyceV on the road. Or couch.
The whole idea about userscripts is that Admin doesn't have to do anything.
legendary
Activity: 2044
Merit: 1018
Not your keys, not your coins!
Began from that thread: @small improvement request. In merited posts, show your name in red or bold or..
hatshepsut93  made two userscripts for forum users. They are all great, but there are not too many users have technical skills to use userscripts, they are not coders. I think if it does not result in issues for forum, and does not take too much time, it will be great if you spend a little precious time to add them for forum users. Non-coders will be happy if forum integrates those features.
- Displays of total received merits for posts/ threads.
- Displays of username (logged-in account), if they sent already sent merit(s), at 1st position in list of merit senders for posts/ threads.
TopicDatewritten bySectionMerit
___________________________________________________________________________________________________________________________
Sum and display total received merits of posts/ threads25/8/2019hatshepsut93sums & displays all mertis of a post7+
Display username at 1st position in list of merit senders of posts/threads26/8/2019hatshepsut93sums & displays all mertis of a post1+

Display username at 1st position in list of merit senders of posts/threads
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://bitcointalksearch.org/topic/m.52264117

Sum and display total received merits of posts/ threads
I don't know if it was done before, couldn't find anything like that, so I made a tiny script that sums all mertis of a post and displays it before individual merits

Like this:


Code:
// ==UserScript==
// @name     Bitcointalk Post Merit Sum
// @version  1.0
// @grant    none
// @include        https://bitcointalk.org/index.php?topic=*
// @run-at         document-end
// ==/UserScript==

;[...document.querySelectorAll(".td_headerandpost")].forEach(post => {
    try {
        let sum = [...post.querySelectorAll(".smalltext i > a")]
            .map(e => {
                return parseInt(e.nextSibling.textContent.match(/\((.*)\)/)[1])
            })
            .reduce((acc, e) => acc + e, 0)
        if (sum > 0) {
            let sumElement = document.createElement("span")
            sumElement.textContent = `Total merit: ${sum} | `
            post.querySelector(".smalltext i").prepend(sumElement)
        }
    } catch (e) {
        console.error(e)
    }
})

Jump to: