Merge "'lang' attrib in #mw-imagepage-content should use ->getHtmlCode()"
[lhc/web/wiklou.git] / resources / mediawiki.special / mediawiki.special.javaScriptTest.js
1 /*
2 * JavaScript for Special:JavaScriptTest
3 */
4 jQuery( document ).ready( function( $ ) {
5
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() {
9
10 var $html = $( '<p><label for="useskin">'
11 + mw.message( 'javascripttest-pagetext-skins' ).escaped()
12 + ' '
13 + '</label></p>' ),
14 select = '<select name="useskin" id="useskin">';
15
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>';
21 } );
22 select += '</select>';
23
24 // Bind onchange event handler and append to form
25 $html.append(
26 $( select ).change( function() {
27 window.location = QUnit.url( { useskin: $(this).val() } );
28 } )
29 );
30
31 return $html;
32 } );
33 } );