User:Jj137/MFC-NHL.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-NHL. |
//<pre>
function NHLabbreves()
{
var f = document.editform, t = f.wpTextbox1;
t.value = t.value.split('EDM').join('[[Edmonton Oilers]]');
t.value = t.value.split('ATL').join('[[Atlanta Thrashers]]');
t.value = t.value.split('ANA').join('[[Anaheim Ducks]]');
t.value = t.value.split('NJD').join('[[New Jersey Devils]]');
t.value = t.value.split('NYR').join('[[New York Rangers]]');
t.value = t.value.split('PIT').join('[[Pittsburgh Penguins]]');
t.value = t.value.split('COL').join('[[Colorado Avalanche]]');
t.value = t.value.split('SJS').join('[[San Jose Sharks]]');
t.value = t.value.split('VAN').join('[[Vancouver Canucks]]');
t.value = t.value.split('BOS').join('[[Boston Bruins]]');
t.value = t.value.split('DET').join('[[Detroit Red Wings]]');
t.value = t.value.split('DAL').join('[[Dallas Stars]]');
t.value = t.value.split('LAK').join('[[Los Angeles Kings]]');
t.value = t.value.split('PHX').join('[[Phoenix Coyotes]]');
t.value = t.value.split('CHI').join('[[Chicago Blackhawks]]');
t.value = t.value.split('NYI').join('[[New York Islanders]]');
t.value = t.value.split('FLA').join('[[Florida Panthers]]');
t.value = t.value.split('MTL').join('[[Montreal Canadiens]]');
t.value = t.value.split('WSH').join('[[Washington Capitals]]');
t.value = t.value.split('BUF').join('[[Buffalo Sabres]]');
t.value = t.value.split('CBJ').join('[[Columbus Blue Jackets]]');
t.value = t.value.split('OTT').join('[[Ottawa Senators]]');
t.value = t.value.split('PHI').join('[[Philadelphia Flyers]]');
t.value = t.value.split('TOR').join('[[Toronto Maple Leafs]]');
t.value = t.value.split('CGY').join('[[Calgary Flames]]');
t.value = t.value.split('STL').join('[[St. Louis Blues]]');
t.value = t.value.split('NSH').join('[[Nashville Predators]]');
t.value = t.value.split('MIN').join('[[Minnesota Wild]]');
t.value = t.value.split('CAR').join('[[Carolina Hurricanes]]');
t.value = t.value.split('TBL').join('[[Tampa Bay Lightning]]');
f.wpSummary.value = "Changed team abbreviations to full names";
}
function NHLtab()
{
// Only add for pages with the right string somewhere in the title
if (document.title.indexOf("Editing ") != -1)
{
mw.util.addPortletLink('p-cactions', 'javascript:NHLabbreves()', "NHL fixes");
}
}
$(NHLtab);
// </pre>