User:Mikevoir/global.js

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:AjaxBatchDelete.js',        'u:dev:MediaWiki:Bang.js',        'u:dev:MediaWiki:EditConflictAlert/code.js',        'u:dev:MediaWiki:FileUsageAuto-update/code.js',        'u:dev:MediaWiki:LastEdited/code.js',        'u:dev:MediaWiki:ListFiles/code.js',        'u:dev:MediaWiki:MassRename/code.js',        'u:dev:MediaWiki:MassNullEdit/code.js',        'u:dev:MediaWiki:PurgeButton.js',        'u:dev:MediaWiki:Standard Edit Summary/code.js',        'u:dev:MediaWiki:Wikimarks/code.js',    ] }); document.querySelector('img.wds-avatar__image').src = document.querySelector('img.wds-avatar__image').src.replace('width/26/height/26', 'width/40/height/40'); document.querySelector('img.pi-image-thumbnail').src = document.querySelector('img.pi-image-thumbnail').src.replace('scale-to-width-down/250', 'scale-to-width-down/400');

//credits to User:Iluvredwall (function {	// code based on the old Luapreviewer script (u:dev:MediaWiki:Luapreviewer/code.js)	//, which is no longer maintained and has been removed from the Dev wiki	var config = mw.config.get([ 'wgCanonicalNamespace', 'wgAction' // Note: will not be "edit" if using the new VisualEditor ]);	if ( config.wgCanonicalNamespace !== "Module" || !["edit", "submit"].includes(config.wgAction) ) {		return;	}	$.when( mw.loader.using(['mediawiki.api', 'ext.scribunto.edit']) ).done(function { var api = new mw.Api; $(function {			$("#mw-scribunto-output").attr("style","white-space:pre-wrap");			if ($(".mw-scribunto-input").length == 0) {				console.error("can't find element to attach to?");				return;			}			const clearButton = $(".mw-scribunto-console-fieldset").find("input");			const previewButton = clearButton.parent.append('');        			const preview = $(' ').insertBefore(".mw-scribunto-input");			previewButton.on("click", function { if ($(".mw-scribunto-print").last.length > 0) { api.post({						action: 'parse',						text: $(".mw-scribunto-print").last.text					}).done(function(data) {						if (data.error) {							preview.html(data.error);							return;						}						preview.html(' Preview '+data.parse.text["*"]+' ');						mw.hook('wikipage.content').fire(preview);					}); } else { preview.html(""); }			});			clearButton.on("click", function { preview.html("") });		}); }); });