MediaWiki:Gadget-SureSureSure.js: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
evito rollback involontari prima che lo script sia caricato |
+hook |
||
Riga 19:
var opts = $.extend( defaultOpts, window.sureSureSure );
$( function () {
mw.hook( 'wikipage.content' ).add( function () {
.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;
}
} )
.css( 'pointer-events', 'auto' ); // ready
} );
// actually this is the simpler way to prevent automatic patrol action
// @see
if( opts.disablePatrolAjax ) {
$( '.patrollink[data-mw="interface"] a' ).off( 'click' );
|