User:Jj137/MFC-NBA.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:Jj137/MFC-NBA. |
//<pre>
function NBAabbreves()
{
var f = document.editform, t = f.wpTextbox1;
t.value = t.value.split('BOS').join('[[Boston Celtics]]');
t.value = t.value.split('NJN').join('[[New Jersey Nets]]');
t.value = t.value.split('NYK').join('[[New York Knicks]]');
t.value = t.value.split('PHI').join('[[Philadelphia 76ers]]');
t.value = t.value.split('TOR').join('[[Toronto Raptors]]');
t.value = t.value.split('CHI').join('[[Chicago Bulls]]');
t.value = t.value.split('CLE').join('[[Cleveland Cavaliers]]');
t.value = t.value.split('DET').join('[[Detroit Pistons]]');
t.value = t.value.split('IND').join('[[Indiana Pacers]]');
t.value = t.value.split('MIL').join('[[Milwaukee Bucks]]');
t.value = t.value.split('ATL').join('[[Atlanta Hawks]]');
t.value = t.value.split('CHA').join('[[Charlotte Bobcats]]');
t.value = t.value.split('MIA').join('[[Miami Heat]]');
t.value = t.value.split('ORL').join('[[Orlando Magic]]');
t.value = t.value.split('WAS').join('[[Washington Wizards]]');
t.value = t.value.split('DAL').join('[[Dallas Mavericks]]');
t.value = t.value.split('HOU').join('[[Houston Rockets]]');
t.value = t.value.split('MEM').join('[[Memphis Grizzlies]]');
t.value = t.value.split('NOH').join('[[New Orleans Hornets]]');
t.value = t.value.split('SAN').join('[[San Antonio Spurs]]');
t.value = t.value.split('GSW').join('[[Golden State Warriors]]');
t.value = t.value.split('LAC').join('[[Los Angeles Clippers]]');
t.value = t.value.split('LAL').join('[[Los Angeles Lakers]]');
t.value = t.value.split('PHX').join('[[Phoenix Suns]]');
t.value = t.value.split('SAC').join('[[Sacramento Kings]]');
t.value = t.value.split('DEN').join('[[Denver Nuggets]]');
t.value = t.value.split('MIN').join('[[Minnesota Timberwolves]]');
t.value = t.value.split('POR').join('[[Portland Trailblazers]]');
t.value = t.value.split('SEA').join('[[Seattle SuperSonics]]');
t.value = t.value.split('UTA').join('[[Utah Jazz]]');
f.wpSummary.value = "Changed team abbreviations to full names";
}
function NBAtab()
{
// Only add for pages with the right string somewhere in the title
if (document.title.indexOf("Editing ") != -1)
{
mw.util.addPortletLink('p-cactions', 'javascript:NBAabbreves()', "NBA fixes");
}
}
$(NBAtab);
// </pre>