Bitcoin Forum
December 15, 2024, 02:52:31 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: @theymos. Can you integrate these userscripts to forum?  (Read 353 times)
hd49728 (OP)
Legendary
*
Offline Offline

Activity: 2310
Merit: 1139



View Profile
August 26, 2019, 04:16:18 AM
Last edit: August 26, 2019, 06:09:00 AM by hd49728
Merited by LoyceV (2)
 #1

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://bitcointalk.org/index.php?topic=5148488.msg52264117#msg52264117

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)
    }
})


▄▄███████████████████▄▄
▄███████████████████████▄
████████▀░░░░░░░▀████████
███████░░░░░░░░░░░███████
███████░░░░░░░░░░░███████
██████▀░░░░░░░░░░░▀██████
██████▄░░░░░▄███▄░▄██████
██████████▀▀█████████████
████▀▄██▀░░░░▀▀▀░▀██▄▀███
███░░▀░░░░░░░░░░░░░▀░░███
████▄▄░░░░▄███▄░░░░▄▄████
▀███████████████████████▀
▀▀███████████████████▀▀
 
 CHIPS.GG 
▄▄███████▄▄
▄████▀▀▀▀▀▀▀████▄
███▀░▄░▀▀▀▀▀░▄░▀███
▄███
░▄▀░░░░░░░░░▀▄░███▄
▄███░▄░░░▄█████▄░░░▄░███▄
███░▄▀░░░███████░░░▀▄░███
███░█░░░▀▀▀▀▀░░░▀░░░█░███
███░▀▄░▄▀░▄██▄▄░▀▄░▄▀░██
▀███
░▀░▀▄██▀░▀██▄▀░▀░██▀
▀███
░▀▄░░░░░░░░░▄▀░██▀
▀███▄
░▀░▄▄▄▄▄░▀░▄███▀
▀█
███▄▄▄▄▄▄▄████▀
█████████████████████████
▄▄███████▄▄
███
████████████▄
▄█▀▀▀▄
█████████▄▀▀▀█▄
▄██████▀▄▄▄▄▄▀██████▄
▄█████████████▄████████▄
████████▄███████▄████████
█████▄█████████▄██████
██▄▄▀▀▀▀█████▀▀▀▀▄▄██
▀█████████▀▀███████████▀
▀███████████████████▀
██████████████████
▀████▄███▄▄
████▀
████████████████████████
3000+
UNIQUE
GAMES
|
12+
CURRENCIES
ACCEPTED
|
VIP
REWARD
PROGRAM
 
 
  Play Now  
LoyceMobile
Hero Member
*****
Offline Offline

Activity: 1698
Merit: 701


LoyceV on the road. Or couch.


View Profile WWW
August 26, 2019, 04:42:31 AM
Merited by hugeblack (1)
 #2

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

LoyceV on the road Advertise here for LN Don't deal with this account (exception)
Advertise here for LN Tip my kids Exchange LN (20 coins). 1% fee. No KYC <€50/month
My useful topics: Meritt & Trust & Moreee Art Advertise here for LN Foru[url=https://bitcointalk.org/m
akhjob
Sr. Member
****
Offline Offline

Activity: 1050
Merit: 416


Buy Bitcoin


View Profile WWW
August 26, 2019, 10:42:54 AM
Merited by hugeblack (1)
 #3

~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.
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18771


View Profile
August 26, 2019, 11:33:12 AM
 #4

Meriting a post does not necessarily imply agreement.
hatshepsut93
Legendary
*
Offline Offline

Activity: 3038
Merit: 2162


View Profile
August 26, 2019, 12:33:36 PM
 #5

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].
hugeblack
Legendary
*
Offline Offline

Activity: 2730
Merit: 4033



View Profile WWW
August 26, 2019, 06:04:33 PM
 #6

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

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Coyster
Legendary
*
Offline Offline

Activity: 2240
Merit: 1322


Playbet.io - Crypto Casino and Sportsbook


View Profile
August 26, 2019, 06:17:30 PM
 #7

@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.

███████████████
█████████████████████
██████▄▄███████████████
██████▐████▄▄████████████
██████▐██▀▀▀██▄▄█████████
████████▌█████▀██▄▄██████
██████████████████▌█████
█████████████▀▄██▀▀██████
██████▐██▄▄█▌███████████
██████▐████▀█████████████
██████▀▀███████████████
█████████████████████
███████████████

.... ..Playbet.io..Casino & Sportsbook.....Grab up to  BTC + 800 Free Spins........
████████████████████████████████████████
██████████████████████████████████████████████
██████▄▄████████████████████████████████████████
██████▐████▄▄█████████████████████████████████████
██████▐██▀▀▀██▄▄██████████████████████████████████
████████▌█████▀██▄▄█████▄███▄███▄███▄█████████████
██████████████████▌████▀░░██▌██▄▄▄██████████████
█████████████▀▄██▀▀█████▄░░██▌██▄░░▄▄████▄███████
██████▐██▄▄█▌██████████▀███▀███▀███▀███▀█████████
██████▐████▀██████████████████████████████████████
██████▀▀████████████████████████████████████████
██████████████████████████████████████████████
████████████████████████████████████████
Initscri
Hero Member
*****
Offline Offline

Activity: 1582
Merit: 759


View Profile WWW
August 26, 2019, 08:00:47 PM
 #8

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.

----------------------------------
Web Developer. PM for details.
----------------------------------
hd49728 (OP)
Legendary
*
Offline Offline

Activity: 2310
Merit: 1139



View Profile
August 27, 2019, 01:53:15 AM
 #9

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

▄▄███████████████████▄▄
▄███████████████████████▄
████████▀░░░░░░░▀████████
███████░░░░░░░░░░░███████
███████░░░░░░░░░░░███████
██████▀░░░░░░░░░░░▀██████
██████▄░░░░░▄███▄░▄██████
██████████▀▀█████████████
████▀▄██▀░░░░▀▀▀░▀██▄▀███
███░░▀░░░░░░░░░░░░░▀░░███
████▄▄░░░░▄███▄░░░░▄▄████
▀███████████████████████▀
▀▀███████████████████▀▀
 
 CHIPS.GG 
▄▄███████▄▄
▄████▀▀▀▀▀▀▀████▄
███▀░▄░▀▀▀▀▀░▄░▀███
▄███
░▄▀░░░░░░░░░▀▄░███▄
▄███░▄░░░▄█████▄░░░▄░███▄
███░▄▀░░░███████░░░▀▄░███
███░█░░░▀▀▀▀▀░░░▀░░░█░███
███░▀▄░▄▀░▄██▄▄░▀▄░▄▀░██
▀███
░▀░▀▄██▀░▀██▄▀░▀░██▀
▀███
░▀▄░░░░░░░░░▄▀░██▀
▀███▄
░▀░▄▄▄▄▄░▀░▄███▀
▀█
███▄▄▄▄▄▄▄████▀
█████████████████████████
▄▄███████▄▄
███
████████████▄
▄█▀▀▀▄
█████████▄▀▀▀█▄
▄██████▀▄▄▄▄▄▀██████▄
▄█████████████▄████████▄
████████▄███████▄████████
█████▄█████████▄██████
██▄▄▀▀▀▀█████▀▀▀▀▄▄██
▀█████████▀▀███████████▀
▀███████████████████▀
██████████████████
▀████▄███▄▄
████▀
████████████████████████
3000+
UNIQUE
GAMES
|
12+
CURRENCIES
ACCEPTED
|
VIP
REWARD
PROGRAM
 
 
  Play Now  
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2504



View Profile WWW
August 27, 2019, 08:37:03 AM
Merited by hd49728 (1)
 #10

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.

LoyceV
Legendary
*
Offline Offline

Activity: 3528
Merit: 17827


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
August 27, 2019, 09:03:59 AM
 #11

@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

▄▄███████████████████▄▄
▄█████████▀█████████████▄
███████████▄▐▀▄██████████
███████▀▀███████▀▀███████
██████▀███▄▄████████████
█████████▐█████████▐█████
█████████▐█████████▐█████
██████████▀███▀███▄██████
████████████████▄▄███████
███████████▄▄▄███████████
█████████████████████████
▀█████▄▄████████████████▀
▀▀███████████████████▀▀
Peach
BTC bitcoin
Buy and Sell
Bitcoin P2P
.
.
▄▄███████▄▄
▄████████
██████▄
▄██
█████████████████▄
▄███████
██████████████▄
███████████████████████
█████████████████████████
████████████████████████
█████████████████████████
▀███████████████████████▀
▀█████████████████████▀
▀██████████████████▀
▀███████████████▀
▀▀███████▀▀

▀▀▀▀███▀▀▀▀
EUROPE | AFRICA
LATIN AMERICA
▄▀▀▀











▀▄▄▄


███████▄█
███████▀
██▄▄▄▄▄░▄▄▄▄▄
████████████▀
▐███████████▌
▐███████████▌
████████████▄
██████████████
███▀███▀▀███▀
.
Download on the
App Store
▀▀▀▄











▄▄▄▀
▄▀▀▀











▀▄▄▄


▄██▄
██████▄
█████████▄
████████████▄
███████████████
████████████▀
█████████▀
██████▀
▀██▀
.
GET IT ON
Google Play
▀▀▀▄











▄▄▄▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!