User:Surafbrov/global.js

importArticles({   type: 'script',    articles: [		'u:dev:MediaWiki:UCXSearchBar.js'    ] });

jQuery(document).ready(function {	$('.page-footer div.page-footer__categories').removeClass('wds-is-collapsed'); /* Uncollapse bottom categories as it is useful for editors */ });

// https://terraria.fandom.com/wiki/User:Mr_Pie_5/common.js // Replace webp images with their original format {	const images = document.querySelectorAll("#content img"); const regex = new RegExp(/cb=\d+/); images.forEach(function(image) {	   image.setAttribute("src", image.src.replace(regex, "format=original"));	}); }

/*$(function {   if (mw.config.get("wgCanonicalNamespace") !== "File") return;    var fileLink = $(".fullMedia a.internal");    var fileHref = fileLink.attr("href") + (fileLink.attr("href").includes('?') ? '&' : '?') + 'format=original';   fileLink.attr("href", fileHref); });*/

$(function {   if (mw.config.get('skin') !== 'fandomdesktop') return;    var theme = mw.util.getParamValue('usetheme');    if (['light','dark'].indexOf(theme) === -1) return;    $.get(mw.util.wikiScript('wikia')+'?controller=ThemeApi&method=themeVariables&variant='+theme+'&cb='+(new Date.getTime)).done(function(data){ var $s = $('#pcjThemeSwitch')[0] || $(' ').attr('id','pcjThemeSwitch').appendTo('body'); $($s).text(data); $('body').removeClass('theme-fandomdesktop-light theme-fandomdesktop-dark').addClass('theme-fandomdesktop-'+theme); }); });