Emoji Changer
*Release v2*Here is a userscript that is used to modify the emoji types that are shown on the forums. The emojis supported are Twitter, Google, Apple, Emoji One and None. All emojis are received straight from sponge forums via https. This has undergone fairly heavy use testing and does not seem to affect the performance of the forums in any way, but, if you find any way to extend or optimize it I will take it into consideration and modify it if need be. The script is fairly straightforward, just read the first part of it to learn how to configure it. Otherwise it is installed exactly like any other userscript on Tamermonkey or Greasemonkey. Enjoy!
// ==UserScript==
// @name Sponge Emoji
// @namespace http://altechcode.com
// @version 1.2
// @description Personalize Emojis on Sponge Forums
// @author Alexander Allen (RobodudeMC)
// @match https://forums.spongepowered.org/*
// @grant none
// ==/UserScript==
var types = ["apple","google","twitter","emoji_one","none"];
//CONFIGURATION
//Sets emoji type set number of emoji type you want.
// 0 - Apple
// 1 - Google
// 2 - Twitter
// 3 - Emoji One
// 4 - Remove Them!
var select = 1;
//DO NOT MODIFY VALUES PAST THIS POINT
var em = types[select];
function memoji(emoji){
var all = document.getElementsByClassName("emoji");
for (var i=0, max=all.length; i < max; i++) {
var e = all[i];
var a = e.getAttribute("src");
var b = a.replace("emoji_one", emoji);
if(a != b){
e.setAttribute("src", b);
}
if(emoji == "none"){
e.setAttribute("style","visibility:hidden;width:0px;")
}
}
}
memoji(em);
setInterval(function(){
memoji(em);
}, 10);
Desktop Notifications
*Beta v1.0*This is a userscript that will run on chrome (I don’t know about firefox) that will give you a desktop notification when you receive a personal message, get a reply, or get a mention, or a thread that you are tracking is replied to. It is currently in a very early beta and will be improved later. Just install it and it should work out of the box.
// ==UserScript==
// @name Sponge Desktop Notifications
// @namespace http://altechcode.com
// @version 0.1
// @description Enables Sponge Desktop Notifictions
// @author Alexander Allen (RobodudeMC)
// @match https://forums.spongepowered.org/*
// @grant none
// ==/UserScript==
var current = 0;
current = $.cookie("cook_not");
if(current === undefined || !current){
current = "0";
}
var focused = true;
window.onfocus = function() {
focused = true;
};
window.onblur = function() {
focused = false;
};
current = parseInt(current);
function notify(message) {
if (!Notification) {
alert('Please us a modern version of Chrome, Firefox, Opera or Firefox.');
return;
}
if (Notification.permission !== "granted")
Notification.requestPermission();
var notification = new Notification('Sponge Forums', {
icon: 'https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcQMaQ_eO_yCf3ixbXTPjyfxosX_f3G3_hEYNIUZEBQ70Ebgay58',
body: message
});
notification.onclick = function () {
window.focus();
this.cancel();
}
}
function check() {
if(focused == true){
//return;
}
var n = $('*.badge-notification').not('*.new-posts').not('*.clicks').not("*.unread").length;
if(n > 0){
var stramt = $('*.badge-notification').not('*.new-posts').not('*.clicks').not("*.unread")[0].innerText;
var amt = parseInt(stramt);
if(n > 2){
stramt = $('*.badge-notification').not('*.new-posts').not('*.clicks')[1].innerText;
amt += parseInt(stramt);
}
if(amt > current){
notify("You have " + stramt + " new notifications. Click to see them.");
}
current = amt;
$.cookie("cook_note", current);
}else{
$.cookie("cook_note", 0);
}
}
function refresh(){
if(focused == false){
window.location.reload();
}
}
check();
setInterval(function(){check()}, 500);
setInterval(function(){refresh()}, 100000);