EDIT: Click for video preview of the script.
This script will show animated avatars if they were originally uploaded as animated gifs or apngs (both animation formats work). The script will also turn back all avatars to squares except in three circumstances:
*coughs IE is probably coughs not working coughs
This script will show animated avatars if they were originally uploaded as animated gifs or apngs (both animation formats work). The script will also turn back all avatars to squares except in three circumstances:
- New post
- On mouse hover
- Potato pc too slow to load everything
JavaScript:
// ==UserScript==
// @name Better Avatar
// @version 2
// @grant none
// @match https://forums.taleworlds.com/*
// ==/UserScript==
window.onload = () => {
let avatars = document.getElementsByClassName("avatar");
for (let avatar of avatars) {
let previousSource = avatar["firstElementChild"];
if (previousSource !== null && previousSource.nodeName.toLowerCase() === "img") {
previousSource.setAttribute("src", previousSource.getAttribute("src").replace("/m/", "/o/"));
avatar.style.borderRadius = "0";
// Comment the above line if you don't want square avatars.
}
}
document.querySelectorAll(".avatar.avatar--separated").forEach(avatar => avatar.style.border = "none");
};
JavaScript:
// ==UserScript==
// @name Easily Accessible New Replies + Better Avatar
// @version 2
// @grant none
// @match https://forums.taleworlds.com/*
// ==/UserScript==
const createTag = (tagType, tagClass) => {
let newTag = document.createElement(tagType);
newTag.classList.add(tagClass);
return newTag;
}
const fixAvatars = () => {
let avatars = document.getElementsByClassName("avatar");
for (let avatar of avatars) {
let previousSource = avatar["firstElementChild"];
if (previousSource !== null && previousSource.nodeName.toLowerCase() === "img") {
previousSource.setAttribute("src", previousSource.getAttribute("src").replace("/m/", "/o/"));
avatar.style.borderRadius = "0";
// Comment the above line if you don't want square avatars.
}
}
document.querySelectorAll(".avatar.avatar--separated").forEach(avatar => avatar.style.border = "none");
}
window.onload = () => {
let newLink = createTag("a", "p-navEl-link");
newLink.setAttribute("href", "https://forums.taleworlds.com/index.php?find-threads/contributed");
newLink.appendChild(document.createTextNode("New Replies"));
let newDiv = createTag("div", "p-navEl");
newDiv.appendChild(newLink);
let newListItem = document.createElement("li");
newListItem.appendChild(newDiv);
document.querySelector(".p-nav-list").appendChild(newListItem);
fixAvatars();
}
*coughs IE is probably coughs not working coughs
Last edited: