User:Frietjes/sandbox.js

// jQuery(document).ready(function($) { if(mw.config.get('wgNamespaceNumber') != -1) {	mw.loader.using(['mediawiki.util']).done( function { var myContent = document.getElementById('wpTextbox1').value; myContent = myContent.replace(/(\{\{)[_ ]*([Cc]ollege(?:Primary|Secondary)Style)[_ ]*(\|)/g, '$1$2$3'); myContent = myContent.replace(/(\{\{[Cc]ollege(?:Primary|Secondary)Style)(\|[^=\|\{\}=]*=[^=\|\{\}]*)(\|[^\{\}]*)(\}\})/g, '$1$3$2$4'); myContent = myContent.replace(/(\{\{[Cc]ollege(?:Primary|Secondary)Style)(\|[^=\|\{\}=]*=[^=\|\{\}]*)(\|[^\{\}]*)(\}\})/g, '$1$3$2$4'); myContent = myContent.replace(/(\{\{)[_ ]*[Cc]ollegePrimaryStyle[_ ]*(\|[^=\{\}\|]*)\|[ ]*border[ ]*=[ ]*0[ ]*\|[ ]*color[ ]*=[ ]*[^{}\|]*(\}\})/g, '$1NCAA color cell$2$3'); myContent = myContent.replace(/(\{\{)[_ ]*[Cc]ollegeSecondaryStyle[_ ]*(\|[^=\{\}\|]*)\|[ ]*border[ ]*=[ ]*0[ ]*\|[ ]*color[ ]*=[ ]*[^{}\|]*(\}\})/g, '$1NCAA secondary color cell$2$3'); myContent = myContent.replace(/(\{\{)[_ ]*[Cc]ollegePrimaryStyle[_ ]*(\|[^=\{\}\|]*)\|[ ]*color[ ]*=[ ]*[^{}\|]*\|[ ]*border[ ]*=[ ]*0[ ]*(\}\})/g, '$1NCAA color cell$2$3'); myContent = myContent.replace(/(\{\{)[_ ]*[Cc]ollegeSecondaryStyle[_ ]*(\|[^=\{\}\|]*)\|[ ]*color[ ]*=[ ]*[^{}\|]*\|[ ]*border[ ]*=[ ]*0[ ]*(\}\})/g, '$1NCAA secondary color cell$2$3'); document.getElementById('wpTextbox1').value = myContent; }); } }); //