User:Sportzpikachu/global.js

mw.loader.load( '//en.wikipedia.org/wiki/User:Chlod/Scripts/GoToTitle.js?action=raw&ctype=text/javascript' ); // Backlink: []

// ripped off from w:en:User:SD0001/common.js who ripped it off from w:en:User:Enterprisey/search-shortcuts var expansions = { // namespaces "t": "Template", "c": "Category", "me": "User:Sportzpikachu", "alt": "User:Sportshead", "co": "Special:Contribs" };   mw.config.get("wgSiteName") === "Hypixel SkyBlock Wiki" ? expansions.wp = "HSW" : 0; // "wp": "HSW"

function shortcutCB(event) { if (event.key === "/" || event.key === ":") { var val = $(this).val.toLowerCase; if (expansions[val]) { $(this).val(expansions[val]); }       }    }

$("#searchInput").on("keydown", shortcutCB);

Array.isArray(window.GoToTitleHooks) ? window.GoToTitleHooks.push(shortcutCB) : window.GoToTitleHooks = [shortcutCB];