MediaWiki:Gadget-SureSureSure.js: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
m namo bene Etichetta: Annulla |
|||
(3 versioni intermedie di uno stesso utente non sono mostrate) | |||
Riga 1:
/**
* Aggiunge una richiesta di conferma al primo click di un rollback nella pagina e
*
* L'uso è configurabile a seconda di touch screen e dimensioni della finestra.
*
Riga 19:
var opts = $.extend( defaultOpts, window.sureSureSure );
var isIOS = /iPad|iPhone|iPod/.test( navigator.platform ); // Safari iOS pre 13
if (
opts.maxScreenWidth
opts.hasTouchScreen !== ) {
return;
mw.hook( 'wikipage.content' ).add( function () {▼
$( '.mw-rollback-link a' ).click( function ( event ) {▼
var yes = 'ok-guy-im-not-accidentally-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;▼
}▼
} );▼
} );▼
}
if ( opts.disablePatrolAjax ) {
|