User:DannyS712 test/move.js

mw.loader.using( 'mediawiki.util', function {    $(document).ready( function  { if ( $('.ambox-move > tbody > tr').length > -1 ){ var row = $('.ambox-move > tbody > tr')[0]; if ( !( row && row.children && row.children[1] && row.children[1].innerText ) ) { return; }	   	var noticeText = row.children[1].innerText; var target = noticeText.replace(/(It has been requested that the title of this article be changed to )|(\. Please see the relevant discussion. The page should not be moved unless the discussion is closed; summarizing the consensus achieved in support of the move\.)/g, ''); target = target.replace(/(A request that this article title be changed to )|( is under discussion\. Please do not move this article until the discussion is closed\.)/g, ''); target = encodeURIComponent( target ); console.log( 'MOVE', row, noticeText, target ); var current = mw.config.get('wgPageName'); var link = ' Move '; $(row).append( $(link) ); console.log( link ); }   } ); } );