User:WOSlinker/source.js

function synhi_queryString(p) { var re = RegExp('[&?]' + p + '=([^&]*)'); var matches; if (matches = re.exec(document.location)) { try { return decodeURI(matches[1]); } catch (e) { } }   return null; } if(mw.config.get('wgNamespaceNumber') != 0 && mw.config.get('wgArticleId') != 0) { $( function synhiEditButton {       mw.util.addPortletLink('p-cactions', mw.util.getUrl(null,{action:'edit',synhi:true}), 'synhi', 'p-synhi', 'synhi this page');   } )}

if(mw.config.get('wgAction') == 'edit' && synhi_queryString('synhi') == 'true') { $(function synhiEdit {

var myContent = document.getElementById('wpTextbox1').value;

myContent = myContent.replace(/\/ig,''); myContent = myContent.replace(/\/ig,'<\/syntaxhighlight\>');

myContent = myContent.replace(/\{\{template doc\}\}/i,'');

if(document.getElementById('wpTextbox1').value != myContent) { document.getElementById('wpTextbox1').value=myContent; document.getElementById('wpSummary').value='change source to syntaxhighlight'; document.getElementById('wpMinoredit').checked = true; };

} )}