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.

/**
 * Questo gadget è per te se non sai come mai MediaWiki chieda conferma
 * per ringraziare qualcuno, mentre per rollbackare no. asd
 *
 * This gadget is for you if you don't know why MediaWiki asks for confirmation
 * to thank someone, but it doesn't for rollbacking. asd
 *
 * TODO: this snippet should coexist with the 'mediawiki.page.patrol.ajax' ResourceLoader module somehow.
 *
 * @license [[WTFPL]] or [[GNU GPL]] or [[CC BY SA 3.0]] at your opinion
 * @author [[w:User:Valerio Bozzolan]] and contributors
 * @see https://phabricator.wikimedia.org/T49782
 */
$( function () {
	// default options
	var defaultOpts = {

		// An user can change the default confirmation message.
		confirm: 'sicuro sicuro sicuro?',

		// An user can set this to true to prevent also the automatic patrol action.
		disablePatrolAjax: false,

		// Allow to setup a maximum browser screen width.
		// If your screen is greater than this, SureSureSure will do nothing.
		// As default (undefined) means that SureSureSure will always work, whatever the screen.
		maxScreenWidth: undefined,
	};

	// allow to receive some user configuration
	window.sureSureSure = window.sureSureSure || {};

	// overwrite the default options
	var opts = $.extend( defaultOpts, window.sureSureSure );

	// do something only if the user has not customized a maximum screen width
	if( opts.maxScreenWidth === undefined || $(window).width() <= opts.maxScreenWidth ) {

		// register to the rollback link click event
		$( '.mw-rollback-link a' ).click( function ( event ) {
			var yes = 'ok-guy-im-not-accidetally-clicking-this';
			if( ! $(this).hasClass(yes) && ! window.sureSureSure._yetConfirmed ) {
				var $t = $(this);
				$t.addClass(yes).text( $t.text() + ": " + opts.confirm );
				event.preventDefault();
				window.sureSureSure._yetConfirmed = true;
			}
		} );

		// actually this is the simpler way to prevent automatic patrol action
		// @see mediwiki.page.patrol.ajax ResourceLoader module
		if( opts.disablePatrolAjax ) {
			$( '.patrollink[data-mw="interface"] a' ).off( 'click' );
		}
	}
} );