User:Philo04/global.js

mw.loader.getScript('https://dev.fandom.com/wiki/MediaWiki:ArticlesAsResources.js?action=raw&ctype=text/javascript').then(function {	importArticles({ type: "script", articles: [ "u:dev:MediaWiki:UCXSearchBar.js", "u:dev:MediaWiki:DupeArgs.js", "u:dev:MediaWiki:NullEditButton/code.js", "u:dev:MediaWiki:Q.js", "u:dev:MediaWiki:MassNullEdit/code.js", ]	}); });

$.when(mw.loader.using(["mediawiki.api", "mediawiki.jqueryMsg"])).then(function{   return new mw.Api.loadMessagesIfMissing(["preview", "previewnote", "continue-editing"]); }).then(function{	if(window.LIVEPREVIEWWARNINGSLoaded || mw.config.get("wgAction") != "edit" || !mw.user.options.get("uselivepreview")){		return;	}	window.LIVEPREVIEWWARNINGSLoaded = true;

$("input#wpPreview").on("click", function{		if(!$("#wikiPreview > .previewnote").length){			$("#wikiPreview").prepend($(" ", {				class: "previewnote"			}));		}		$("#wikiPreview > .previewnote").empty;		$("#wikiPreview > .previewnote").append([ $(" ", {				id: "mw-previewheader",				text: mw.msg("preview")			}), $(" ", {				append: [					$(mw.msg("previewnote")),					$(" ", { class: "mw-continue-editing", append: $("", {							href: "#editform",							text: ("→ " + mw.msg("continue-editing"))						}) })				]			})		]);		new mw.Api.post({ action: "parse", text: $("textarea#wpTextbox1").val, prop: "parsewarnings", title: mw.config.get("wgPageName"), format: "json" }).then(function(data){ data.parse.parsewarnings.forEach(function(warning){				$("#wikiPreview > .previewnote").append($(" " + warning + " "));			}); $("#wikiPreview > .previewnote").append($(" ")); });	}); });