User:WOSlinker/bgcolor.js

function bgcolor_queryString(p) { var re = RegExp('[&?]' + p + '=([^&]*)'); var matches; if (matches = re.exec(document.location)) { try { return decodeURI(matches[1]); } catch (e) { } }   return null; }

//Add a 'bgcolor edit' tab if(mw.config.get('wgArticleId') != 0 ) { $( function bgcolorEditButton {       mw.util.addPortletLink('p-cactions', mw.util.getUrl(null,{action:'edit',bgcolor:true}), 'bgcolor', 'p-bgcolor', 'bgcolor edit');   } )}

if(mw.config.get('wgAction') == 'edit' && bgcolor_queryString('bgcolor') == 'true') { $(function bgcolor {       var myContent = document.getElementById('wpTextbox1').value;

//myContent = myContent.replace(/\\[\[(.*?)\]\]\<\/font\>/g,'$2 '); myContent = myContent.replace(/\(.*?)\<\/tt\>/g,' ');

if(document.getElementById('wpTextbox1').value != myContent) { document.getElementById('wpTextbox1').value=myContent; document.getElementById('wpSummary').value='code instead of tt tag'; //document.getElementById('wpMinoredit').checked = true; }

} )}