2 * JavaScript for Special:Preferences
5 $( '#prefsubmit' ).attr( 'id', 'prefcontrol' );
8 .before( $( '<ul id="preftoc"></ul>' ) )
9 .children( 'fieldset' )
11 .addClass( 'prefsection' )
13 .addClass( 'mainLegend' )
14 .each( function( i ) {
15 $(this).parent().attr( 'id', 'prefsection-' + i );
17 $(this).parent().show();
19 $( '#preftoc' ).append(
21 .addClass( i === 0 ? 'selected' : null )
24 .text( $(this).text() )
25 .attr( 'href', '#prefsection-' + i )
26 .mousedown( function( e ) {
27 $(this).parent().parent().find( 'li' ).removeClass( 'selected' );
28 $(this).parent().addClass( 'selected' );
32 .click( function( e ) {
33 $( '#preferences > fieldset' ).hide();
34 $( '#prefsection-' + i ).show();