User:Prtksxna/block.js

// 1. Find your common.js //       https://mediawiki.org/wiki/Special:MyPage/common.js

// 2. Add the following code to it: //       mw.loader.load('/w/index.php?title=User:Prtksxna/block.js&action=raw&ctype=text/javascript', 'text/javascript'); //       mw.loader.load('/w/index.php?title=User:Prtksxna/block.css&action=raw&ctype=text/css', 'text/css');

// 3. Go to Special:BlankPage (that is where we'll load the form) //       https://www.mediawiki.org/wiki/Special:BlankPage

// 4. ???

// 5. PROFIT!

mw.loader.using( ['oojs', 'oojs-ui-core', 'oojs-ui-widgets', 'mediawiki.widgets.UserInputWidget'], function {	if ( window.location.pathname === "/wiki/Special:BlankPage") {		updateTitle;		makeForm;	} });

function updateTitle { $('#firstHeading').text( 'Block user' ); }

function makeForm { var $c = $('#mw-content-text'); $c.empty; $c.append( 'This is a test, it is not the real block page.  '); var user = new OO.ui.FieldLayout( new mw.widgets.UserInputWidget({ required: true }), {		align: 'top',		label: 'Username or IP address',	} ); $c.append( user.$element ); editingCheck = new OO.ui.CheckboxInputWidget; accCheck = new OO.ui.CheckboxInputWidget; emailCheck = new OO.ui.CheckboxInputWidget; talkCheck = new OO.ui.CheckboxInputWidget; $c.append( 		$(' ').text('Actions to block:').css({display:'block', 'font-weight': 'bold'}),		editingCheck.$element,		$(' ').text('Editing').addClass('bold'),		accCheck.$element,		$(' ').text('Account creation').addClass('block'),		emailCheck.$element,		$(' ').text('Sending email'),		talkCheck.$element,		$(' ').text('Editing their own talk page')	); }