User:Jj137/baseball-replace.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/baseball-replace. |
//<pre>
function abbreves()
{
var f = document.editform, t = f.wpTextbox1;
t.value = t.value.split('FLA').join('[[Florida Marlins]]');
t.value = t.value.split('WAS').join('[[Washington Nationals]]');
t.value = t.value.split('ATL').join('[[Atlanta Braves]]');
t.value = t.value.split('PHI').join('[[Philadelphia Phillies]]');
t.value = t.value.split('NYM').join('[[New York Mets]]');
t.value = t.value.split('CIN').join('[[Cincinnati Reds]]');
t.value = t.value.split('STL').join('[[St. Louis Cardinals]]');
t.value = t.value.split('HOU').join('[[Houston Astros]]');
t.value = t.value.split('CHC').join('[[Chicago Cubs]]');
t.value = t.value.split('MIL').join('[[Milwaukee Brewers]]');
t.value = t.value.split('PIT').join('[[Pittsburgh Pirates]]');
t.value = t.value.split('LAD').join('[[Los Angeles Dodgers]]');
t.value = t.value.split('SFO').join('[[San Francisco Giants]]');
t.value = t.value.split('ARI').join('[[Arizona Diamondbacks]]');
t.value = t.value.split('COL').join('[[Colorado Rockies]]');
t.value = t.value.split('NYY').join('[[New York Yankees]]');
t.value = t.value.split('BOS').join('[[Boston Red Sox]]');
t.value = t.value.split('BAL').join('[[Baltimore Orioles]]');
t.value = t.value.split('TAM').join('[[Tampa Bay Rays|Tampa Bay Devil Rays]]');
t.value = t.value.split('TOR').join('[[Toronto Blue Jays]]');
t.value = t.value.split('MIN').join('[[Minnesota Twins]]');
t.value = t.value.split('CHW').join('[[Chicago White Sox]]');
t.value = t.value.split('CLE').join('[[Cleveland Indians]]');
t.value = t.value.split('DET').join('[[Detroit Tigers]]');
t.value = t.value.split('KCR').join('[[Kansas City Royals]]');
t.value = t.value.split('OAK').join('[[Oakland Athletics]]');
t.value = t.value.split('SEA').join('[[Seattle Mariners]]');
t.value = t.value.split('TEX').join('[[Texas Rangers]]');
t.value = t.value.split('lAA').join('[[Los Angeles Angels of Anaheim]]');
t.value = t.value.split('SDG').join('[[San Diego Padres]]');
f.wpSummary.value = "Changed team abbreviations to full names";
}
function MLBtab()
{
// Only add for pages with the right string somewhere in the title
if (document.title.indexOf("Editing ") != -1)
{
mw.util.addPortletLink('p-cactions', 'javascript:abbreves()', "abbrev fixes");
}
}
$(MLBtab);
// </pre>