User:Incnis Mrsi/Gebruiker.js

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
// see [[User_talk:Alexis_Jazz #Pasting from nl.Wikipedia]]
var GEBRUIKER = /\[\[[Gg]ebruiker:/g;
var OVERLEGG = /\[\[[Oo]verleg[ _]gebruiker:/g;

function Gebruiker() {
	var wpTextbox1 = document.editform.wpTextbox1;
	var text = wpTextbox1.value;
    wpTextbox1.value = text.replace(OVERLEGG,"[[user_talk:").replace(GEBRUIKER,"[[user:");
}

var Gbtn;
mw.loader.using( 'oojs-ui-core' ).done( function () {
//	alert('mw.loader.using');
    Gbtn = new OO.ui.ButtonWidget( {
    	id: 'Gebruiker-to-user',
        label: '<del>Gebruiker</del> user',
    } );
    Gbtn.on( 'click', Gebruiker);
} );

$( document ).ready( function() {
//	alert('$( document ).ready');
	$( '#mw-editpage-watch' ).append(Gbtn.$element);
} );