User:WOSlinker/common.js

//importScript('User:WOSlinker/defaultsort.js');

function span_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 'span edit' tab if(mw.config.get('wgArticleId') != 0 ) { $( function spanEditButton {       mw.util.addPortletLink('p-cactions', mw.util.getUrl(null,{action:'edit',span:true}), 'span', 'p-span', 'span edit');   } )}

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

myContent = myContent.replace(/\([ A-Za-z0-9\.\;\&\#\,\'\/\(\)]*)\<\/font\>/g,'$2 '); myContent = myContent.replace(/\([ A-Za-z0-9\.\;\&\#\,\'\/\(\)]*)\<\/font\>/g,'$2 ');

myContent = myContent.replace(/\/g,''); myContent = myContent.replace(/\/g,''); myContent = myContent.replace(/\/g,''); myContent = myContent.replace(/<\/font\>/g,' ');

if(document.getElementById('wpTextbox1').value != myContent) { document.getElementById('wpTextbox1').value=myContent; document.getElementById('wpSummary').value='tidy style for better HTML5 compatibility'; //document.getElementById('wpMinoredit').checked = true; }   } )}