MediaWiki:Gadget-edittools.js

A Wikiforrásból

Megjegyzés: közzététel után frissítened kell a böngésződ gyorsítótárát, hogy lásd a változásokat.

  • Firefox / Safari: tartsd lenyomva a Shift gombot és kattints a Frissítés gombra a címsorban, vagy használd a Ctrl–F5 vagy Ctrl–R (Macen ⌘–R) billentyűkombinációt
  • Google Chrome: használd a Ctrl–Shift–R (Macen ⌘–Shift–R) billentyűkombinációt
  • Internet Explorer / Edge: tartsd nyomva a Ctrl-t, és kattints a Frissítés gombra, vagy nyomj Ctrl–F5-öt
  • Opera: Nyomj Ctrl–F5-öt
(function ( $, mw ) {
	var $specialchars;
	function addCharSubsetMenu( $editForm ) {
		$specialchars = $editForm.find( '#specialchars' );
		if (!$specialchars.length || $specialchars.find( 'select' ).length) return;
		var $menu = $( '<select />')
			.change( chooseCharSubset );
		$specialchars.find( 'p' ).each( function () {
			$( '<option />' )
				.attr( 'value', $(this).attr('id') )
				.text( $(this).attr('title') )
				.appendTo( $menu );
		});
		$menu.prependTo( $specialchars );
	}
	
	function chooseCharSubset( e ) {
		var value = $( e.target ).find( ':selected' )[0].value;
		$specialchars.find( '#' + value ).addClass( 'shown' );
		$specialchars.find( 'p:not(#' + value + ')' ).removeClass( 'shown' );
	}
	mw.hook( 'wikipage.editform' ).add( addCharSubsetMenu );
} ) ( jQuery, mediaWiki );