MediaWiki:Common.js

/* Any JavaScript here will be loaded for all users on every page load. */

/* yell at Crec0 */ function toggleTheme(state, twitter) { var mode = "light"; if (state) { mode = "dark"; }   twitter.contentWindow.document.querySelector("head > link").href = "https://platform.twitter.com/css/timeline.2fcb295ab98c2ce26f4cca0d2b2d0f48." + mode + ".ltr.css"; }

function registerEventListeners { var interval = setInterval(function {       var twitter = document.getElementById("twitter-widget-0");        if (twitter && twitter.contentWindow.document.readyState !== "loading") {            clearInterval(interval);

var themeButton = document.querySelector("#pt-darkmode-toggle > a"); toggleTheme(themeButton.innerHTML == "Default mode", twitter);

themeButton.addEventListener("click", function (e) {               toggleTheme(e.target.innerHTML == "Default mode", twitter);            }); }   }, 500);    setTimeout(function { clearInterval(interval); }, 120*1000); }

if (document.readyState !== "loading") { registerEventListeners; } else { window.addEventListener("DOMContentLoaded", registerEventListeners); } /* End of yelling at Crec0 */

/* Start of Tera trying stuff */

$( '#discord-widget' ).html( ' ' );

/* End of Tera trying stuff */