this post was submitted on 15 Jun 2023
16 points (100.0% liked)

Kbin Userstyles and Userscripts

15 readers
1 users here now

Custom CSS and JS to help improve your Kbin experience! ### Userscripts Greasy Fork ### Stylesheets UserStyles.world ### Userscript managers

founded 1 year ago
 

Given how quickly Beehaw reacted to external users, it's becoming more important for users to know "where" they are engaging with content, meaning "where the content was federate in from".

Lemmy mostly has this handled in the UI but kbin still needs some time. Additionally, while the QOL plugin does show domain suffixes it's not a super strong reminder that you are engaging with federated users/comments/articles. This script colorizes based on "threat level" or strictness of the moderators of the federated server.

compatible with the excellent QOL updates tampermonkey script by https://kbin.social/u/SirPsychoMantis, as well as the other 2 scripts I've previously written

top 22 comments
sorted by: hot top controversial new old
[–] [email protected] 4 points 1 year ago

this is great! if anyone wants to change the colors to their liking, this is how:
here are my colors shown in step 3:
blue: rgba(163, 120, 138, 0.2)
red: rgba(62, 70, 106, 0.2)!

[–] [email protected] 4 points 1 year ago (1 children)
[–] [email protected] 10 points 1 year ago (1 children)

That's an awesome feature. Would it be possible to add option so it doesn't color whole comment background but eg. adds color to the username or something?

[–] [email protected] 2 points 1 year ago* (last edited 1 year ago) (1 children)

I know this is an old question, but I just got around to playing with things and found if I switched to the borders being the indicator it's a lot "quieter".

I edited lines 40 and 41 to this:

GM_addStyle('[data-is-strictly-moderated="true"] { border-color: rgba(155, 100, 0, 1.0); border-width: 3px; border-style: double;}');

GM_addStyle('[data-is-federated-content="true"] { border-color: rgba(0, 100, 155, 1.0); border-width: 3px; border-style: double; }');

[–] [email protected] 0 points 1 year ago (2 children)

I changed the script a little bit more to use a class instead, but I've modified my class style to the original lookup style. Should work.

// And highlight to right of article/comment and changed green to blue.
GM_addStyle('[data-is-strictly-moderated="true"] { box-shadow:1px 0 0 #ff0000, 2px 0 0 #ff0000, 3px 0 0 #c80000, 4px 0 0 #960000, 5px 0 0 #640000; }');
GM_addStyle('[data-is-federated-content="true"] { box-shadow:1px 0 0 #009bff, 2px 0 0 #009bff, 3px 0 0 #0064fa, 4px 0 0 #0032c8, 5px 0 0 #000096; }');

[–] [email protected] 1 points 1 year ago

Thanks for the heads-up!

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago) (1 children)

That's nice too. The only thing I'd suggest is having the px as negatives, but that's because I actually didn't think it was working for a bit since I tend to read the left side and totally missed the highlights on the right.
Edit - I just realized that while this point is true on feeds, once you get into the comments putting those colors on the left side would mess up the coloring that shows a tree of comments since that's also on that side. So the fed colors really need to go on the other three sides to be compatible.

A preference setting for this (in the future) could have a huge number of styles to pick from. Some people may even prefer the original simple background color.

[–] [email protected] 0 points 1 year ago (1 children)

I don't want to hijack @CodingAndCoffee 's thread, but... look here. And if you choose to use that, check your options menu out. Though, I only allow it on the left side for articles in the options because I don't like overwriting the waterfall on the left (probably one of my extensions if you don't know what I'm talking about).

[–] [email protected] 1 points 1 year ago (1 children)

Tried the code out. It's working as far as the fed stuff like the original (that I can tell) but I don't see the additional stuff anywhere that your header insert should be pulling up, if I understand the coding intent. Nothing is new on the sidebar with other script options. Best guess is like other issues I've run into it's a Firefox thing.

[–] [email protected] 0 points 1 year ago (2 children)

Weird - I'm using LibreWolf, for all intents and purposes - Firefox. Example

[–] [email protected] 1 points 1 year ago

Since I saw it in the screenshot, I installed the code highlighter as well, and I also don't see it in the side bar. Maybe something in common? I have the compatibility on for the usability pack, even tried to turn it off and back on.

[–] [email protected] 1 points 1 year ago (1 children)

Found an error in the console when I run:

Uncaught TypeError: GM_info.script.header is undefined
createSettings moz-extension://5f0c0ea7-c5f6-4b77-b122-c07f6b739034/ kbin-federation-awareness.user.js#8:446
VMjycqurhgb9 moz-extension://5f0c0ea7-c5f6-4b77-b122-c07f6b739034/ kbin-federation-awareness.user.js#8:556

Just to be clear, originally I tried to install directly from your scripts page, but got thrown an error of invalid script. I couldn't figure out what was the cause, so I tried to just take the installed original code and copied/pasted entirely with your source. Which worked for the main purpose, just didn't show the sidebar stuff.

[–] [email protected] 0 points 1 year ago (1 children)

Do you use TamperMonkey, or something else?

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago) (1 children)

ViolentMonkey

Since uninstalling the fed script, I now get the same error, but it's pointed to the code-highlighter. Clearly the problem, just don't know why it's not compatible with what I have. I have not tried turning all the scripts off, but I figured you run most of those too so I doubt it's that.

[–] [email protected] 0 points 1 year ago (1 children)

Ah! That's why. The specs for gm_info are different for ViolentMonkey and TamperMonkey. That's insane to me, but I've got a fix! Again, really sorry for the hijack CodingAndCoffee.

Updated kbin-code-highlighting
Updated kbin-federation-awareness

[–] [email protected] 1 points 1 year ago (1 children)

Nailed it. Perfect.

Now I've got one more issue, since you've got your hands in it. I had asked before in this thread about how when infinite scrolling is on, the CSS doesn't get reloaded so none of the new feeds get accented. It works fine with manual page flipping since the site reloads. And I have no idea how the infinite loading works to figure out where a trigger might be to recall the script.

[–] [email protected] 0 points 1 year ago (1 children)

@Rhaedas

Figured out a solution for kbin-federation-awareness, will take longer for KCH. New link here.

[–] [email protected] 1 points 1 year ago

Working, good job and thanks!

[–] [email protected] 3 points 1 year ago

I just took a look at a code and it's kinda hilarious how beehaw is the only one in the strictly moderated list.

[–] CodingAndCoffee 3 points 1 year ago* (last edited 1 year ago)

I wrote one for Lemmy as well https://greasyfork.org/en/scripts/468763-lemmy-federation-awareness

this one also shows a distinction for kbin users, which I thought would be helpful for Lemmy users because the functionality of how the sites work is just different enough that not realizing someone you're replying to is using a different platform can and has been causing all kinds of confusion.

[–] [email protected] 2 points 1 year ago

Oh this is real helpful! Thank you

[–] [email protected] 1 points 1 year ago

Suggestions for UI enhancements for the next version of this type of thing:

Allow real time modification of the colors (including transparency)

Be able to choose where the colors are (background, border, text, other)

Able to type in or remove domains or maybe even communities and users and set the colors

(Probably too complex but ) have domains be on a selection menu with some indicator of their actual federation status

The latter is because this federation thing is very fluid and what you set this week may not be the best for next. Dare to dream that we could have some federation setting that would automatically determine where each domain is currently and let us know via this kind of thing, vs. having to research or go by word of mouth all the time.

load more comments
view more: next ›