User:Paper9oll/status.js

Source: Wikipedia, the free encyclopedia.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
//<nowiki>
// This is a experimental script that I'm using for learning, how to code userscript
mw.loader.using('mediawiki.util', function() {
	
	function setStatus() {
		document.editform.wpTextbox1.value = "test" + document.editform.wpTextbox1.value;
		document.editform.wpMinoredit.checked = true;
		document.editform.submit();
	}
	
	$(document).ready(function() {
		var link = mw.util.addPortletLink('p-cactions', '#', 'Status', 'p-status', 'Set status');
		$(link).click(function(event) {
			event.preventDefault();
			setStatus();
		});
	});
});
//<nowiki>