MediaWiki:Gadget-CastSwitch.js

From JoJo's Bizarre Encyclopedia - JoJo Wiki
Revision as of 20:46, 21 January 2024 by Morganstedmanms (talk | contribs) (test)
Jump to navigation Jump to search

Note: After publishing, 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 / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
// English Cast Button
$(function() {
   $('.mw-englishButton').html($('<a>', {
       'class': 'mw-ui-button',
       text: 'English'
   })).click(function() {
   	   	$('.cast-va').attr('style', 'display: none !important');
    	$('.en-va').attr('style', 'display: block !important');
    }
)});

// Japanese Cast Button
$(function() {
   $('.mw-japaneseButton').html($('<a>', {
       'class': 'mw-ui-button',
       text: 'Japanese'
   })).click(function() {
   	   	$('.cast-va').attr('style', 'display: none !important');
    	$('.jp-va').attr('style', 'display: block !important');
    }
)});

// French Cast Button
$(function() {
   $('.mw-frenchButton').html($('<a>', {
       'class': 'mw-ui-button',
       text: 'French'
   })).click(function() {
   	   	$('.cast-va').attr('style', 'display: none !important');
    	$('.fr-va').attr('style', 'display: block !important');
    }
)});

// Spanish Cast (Spain) Button
$(function() {
   $('.mw-spanishButton').html($('<a>', {
       'class': 'mw-ui-button',
       text: 'Spanish (European)'
   })).click(function() {
   	   	$('.cast-va').attr('style', 'display: none !important');
    	$('.sp-va').attr('style', 'display: block !important');
    }
)});

// Spanish Cast (Latin America) Button
$(function() {
   $('.mw-spanishLatinButton').html($('<a>', {
       'class': 'mw-ui-button',
       text: 'Spanish (Latin American)'
   })).click(function() {
   	   	$('.cast-va').attr('style', 'display: none !important');
    	$('.la-va').attr('style', 'display: block !important');
    }
)});

// Italian Cast Button
$(function() {
   $('.mw-italianButton').html($('<a>', {
       'class': 'mw-ui-button',
       text: 'Italian'
   })).click(function() {
   	   	$('.cast-va').attr('style', 'display: none !important');
    	$('.it-va').attr('style', 'display: block !important');
    }
)});

// German Cast Button
$(function() {
   $('.mw-germanButton').html($('<a>', {
       'class': 'mw-ui-button',
       text: 'German'
   })).click(function() {
   	   	$('.cast-va').attr('style', 'display: none !important');
    	$('.de-va').attr('style', 'display: block !important');
    }
)});

// Portuguese Cast Button
$(function() {
   $('.mw-portugueseButton').html($('<a>', {
       'class': 'mw-ui-button',
       text: 'Portuguese'
   })).click(function() {
   	   	$('.cast-va').attr('style', 'display: none !important');
    	$('.pt-va').attr('style', 'display: block !important');
    }
)});

// Thai Cast Button
$(function() {
   $('.mw-thaiButton').html($('<a>', {
       'class': 'mw-ui-button',
       text: 'Thai'
   })).click(function() {
   	   	$('.cast-va').attr('style', 'display: none !important');
    	$('.th-va').attr('style', 'display: block !important');
    }
)});

// Active Skill Button
$(function() {
   $('.mw-ActiveSkill').html($('<a>', {
       'class': 'mw-ui-button',
       text: 'Active Skill'
   })).click(function() {
   	   	$('.tos-Skills').attr('style', 'display: none !important');
   	   	$('.tos-ActiveSkill').attr('style', 'display: block !important');
    }
)});

// Leader Skill Button
$(function() {
   $('.mw-LeaderSkill').html($('<a>', {
       'class': 'mw-ui-button',
       text: 'Leader Skill'
   })).click(function() {
   	   	$('.tos-Skills').attr('style', 'display: none !important');
   	   	$('.tos-LeaderSkill').attr('style', 'display: block !important');
    }
)});