- Joined
- Jul 8, 2020
Not sure if anyone else has already done this and shared, but I was getting annoyed by what a mess all the PMs that have everyone invited do to the UI and makes navigating the PM dropdown (and the PM pages themselves) hell. So I made some quick TamperMonkey scripts for myself to fix some of those things, and decided to share in case anyone else was annoyed too.
First one is a fix for the PM notification dropdown menu listing every single participant:

The second one makes the actual conversation pages on the PMs with giant lists of people more usable/readable by hiding the bottom of the PM participant list by default, adding a button to toggle displaying the list, and turning the list into a fixed height scrollable element to make the page more usable even if you have it unhidden:


To use these (if you don't already know), just install the tampermonkey extension, and create a new userscript for the one you want, and just control+A and control+V the code of the script, then save and it should be g2g. So, to use both of these, you'd have to create two new userscripts.
If I make any others in the future, I'll post them ITT. If anyone else has any KF improvement tampermonkey scripts they've made, feel free to share them ITT as well. If this isn't the right place to post this stuff, soz mods. If you have any questions, feel free to ask.
First one is a fix for the PM notification dropdown menu listing every single participant:

JavaScript:
// ==UserScript==
// @name Shorten KF convo participants
// @namespace http://tampermonkey.net/
// @version 0.1
// @description shortens the list of convo participants when you open the PM dropdown
// @author Cold Root Beer
// @match https://kiwifarms.net/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=kiwifarms.net
// @grant none
// ==/UserScript==
(function() {
'use strict';
let globalChangeLockout = false;
window.addEventListener('load', (event) => {
let convoMenu = document.querySelector(`[data-href="/conversations/popup"]`);
convoMenu.addEventListener('DOMSubtreeModified', CheckRunConvoShortener);
});
function CheckRunConvoShortener() {
if (!globalChangeLockout) {
globalChangeLockout = true;
ConvoShortener();
globalChangeLockout = false;
}
}
function ConvoShortener() {
let listOfShit = document.getElementsByClassName("listInline listInline--selfInline listInline--comma");
for (let index = 0; index < listOfShit.length; index++) {
let giantList = listOfShit[index];
let innerLength = giantList.childElementCount.valueOf();
if (innerLength > 4) {
let displayList = giantList.cloneNode(true);
giantList.innerHTML = '';
for (let j = 0; j < 4; j++) {
giantList.appendChild(displayList.childNodes[0]);
}
let countNode = document.createElement("li");
let countNodeText = document.createTextNode(`and ${innerLength - 3} more...`);
countNode.appendChild(countNodeText);
giantList.appendChild(countNode);
}
}
}
})();
The second one makes the actual conversation pages on the PMs with giant lists of people more usable/readable by hiding the bottom of the PM participant list by default, adding a button to toggle displaying the list, and turning the list into a fixed height scrollable element to make the page more usable even if you have it unhidden:


JavaScript:
// ==UserScript==
// @name Hide toggle Convo Participants
// @namespace http://tampermonkey.net/
// @version 0.1
// @description By default hides the list of Convo Participants within DMs. Button to toggle if the list displays, and makes the list a fixed height scrollable element to make it easier to deal with
// @author Cold Root Beer
// @match https://kiwifarms.net/conversations/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=kiwifarms.net
// @grant none
// ==/UserScript==
(function() {
'use strict';
window.addEventListener('load', (event) => {
let partipMenu = document.querySelector(`div.p-body-sidebar div.block div.block-container ol.block-body`);
partipMenu.style.display = "none";
partipMenu.style.overflowY = "scroll";
partipMenu.style.maxHeight = "65vh";
let toggleButton = document.createElement("button");
toggleButton.innerHTML = 'Show/Hide participants';
toggleButton.classList.add("button--primary", "button", "button--icon");
toggleButton.addEventListener("click", () => {
if (partipMenu.style.display === 'none') {
partipMenu.style.display = 'block';
} else {
partipMenu.style.display = 'none';
}
});
partipMenu.before(toggleButton);
});
})();
To use these (if you don't already know), just install the tampermonkey extension, and create a new userscript for the one you want, and just control+A and control+V the code of the script, then save and it should be g2g. So, to use both of these, you'd have to create two new userscripts.
If I make any others in the future, I'll post them ITT. If anyone else has any KF improvement tampermonkey scripts they've made, feel free to share them ITT as well. If this isn't the right place to post this stuff, soz mods. If you have any questions, feel free to ask.