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

Contenuto cancellato Contenuto aggiunto
rimuovo parti obsolete ed estendo personalizzazioni utente, vedi discussioni 1 e 2
controllo per Safari; return valido anche per disablePatrolAjax
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 ) {