MediaWiki:Gadget-SureSureSure.js: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
rimuovo parti obsolete ed estendo personalizzazioni utente, vedi discussioni 1 e 2
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
* econsente lasciaa chetutti i successivi rollback partano comesuccessivi di consuetopartire all'istante come di consueto.
* 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 >=< window.innerWidth &&||
( opts.hasTouchScreen =!== undefined || &&
opts.hasTouchScreen !=== ( isIOS ? isIOS : navigator.maxTouchPoints > 0 )
) {
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;
}
} );
} );
}
 
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 ) {