MediaWiki:Common.js
From Tycoon Gaming
Note: After saving, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
mw.loader.load( '/wiki/index.php?title=MediaWiki:ServerList.js&action=raw&ctype=text/javascript'); var list = ['Job Center', 'Grand Exchange', 'ATC', 'car dealership', 'job', 'skill', 'trucker']; var replacelist = ['Job_Center', 'Grand_Exchange', 'Airline_Pilot#ATC_.28Air_Traffic_Control.29', 'Car_Dealer', 'Job_Center', 'Skill_Level_Tokens', 'Trucking']; var edit = -1; function Replace(){ var path = window.location.search; edit = path.search('&action=edit'); console.log(edit); if (edit == -1){ for (var i = 0; i < list.length; i++){ var output; window.element = document.getElementById("bodyContent"); var save = window.element.innerHTML; output = save.replace(' ' + list[i] + ' ', '<a href="/wiki/index.php/' + replacelist[i] + '">' + list[i] + '</a>'); window.element.innerHTML = output; } } else { console.log('Is in Editor'); } } Replace();