User:ಮಲ್ನಾಡಾಚ್ ಕೊಂಕ್ಣೊ/wikitable attributes.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
Documentation for this user script can be added at User:ಮಲ್ನಾಡಾಚ್ ಕೊಂಕ್ಣೊ/wikitable attributes. |
function wikitable_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 'wikitable' tab
if(mw.config.get('wgArticleId') != 0 ) {
$( function wikitableEditButton() {
mw.util.addPortletLink('p-cactions',
mw.util.getUrl(null,{action:'edit',wikitableedit:true}),
'wikitable',
'p-wikitable',
'wikitable');
}
)}
if(mw.config.get('wgAction') == 'edit' && wikitable_queryString('wikitableedit') == 'true') {
$(function wikitable() {
var myContent = document.getElementById('wpTextbox1').value;
myContent = myContent.replace(/\{\| *border\=\"\d\" *cellpadding\=\"\d*\" *cellspacing\=\"\d*\" *class\=\"wikitable/g,'{| class="wikitable');
myContent = myContent.replace(/\{\| *border\=\"\d\" *cellspacing\=\"\d*\" *cellpadding\=\"\d*\" *class\=\"wikitable/g,'{| class="wikitable');
myContent = myContent.replace(/\{\| *border\=\"\d\" *cellpadding\=\"\d*\" *class\=\"wikitable/g,'{| class="wikitable');
myContent = myContent.replace(/\{\| *border\=\"\d\" *cellspacing\=\"\d*\" *class\=\"wikitable/g,'{| class="wikitable');
myContent = myContent.replace(/\{\| *cellpadding\=\"\d*\" *cellspacing\=\"\d*\" *border\=\"\d\" *class\=\"wikitable/g,'{| class="wikitable');
myContent = myContent.replace(/\{\| *cellspacing\=\"\d*\" *cellpadding\=\"\d*\" *border\=\"\d\" *class\=\"wikitable/g,'{| class="wikitable');
myContent = myContent.replace(/\{\| *cellpadding\=\"\d*\" *cellspacing\=\"\d*\" *class\=\"wikitable/g,'{| class="wikitable');
myContent = myContent.replace(/\{\| *cellspacing\=\"\d*\" *cellpadding\=\"\d*\" *class\=\"wikitable/g,'{| class="wikitable');
myContent = myContent.replace(/\{\| *cellspacing\=\"\d*\" *class\=\"wikitable/g,'{| class="wikitable');
myContent = myContent.replace(/\{\| *cellpadding\=\"\d*\" *class\=\"wikitable/g,'{| class="wikitable');
myContent = myContent.replace(/\{\| *class\= *\"wikitable sortable sortable\" border\=\"\d\"/g,'{| class="wikitable sortable"');
myContent = myContent.replace(/\{\| *class *\= *\"wikitable sortable\" *border\=\"\d\" *cellpadding\=\"\d*\" *cellspacing\=\"\d*\"/g,'{| class="wikitable sortable"');
myContent = myContent.replace(/\{\| *class *\= *\"wikitable sortable\" *border\=\"\d\" *cellspacing\=\"\d*\" *cellpadding\=\"\d*\"/g,'{| class="wikitable sortable"');
myContent = myContent.replace(/\{\| *class *\= *\"wikitable sortable\" *border\=\"\d\" *cellpadding\=\"\d*\"/g,'{| class="wikitable sortable"');
myContent = myContent.replace(/\{\| *class *\= *\"wikitable sortable\" *border\=\"\d\" *cellspacing\=\"\d*\"/g,'{| class="wikitable sortable"');
myContent = myContent.replace(/\{\| *class *\= *\"wikitable sortable\" *cellpadding\=\"\d*\" *cellspacing\=\"\d*\" *border\=\"\d\"/g,'{| class="wikitable sortable"');
myContent = myContent.replace(/\{\| *class *\= *\"wikitable sortable\" *cellspacing\=\"\d*\" *cellpadding\=\"\d*\" *border\=\"\d\"/g,'{| class="wikitable sortable"');
myContent = myContent.replace(/\{\| *class *\= *\"wikitable sortable\" *cellpadding\=\"\d*\" *cellspacing\=\"\d*\"/g,'{| class="wikitable sortable"');
myContent = myContent.replace(/\{\| *class *\= *\"wikitable sortable\" *cellspacing\=\"\d*\" *cellpadding\=\"\d*\"/g,'{| class="wikitable sortable"');
myContent = myContent.replace(/\{\| *class\=\"wikitable\" *border\=\"\d\" *cellpadding\=\"\d*\" *cellspacing\=\"\d*\"/g,'{| class="wikitable"');
myContent = myContent.replace(/\{\| *class\=\"wikitable\" *border\=\"\d\" *cellspacing\=\"\d*\" *cellpadding\=\"\d*\"/g,'{| class="wikitable"');
myContent = myContent.replace(/\{\| *class\=\"wikitable\" *border\=\"\d\" *cellpadding\=\"\d*\"/g,'{| class="wikitable"');
myContent = myContent.replace(/\{\| *class\=\"wikitable\" *border\=\"\d\" *cellspacing\=\"\d*\"/g,'{| class="wikitable"');
myContent = myContent.replace(/\{\| *class\=\"wikitable\" *cellpadding\=\"\d*\" *cellspacing\=\"\d*\" *border\=\"\d\"/g,'{| class="wikitable"');
myContent = myContent.replace(/\{\| *class\=\"wikitable\" *cellspacing\=\"\d*\" *cellpadding\=\"\d*\" *border\=\"\d\"/g,'{| class="wikitable"');
myContent = myContent.replace(/\{\| *class\=\"wikitable\" *cellpadding\=\"\d*\" *cellspacing\=\"\d*\"/g,'{| class="wikitable"');
myContent = myContent.replace(/\{\| *class\=\"wikitable\" *cellspacing\=\"\d*\" *cellpadding\=\"\d*\"/g,'{| class="wikitable"');
myContent = myContent.replace(/\{\| *border\=\d *cellpadding\=\d* *cellspacing\=\d* *class\=\"wikitable/g,'{| class="wikitable');
myContent = myContent.replace(/\{\| *border\=\d *cellspacing\=\d* *cellpadding\=\d* *class\=\"wikitable/g,'{| class="wikitable');
myContent = myContent.replace(/\{\| *cellspacing\=\d* *class\=\"wikitable/g,'{| class="wikitable');
myContent = myContent.replace(/\{\| *cellpadding\=\d* *class\=\"wikitable/g,'{| class="wikitable');
myContent = myContent.replace(/\{\| *class *\= *\"wikitable sortable\" *border\=\d *cellpadding\=\d* *cellspacing\=\d*/g,'{| class="wikitable sortable"');
myContent = myContent.replace(/\{\| *class *\= *\"wikitable sortable\" *border\=\d *cellspacing\=\d* *cellpadding\=\d*/g,'{| class="wikitable sortable"');
myContent = myContent.replace(/\{\| *class *\= *\"wikitable sortable\" *border\=\d *cellpadding\=\d*/g,'{| class="wikitable sortable"');
myContent = myContent.replace(/\{\| *class *\= *\"wikitable sortable\" *border\=\d *cellspacing\=\d*/g,'{| class="wikitable sortable"');
myContent = myContent.replace(/\{\| *class *\= *\"wikitable sortable\" *cellpadding\=\d* *cellspacing\=\d* *border\=\d/g,'{| class="wikitable sortable"');
myContent = myContent.replace(/\{\| *class *\= *\"wikitable sortable\" *cellspacing\=\d* *cellpadding\=\d* *border\=\d/g,'{| class="wikitable sortable"');
myContent = myContent.replace(/\{\| *class *\= *\"wikitable sortable\" *cellpadding\=\d* *cellspacing\=\d*/g,'{| class="wikitable sortable"');
myContent = myContent.replace(/\{\| *class *\= *\"wikitable sortable\" *cellspacing\=\d* *cellpadding\=\d*/g,'{| class="wikitable sortable"');
myContent = myContent.replace(/\{\| *class\=\"wikitable\" *border\=\"\d\" *cellpadding\=\d* *cellspacing\=\d*/g,'{| class="wikitable"');
myContent = myContent.replace(/\{\| *class\=\"wikitable\" *border\=\d *cellpadding\=\d* *cellspacing\=\d*/g,'{| class="wikitable"');
myContent = myContent.replace(/\{\| *class\=\"wikitable\" *border\=\d *cellspacing\=\d* *cellpadding\=\d*/g,'{| class="wikitable"');
myContent = myContent.replace(/\{\| *class\=\"wikitable\" *border\=\d *cellpadding\=\d*/g,'{| class="wikitable"');
myContent = myContent.replace(/\{\| *class\=\"wikitable\" *border\=\d *cellspacing\=\d*/g,'{| class="wikitable"');
myContent = myContent.replace(/\{\| *class\=\"wikitable\" *cellpadding\=\d* *cellspacing\=\d* *border\=\d/g,'{| class="wikitable"');
myContent = myContent.replace(/\{\| *class\=\"wikitable\" *cellspacing\=\d* *cellpadding\=\d* *border\=\d/g,'{| class="wikitable"');
myContent = myContent.replace(/\{\| *class\=\"wikitable\" *cellpadding\=\d* *cellspacing\=\d*/g,'{| class="wikitable"');
myContent = myContent.replace(/\{\| *class\=\"wikitable\" *cellspacing\=\d* *cellpadding\=\d*/g,'{| class="wikitable"');
myContent = myContent.replace(/\{\| *(border|cellpadding|cellspacing)\=\"?\d*\"? *(border|cellpadding|cellspacing)\=\"?\d*\"? *(border|cellpadding|cellspacing)\=\"?\d*\"? *class\=\"wikitable/g,'{| class="wikitable');
myContent = myContent.replace(/\{\| *(border|cellpadding|cellspacing)\=\"?\d*\"? *(border|cellpadding|cellspacing)\=\"?\d*\"? *class\=\"wikitable/g,'{| class="wikitable');
myContent = myContent.replace(/\{\| *(border|cellpadding|cellspacing)\=\"?\d*\"? *class\=\"wikitable/g,'{| class="wikitable');
myContent = myContent.replace(/ (border|cellpadding|cellspacing)\=\"?\d*\"? *(border|cellpadding|cellspacing)\=\"?\d*\"? *(border|cellpadding|cellspacing)\=\"?\d*\"? *class\=\"wikitable/g,' class="wikitable');
myContent = myContent.replace(/ (border|cellpadding|cellspacing)\=\"?\d*\"? *(border|cellpadding|cellspacing)\=\"?\d*\"? *class\=\"wikitable/g,' class="wikitable');
myContent = myContent.replace(/ (border|cellpadding|cellspacing)\=\"?\d*\"? *class\=\"wikitable/g,' class="wikitable');
myContent = myContent.replace(/class\=\"wikitable\" *(border|cellpadding|cellspacing)\=\"?\d*\"? *(border|cellpadding|cellspacing)\=\"?\d*\"? *(border|cellpadding|cellspacing)\=\"?\d*\"?/g,'class="wikitable"');
myContent = myContent.replace(/class\=\"wikitable\" *(border|cellpadding|cellspacing)\=\"?\d*\"? *(border|cellpadding|cellspacing)\=\"?\d*\"?/g,'class="wikitable"');
myContent = myContent.replace(/class\=\"wikitable\" *(border|cellpadding|cellspacing)\=\"?\d*\"?/g,'class="wikitable"');
myContent = myContent.replace(/class *\= *\"wikitable sortable\" *(border|cellpadding|cellspacing)\=\"?\d*\"? *(border|cellpadding|cellspacing)\=\"?\d*\"? *(border|cellpadding|cellspacing)\=\"?\d*\"?/g,'class="wikitable sortable"');
myContent = myContent.replace(/class *\= *\"wikitable sortable\" *(border|cellpadding|cellspacing)\=\"?\d*\"? *(border|cellpadding|cellspacing)\=\"?\d*\"?/g,'class="wikitable sortable"');
myContent = myContent.replace(/class *\= *\"wikitable sortable\" *(border|cellpadding|cellspacing)\=\"?\d*\"?/g,'class="wikitable sortable"');
myContent = myContent.replace(/class\=\"sortable wikitable\" *(border|cellpadding|cellspacing)\=\"?\d*\"? *(border|cellpadding|cellspacing)\=\"?\d*\"? *(border|cellpadding|cellspacing)\=\"?\d*\"?/g,'class="sortable wikitable"');
myContent = myContent.replace(/class\=\"sortable wikitable\" *(border|cellpadding|cellspacing)\=\"?\d*\"? *(border|cellpadding|cellspacing)\=\"?\d*\"?/g,'class="sortable wikitable"');
myContent = myContent.replace(/class\=\"sortable wikitable\" *(border|cellpadding|cellspacing)\=\"?\d*\"?/g,'class="sortable wikitable"');
myContent = myContent.replace(/\{\| *class\=wikitable *border\=\"\d\" *cellpadding\=\"\d*\" *cellspacing\=\"\d*\"/g,'{| class=wikitable');
myContent = myContent.replace(/\{\| *class\=wikitable *border\=\"\d\" *cellspacing\=\"\d*\" *cellpadding\=\"\d*\"/g,'{| class=wikitable');
myContent = myContent.replace(/\{\| *class\=wikitable *border\=\"\d\" *cellpadding\=\"\d*\"/g,'{| class=wikitable');
myContent = myContent.replace(/\{\| *class\=wikitable *border\=\"\d\" *cellspacing\=\"\d*\"/g,'{| class=wikitable');
myContent = myContent.replace(/\{\| *class\=wikitable *cellpadding\=\"\d*\" *cellspacing\=\"\d*\" *border\=\"\d\"/g,'{| class=wikitable');
myContent = myContent.replace(/\{\| *class\=wikitable *cellspacing\=\"\d*\" *cellpadding\=\"\d*\" *border\=\"\d\"/g,'{| class=wikitable');
myContent = myContent.replace(/\{\| *class\=wikitable *cellpadding\=\"\d*\" *cellspacing\=\"\d*\"/g,'{| class=wikitable');
myContent = myContent.replace(/\{\| *class\=wikitable *cellspacing\=\"\d*\" *cellpadding\=\"\d*\"/g,'{| class=wikitable');
myContent = myContent.replace(/\{\| *class\=wikitable *border\=\d *cellpadding\=\d* *cellspacing\=\d*/g,'{| class=wikitable');
myContent = myContent.replace(/\{\| *class\=wikitable *border\=\d *cellspacing\=\d* *cellpadding\=\d*/g,'{| class=wikitable');
myContent = myContent.replace(/\{\| *class\=wikitable *border\=\d *cellpadding\=\d*/g,'{| class=wikitable');
myContent = myContent.replace(/\{\| *class\=wikitable *border\=\d *cellspacing\=\d*/g,'{| class=wikitable');
myContent = myContent.replace(/\{\| *class\=wikitable *cellpadding\=\d* *cellspacing\=\d* *border\=\d/g,'{| class=wikitable');
myContent = myContent.replace(/\{\| *class\=wikitable *cellspacing\=\d* *cellpadding\=\d* *border\=\d/g,'{| class=wikitable');
myContent = myContent.replace(/\{\| *class\=wikitable *cellpadding\=\d* *cellspacing\=\d*/g,'{| class=wikitable');
myContent = myContent.replace(/\{\| *class\=wikitable *cellspacing\=\d* *cellpadding\=\d*/g,'{| class=wikitable');
myContent = myContent.replace(/class\=wikitable *(border|cellpadding|cellspacing)\=\"?\d*\"? *(border|cellpadding|cellspacing)\=\"?\d*\"? *(border|cellpadding|cellspacing)\=\"?\d*\"?/g,'class=wikitable');
myContent = myContent.replace(/class\=wikitable *(border|cellpadding|cellspacing)\=\"?\d*\"? *(border|cellpadding|cellspacing)\=\"?\d*\"?/g,'class=wikitable');
myContent = myContent.replace(/class\=wikitable *(border|cellpadding|cellspacing)\=\"?\d*\"?/g,'class=wikitable');
myContent = myContent.replace(/ (border|cellpadding|cellspacing)\=\"?\d*\"? *(border|cellpadding|cellspacing)\=\"?\d*\"? *(border|cellpadding|cellspacing)\=\"?\d*\"? *class\=wikitable/g,' class=wikitable');
myContent = myContent.replace(/ (border|cellpadding|cellspacing)\=\"?\d*\"? *(border|cellpadding|cellspacing)\=\"?\d*\"? *class\=wikitable/g,' class=wikitable');
myContent = myContent.replace(/ (border|cellpadding|cellspacing)\=\"?\d*\"? *class\=wikitable/g,' class=wikitable');
myContent = myContent.replace(/\|\- border\=1 cellspacing\=0 cellpadding\=5\n/g,'');
myContent = myContent.replace(/(\{\| *class\=\"wikitable plainrowheaders\") (border|cellpadding|cellspacing)\=\"\d*\" (border|cellpadding|cellspacing)\=\"\d*\" (border|cellpadding|cellspacing)\=\"\d*\"/g,'$1');
myContent = myContent.replace(/(\{\| *class\=\"wikitable plainrowheaders\") (border|cellpadding|cellspacing)\=\"\d*\" (border|cellpadding|cellspacing)\=\"\d*\"/g,'$1');
myContent = myContent.replace(/(\{\| *class\=\"wikitable plainrowheaders\") (border|cellpadding|cellspacing)\=\"\d*\"/g,'$1');
myContent = myContent.replace(/\{\| *class\=\"wikitable\" (width\=\"\d*\%\") *cellpadding\=\"\d*\" *cellspacing\=\"\d*\"/g,'{| class="wikitable" $1');
if(document.getElementById('wpTextbox1').value != myContent) {
if(document.getElementById('wpTextbox1').value != myContent) {
document.getElementById('wpTextbox1').value=myContent;
document.getElementById('wpSummary').value='Removed table attributes which are redundant in wikitable class';
document.getElementById('wpMinoredit').checked = true;
}
}
}
)}