User:ಮಲ್ನಾಡಾಚ್ ಕೊಂಕ್ಣೊ/font.js

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

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

if(mw.config.get('wgAction') == 'edit' && font_queryString('fontedit') == 'true') { $(function lint {       var myContent = document.getElementById('wpTextbox1').value;        myContent = myContent.replace(/\[\[([^\|^\]]*)\|([^\|^\]]*)<\/font>\]\]/gi,'$3 ');

myContent = myContent.replace(/\[\[([^\|^\]]*)\|([^\|^\]]*)<\/font>\]\]/gi,'$3 '); myContent = myContent.replace(/\[\[([^\|^\]]*)\|([^\|^\]]*)<\/font>\]\]/gi,'$3 '); myContent = myContent.replace(/\[\[([^\|^\]]*)\|([^\|^\]]*)<\/font>\]\]/gi,'$3 '); myContent = myContent.replace(/\[\[([^\|^\]]*)\|([^\|^\]]*)<\/font>\]\]/gi,'$3 '); myContent = myContent.replace(/\[\[([^\|^\]]*)\|([^\|^\]]*)<\/font>\]\]/gi,'$4 '); myContent = myContent.replace(/\[\[([^\|^\]]*)\|([^\|^\]]*)<\/font>\]\]/gi,'$4 '); myContent = myContent.replace(/\[\[([^\|^\]]*)\|([^\|^\]]*)<\/font>\]\]/gi,'$4 '); myContent = myContent.replace(/\[\[([^\|^\]]*)\|<font *face *\= *"?([\w \,]*)"? *color *\= *\"?([0-9a-f][0-9a-f][0-9a-f])\"? *>([^\|^\]]*)<\/font>\]\]/gi,'<span style="font-family:$2; color:#$3;">$4 '); myContent = myContent.replace(/\[\[([^\|^\]]*)\|<font *face *\= *"?([\w \,]*)"? *color *\= *\"?(\w*)\"? *>([^\|^\]]*)<\/font>\]\]/gi,'<span style="font-family:$2; color:$3;">$4 '); myContent = myContent.replace(/\[\[([^\|^\]]*)\|<font *color *\= *\"?(\#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f])\"? *face *\= *"?([\w \,]*)"? *>([^\|^\]]*)<\/font>\]\]/gi,'<span style="color:$2; font-family:$3;">$4 '); myContent = myContent.replace(/\[\[([^\|^\]]*)\|<font *color *\= *\"?(\#[0-9a-f][0-9a-f][0-9a-f])\"? *face *\= *"?([\w \,]*)"? *>([^\|^\]]*)<\/font>\]\]/gi,'<span style="color:$2; font-family:$3;">$4 '); myContent = myContent.replace(/\[\[([^\|^\]]*)\|<font *color *\= *\"?([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f])\"? *face *\= *"?([\w \,]*)"? *>([^\|^\]]*)<\/font>\]\]/gi,'<span style="color:#$2; font-family:$3;">$4 '); myContent = myContent.replace(/\[\[([^\|^\]]*)\|<font *color *\= *\"?([0-9a-f][0-9a-f][0-9a-f])\"? *face *\= *"?([\w \,]*)"? *>([^\|^\]]*)<\/font>\]\]/gi,'<span style="color:#$2; font-family:$3;">$4 '); myContent = myContent.replace(/\[\[([^\|^\]]*)\|<font *color *\= *\"?(\w*)\"? *face *\= *"?([\w \,]*)"? *>([^\|^\]]*)<\/font>\]\]/gi,'<span style="color:$2; font-family:$3;">$4 '); if(document.getElementById('wpTextbox1').value != myContent) { document.getElementById('wpTextbox1').value=myContent; document.getElementById('wpSummary').value='Replaced obsolete font tags and reduced Lint errors'; document.getElementById('wpMinoredit').checked = true; }   } )}