2 * JavaScript for Special:JavaScriptTest
4 jQuery( document ).ready( function( $ ) {
6 // Create useskin dropdown menu and reload onchange to the selected skin
7 // (only if a framework was found, not on error pages).
8 $( '#mw-javascripttest-summary.mw-javascripttest-frameworkfound' ).append( function() {
10 var $html = $( '<p><label for="useskin">'
11 + mw.message( 'javascripttest-pagetext-skins' ).escaped()
14 select = '<select name="useskin" id="useskin">';
16 // Build <select> further
17 $.each( mw.config.get( 'wgAvailableSkins' ), function( id ) {
18 select += '<option value="' + id + '"'
19 + ( mw.config.get( 'skin' ) === id ? ' selected="selected"' : '' )
20 + '>' + mw.message( 'skinname-' + id ).escaped() + '</option>';
22 select += '</select>';
24 // Bind onchange event handler and append to form
26 $( select ).change( function() {
27 window.location = QUnit.url( { useskin: $(this).val() } );