User:RansomTime/global.js

// Changes useless sidebar to a more editor friendly one $(function {	if (mw.config.get("skin") === "fandomdesktop") { var useAllScreenRealEstate= function {    document.getElementsByTagName("body")[0].className += " is-content-expanded";    document.getElementsByClassName("page__right-rail")[0].className += " is-rail-hidden";  };

useAllScreenRealEstate; // comment this out if you do not want to automatically fill screen on load

var wikiURI = "https://" + mw.Uri.host + "/wiki/"; var pageName = mw.config.get("wgPageName"); document.getElementsByClassName("global-navigation__logo")[0].href = wikiURI + "/Special:RecentChanges";

// hide verticals var navLinks = document.getElementsByClassName("global-navigation__links")[0]; while (navLinks.childElementCount !== 0) { navLinks.removeChild(navLinks.firstElementChild); }

var wikiURI = "https://" + mw.Uri.host + "/wiki/"; var pageName = mw.config.get("wgPageName"); var newNavChild = function(link, text) { var res = document.createElement("a"); res.className ="global-navigation__link"; res.href = link; res.innerText = text; return res; }

navLinks.appendChild(newNavChild(wikiURI + "Special:RecentChanges", "RC")); navLinks.appendChild(newNavChild(wikiURI + "Special:Log", "Logs")); navLinks.appendChild(newNavChild(wikiURI + "Special:Upload", "Upload")); navLinks.appendChild(document.createElement("hr")); navLinks.appendChild(newNavChild(wikiURI + "Special:WhatLinksHere/" + pageName, "Links")); navLinks.appendChild(newNavChild(wikiURI + "Special:RecentChangesLinked/" + pageName, "Related")); navLinks.appendChild(newNavChild("javascript:useAllScreenRealEstate", "Full"));

} });

// Automatically redirects forks

$(function {   var url = window.location.href;    if (url.search("oldschoolrunescape.fandom.com/wiki/") > 0) {        url = url.replace("oldschoolrunescape.fandom.com/wiki/","oldschool.runescape.wiki/w/");    } else if (url.search("runescape.fandom.com/wiki/") > 0) {       url = url.replace("runescape.fandom.com/wiki/","runescape.wiki/w/");    }     if(url !== window.location.href) {        window.location.href = url;    } });

window.ajaxPages = ["Special:RecentChanges","Special:NewPages"]; importScriptPage('MediaWiki:ReplyBottom/code.js', 'dev');

importScriptURI('//en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js' + '&action=raw&ctype=text/javascript');

// Changes WikiaContributer to IP in Article Comments // @Author Rappy

$('#WikiaArticleComments .edited-by a[href*="/wiki' + '/Special:Contributions"]').each(function { $(this).html(this.href.substring(this.href.lastIndexOf('/') + 1)); });