MediaWiki:Gadget-NewSection.js

Da Wikipedia, l'enciclopedia libera.
Vai alla navigazione Vai alla ricerca

Questa pagina definisce alcuni parametri di aspetto e comportamento generale di tutte le pagine. Per personalizzarli vedi Aiuto:Stile utente.


Nota: dopo aver salvato è necessario pulire la cache del proprio browser per vedere i cambiamenti (per le pagine globali è comunque necessario attendere qualche minuto). Per Mozilla / Firefox / Safari: fare clic su Ricarica tenendo premuto il tasto delle maiuscole, oppure premere Ctrl-F5 o Ctrl-R (Command-R su Mac); per Chrome: premere Ctrl-Shift-R (Command-Shift-R su un Mac); per Konqueror: premere il pulsante Ricarica o il tasto F5; per Opera può essere necessario svuotare completamente la cache dal menù Strumenti → Preferenze; per Internet Explorer: mantenere premuto il tasto Ctrl mentre si preme il pulsante Aggiorna o premere Ctrl-F5.

/**
 * create a "New section" link for the last section header (if present for that page at all)
 */
( function ( mw, $ ) {
	mw.hook( 'wikipage.content' ).add( function ( $content ) {
		var $newSectionLink = $( '#ca-addsection a' );
		if ( $newSectionLink.length ) {
			// add it within the brackets of last section
			$content.find( 'span.mw-editsection:last a:last' )
			.after(
				$newSectionLink.clone() // create a copy
				// lowercase text
				.text( $newSectionLink.text().toLowerCase() )
				// avoid duplicate accesskey
				.removeAttr( 'accesskey' ).updateTooltipAccessKeys()
			)
			.after( ' | ' ); // see [[MediaWiki:Pipe-separator]]
		}
	} );
}( mediaWiki, jQuery ) );