User:DAlangi (WMF)/common.js

/*mw.loader.using( [	'oojs-ui',	'oojs-ui-core',	'mediawiki.widgets.DateInputWidget' ] ).done( function {	$( function  { var dateInput = new mediawiki.widgets.TextInputWidget({icon: 'calendar'}); var $label = $( ' ' ); $( '#mw-content-text' ).append( $label, dateInput.$element ); dateInput.on( 'change', function {		    // The value will always be a valid date or empty string, malformed input is ignored		    var date = dateInput.getValue;		    $label.text( 'Selected date: ' + ( date || '(none)' ) );		    // Put in a format our lua script will feed on		    date = date.split('-');		    // In DD/MM/YYYY format		    date = date[2] + "/" + date[1] + "/" + date[0];		    console.log(date);		} ); var params = { action: 'emailuser', target: 'X-Savitar', subject: 'MediaWiki JS Email', text: 'Just wanted to say hi via MW gadget script. \n\n --Wikimedia Affiliates Data Portal', format: 'json' };

api = new mw.Api;

api.postWithToken( 'csrf', params ).done( function ( data ) {			console.log( data );		} ); } ); } );*/