User:MonkeysHK/common.js

mw.loader.using(['mediawiki.util', 'mediawiki.api'], function {	$('pre.partialLoad').each(function { var $this = $(this); var api = new mw.Api; $this.hide; var button = $(' ', {			class: 'page-header__actions',			style: 'text-align: center; width: 100%; clear: both; display: block;',			html: $('', { class: 'wds-button wds-is-text page-header__action-button has-label', href: '#', html: 'Load This Part Of Content', click: function(event) { event.preventDefault; $(this).text('Loading...'); api.post({						action: "parse", 						contentmodel: "wikitext",						text: $this.html,					}) .done(function(d) {						var out = $(' ', { class: 'partialLoaded', html: d.parse.text['*'], });						$this.after(out);						$this.remove;						button.remove;					}) .catch(console.warn); }			})		});		$this.after(button); });	$(".partialLoad-warning").hide; });