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