User:Aktsu/championship.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:Aktsu/championship. |
function cs(){
var txt=document.editform.wpTextbox1;
txt.value=txt.value.replace(/\[\[List_of_UFC_champions#Light_heavyweight_championship_.28205_lbs.2C_93_kg.29\|UFC Light Heavyweight Championship\]\]/gi, '[[UFC Light Heavyweight Championship]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Middleweight championship\|UFC Middleweight Champion\]\]/gi, '[[UFC Middleweight Championship|UFC Middleweight Champion]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Middleweight championship\|UFC Middleweight Championship\]\]/gi, '[[UFC Middleweight Championship]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Lightweight championship\|UFC Lightweight Championship\]\]/gi, '[[UFC Lightweight Championship]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Lightweight championship\|UFC Lightweight Champion\]\]/gi, '[[UFC Lightweight Championship|UFC Lightweight Champion]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Lightweight Championship \(Bantamweight championship before UFC 31\)\|UFC Lightweight Championship\]\]/gi, '[[UFC Lightweight Championship]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Heavyweight championship\|UFC Heavyweight Champion\]\]/gi, '[[UFC Heavyweight Championship|UFC Heavyweight Champion]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Heavyweight championship\|UFC Heavyweight Championship\]\]/gi, '[[UFC Heavyweight Championship]]');
txt.value=txt.value.replace(/\[\[UFC\]\] \[\[Heavyweight\]\] title/gi, '[[UFC Heavyweight Championship]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Welterweight Championship \(formerly Lightweight\)\|UFC Welterweight Championship\]\]/gi, '[[UFC Welterweight Championship]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Welterweight championship\|UFC Welterweight Champion\]\]/gi, '[[UFC Welterweight Championship|UFC Welterweight Champion]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Welterweight championship\|UFC Welterweight Championship\]\]/gi, '[[UFC Welterweight Championship]]');
txt.value=txt.value.replace(/\[\[UFC\]\] \[\[Middleweight\]\] title/gi, '[[UFC Middleweight Championship]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Lightweight championship\|UFC lightweight title\]\]/gi, '[[UFC Lightweight Championship]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Light heavyweight championship\|UFC Light Heavyweight Championship\]\]/gi, '[[UFC Light Heavyweight Championship]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Middleweight championship .28185 lb.2C 84 kg.29\|UFC Middleweight Championship\]\]/gi, '[[UFC Middleweight Championship]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Light heavyweight championship\|UFC Light-heavyweight Champion\]\]/gi, '[[UFC Light Heavyweight Championship|UFC Light Heavyweight Champion]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Light heavyweight championship\|UFC Light-heavyweight Championship\]\]/gi, '[[UFC Light Heavyweight Championship|UFC Light Heavyweight Champion]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Light heavyweight championship .28205 lbs.2C 93 kg.29\|UFC Light Heavyweight Championship\]\]/gi, '[[UFC Light Heavyweight Championship]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Heavyweight championship\|UFC heavyweight title\]\]/gi, '[[UFC Heavyweight Championship]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Light Heavyweight championship\|UFC light heavyweight title\]\]/gi, '[[UFC Light Heavyweight Championship]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Heavyweight championship \(295 lb, 134 kg\)\|UFC Heavyweight Champion\]\]/gi, '[[UFC Heavyweight Championship|UFC Heavyweight Champion]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Heavyweight championship \(295 lb, 134 kg\)\|UFC Heavyweight Championship\]\]/gi, '[[UFC Heavyweight Championship]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Heavyweight championship \(265 lb, 120 kg\)\|UFC Heavyweight Championship\]\]/gi, '[[UFC Heavyweight Championship]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Heavyweight championship\|UFC interim heavyweight champion\]\]/gi, '[[UFC Heavyweight Championship|UFC Interim Heavyweight Champion]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Heavyweight championship\|UFC interim heavyweight championship\]\]/gi, '[[UFC Heavyweight Championship|UFC Interim Heavyweight Championship]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Light Heavyweight championship\|For UFC light heavyweight title]]/gi, 'For [[UFC Light Heavyweight Championship]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Light Heavyweight championship\|Defended UFC light heavyweight title]]/gi, 'Defended [[UFC Light Heavyweight Championship]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Light Heavyweight championship\|Won UFC light heavyweight title]]/gi, 'Won [[UFC Light Heavyweight Championship]]');
txt.value=txt.value.replace(/\[\[List of UFC champions#Light Heavyweight championship\|UFC light heavyweight champion]]/gi, '[[UFC Light Heavyweight Championship|UFC Light Heavyweight Champion]]');
edit_summary_cs()
}
//Stolen from User:Lightmouse/monobook.js/script.js
function edit_summary_cs(){
// Add a tag to the summary box
var txt=document.editform.wpSummary;
var summary = "[[User:Aktsu/championship.js|script]]-assisted wikilinks fixes";
if (txt.value.indexOf(summary) == -1) {
if (txt.value.match(/[^\*\/\s][^\/\s]?\s*$/)) {
txt.value += " | ";
}
txt.value += summary;
}
document.editform.wpDiff.click();
}
$(function () {
if(document.forms.editform) {
mw.util.addPortletLink('p-tb', 'javascript:cs()', 'MMA wikilinks fixer', '', '', '', '');
}
});