MediaWiki:Gadget-CastSwitch.js

// English Cast Button $(function {  $('.mw-englishButton').html($('', {       'class': 'mw-ui-button',       text: 'English'   })).click(function { window.location = (""+window.location).replace(/#[A-Za-z0-9_]*$/,'')+"#EN"; } )});

// Japanese Cast Button $(function {  $('.mw-japaneseButton').html($('', {       'class': 'mw-ui-button',       text: 'Japanese'   })).click(function { window.location = (""+window.location).replace(/#[A-Za-z0-9_]*$/,'')+"#JP"; } )});

// French Cast Button $(function {  $('.mw-frenchButton').html($('', {       'class': 'mw-ui-button',       text: 'French'   })).click(function { window.location = (""+window.location).replace(/#[A-Za-z0-9_]*$/,'')+"#FR"; } )});

// Spanish Cast (Spain) Button $(function {  $('.mw-spanishButton').html($('', {       'class': 'mw-ui-button',       text: 'Spanish (European)'   })).click(function { window.location = (""+window.location).replace(/#[A-Za-z0-9_]*$/,'')+"#SP"; } )});

// Spanish Cast (Latin America) Button $(function {  $('.mw-spanishLatinButton').html($('', {       'class': 'mw-ui-button',       text: 'Spanish (Latin American)'   })).click(function { window.location = (""+window.location).replace(/#[A-Za-z0-9_]*$/,'')+"#LA"; } )});

// Italian Cast Button $(function {  $('.mw-italianButton').html($('', {       'class': 'mw-ui-button',       text: 'Italian'   })).click(function { window.location = (""+window.location).replace(/#[A-Za-z0-9_]*$/,'')+"#IT"; } )});

// German Cast Button $(function {  $('.mw-germanButton').html($('', {       'class': 'mw-ui-button',       text: 'German'   })).click(function { window.location = (""+window.location).replace(/#[A-Za-z0-9_]*$/,'')+"#DE"; } )});

// Portuguese Cast Button $(function {  $('.mw-portugueseButton').html($('', {       'class': 'mw-ui-button',       text: 'Portuguese'   })).click(function { window.location = (""+window.location).replace(/#[A-Za-z0-9_]*$/,'')+"#PT"; } )});

// Thai Cast Button $(function {  $('.mw-thaiButton').html($('', {       'class': 'mw-ui-button',       text: 'Thai'   })).click(function { window.location = (""+window.location).replace(/#[A-Za-z0-9_]*$/,'')+"#TH"; } )});