User:CowHammer/Scripts/wikilinkify.js

function wikilinkify { document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace(/\[http:\/\/en.wikipedia.org\/wiki\/([^\s]*)([^\]]*)/g, "[[WP:$1 |$2]"); var re = new RegExp("/\[WP:.*\]/g"); document.editform.wpSummary.value = "Bare wikipedia.org links -> WP: links by (partially working) Wikilinkify script"; document.editform.wpMinoredit.checked = true; document.editform.wpDiff.click; //document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace(re, decodeURIComponent(re)); }

addOnloadHook( function {  addPortletLink( 'p-cactions', 'javascript:wikilinkify', 'Wikilinkify', 'ca-wikilinkify', 'Convert bare WP links to WP: links' ); });