Skip to content

Instantly share code, notes, and snippets.

@devxan
Last active August 2, 2020 21:53
Show Gist options
  • Save devxan/38dab0023d3bbb00dcb90b46d971be5e to your computer and use it in GitHub Desktop.
Save devxan/38dab0023d3bbb00dcb90b46d971be5e to your computer and use it in GitHub Desktop.
A userscript that organizes all your messages on the Scratch messages page.
// ==UserScript==
// @name Message Organizer (Scratch)
// @version 0.1
// @description Organizes all your messages on the Scratch messages page.
// @author Ani-Xan (remade from jokebookservice1)
// @match https://scratch.mit.edu/messages
// @updateURL https://gist.github.com/Ani-Xan/38dab0023d3bbb00dcb90b46d971be5e/raw/scratch-message-organizer.user.js
// @grant none
// ==/UserScript==
function f(el){
var n = el.id;
var status = (el.checked)?"none":"list-item";
for(var j = 0; j < document.getElementById("notification-list").children.length; j++){
var cont = document.getElementById("notification-list").children[j];
try{
for(var i = 1;i < 200; i++) //Iterate over all messages
{
var q = cont.children[i];
if(q.children[0].className.indexOf(n)!=-1){q.style.display=status;}
}
} catch(e){if(0){console.log("")}}
}}
try{
var temp = document.getElementsByClassName("tabs-index")[0].children[0].appendChild(
document.createElement("LI")).innerHTML = "Hide:<br/><input type='checkbox' onclick='f(this);'\
id='follow'/>Followers<br/><input type='checkbox' onclick='f(this);'\
id='project'/>Studios<br/><input type='checkbox' onclick='f(this);'\
id='comment'/>Comments<br/><input type='checkbox' onclick='f(this);'\
id='love'/>Love-its<br/><input type='checkbox' onclick='f(this);'\
id='favorite'/>Favourites<br/>";
} catch(e){
if(0){console.log("Hello, this really shouldn't have happened :/")}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment