MediaWiki:Gadget-SureSureSure.js: differenze tra le versioni
Vai alla navigazione
Vai alla ricerca
Contenuto cancellato Contenuto aggiunto
m fix opzioni di default |
ora anche per segnare come verificata - aggiunto anche prefisso azione; tolto .ready() deprecato |
||
Riga 10: | Riga 10: | ||
confirm: 'sicuro sicuro sicuro?' |
confirm: 'sicuro sicuro sicuro?' |
||
}; |
}; |
||
$ |
$( function () { |
||
$('.mw-rollback-link a').click( function (event) { |
$( '.mw-rollback-link a, .patrollink a' ).off( 'click' ).click( function ( event ) { |
||
var yes = 'ok-guy-im-not-accidetally-clicking-this'; |
var yes = 'ok-guy-im-not-accidetally-clicking-this'; |
||
if( ! $(this).hasClass(yes) && ! window.sureSureSure.opts._yetConfirmed ) { |
if( ! $(this).hasClass(yes) && ! window.sureSureSure.opts._yetConfirmed ) { |
||
$(this).addClass(yes).text( window.sureSureSure.opts.confirm ); |
var $t = $(this); |
||
$t.addClass(yes).text( $t.text() + ": " + window.sureSureSure.opts.confirm ); |
|||
event.preventDefault(); |
event.preventDefault(); |
||
window.sureSureSure.opts._yetConfirmed = true; |
window.sureSureSure.opts._yetConfirmed = true; |
Versione delle 01:08, 30 nov 2018
/**
* Per ringraziare chiede conferma, mentre per rollbackare no. BENE. asd
*
* @license [[WTFPL]]
* @author [[Utente:Valerio Bozzolan]] and contributors
* @see https://phabricator.wikimedia.org/T49782
*/
window.sureSureSure = window.sureSureSure || {};
window.sureSureSure.opts = window.sureSureSure.opts || {
confirm: 'sicuro sicuro sicuro?'
};
$( function () {
$( '.mw-rollback-link a, .patrollink a' ).off( 'click' ).click( function ( event ) {
var yes = 'ok-guy-im-not-accidetally-clicking-this';
if( ! $(this).hasClass(yes) && ! window.sureSureSure.opts._yetConfirmed ) {
var $t = $(this);
$t.addClass(yes).text( $t.text() + ": " + window.sureSureSure.opts.confirm );
event.preventDefault();
window.sureSureSure.opts._yetConfirmed = true;
}
} );
} );