MediaWiki:Common.js: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
riscrittura da zero della casella combinata di MediaWiki:Edittools
comboboxEdittools: utilizzo di change al posto di click
Riga 122:
 
function comboboxEdittools() {
var $specialChars = $( '#specialchars' ), $select = $( '<select>' );
if ( $specialChars.length ) {
$select = $( '<select>' ).change( function () {
$specialChars.find( 'p' ).hide();
$selectspecialChars.find( 'option:firstselected' ).clickdata().show();
} );
$specialChars.find( 'p' ).each( function () {
var $p = $( this );
$( '<option>' ).html( $( this ).attr( 'id' ).replace( /_/g, ' ' ) )
.data( $( this ) ).appendTo( $select );
.click( function () {
$specialChars.find( 'p' ).hide();
$p.show();
} )
.appendTo( $select );
} );
$select.find( 'option:first' ).click();
$specialChars.prepend( $select );
$select.change();
}
}