מדיה ויקי:Common.js: הבדלים בין גרסאות בדף

וגם
עזב"ק
שורה 271: שורה 271:
if ( gadget && $.trim( gadget ) ) mw.loader.load( 'ext.gadget.ondemand-' + $.trim( gadget ) ); // np repetitions - resourceloader takes care
if ( gadget && $.trim( gadget ) ) mw.loader.load( 'ext.gadget.ondemand-' + $.trim( gadget ) ); // np repetitions - resourceloader takes care
} );
} );
} );
// if paramvalidator wrappers are visible, add a 'close' button, make them close on click, and tile them.
mw.hook( 'wikipage.content' ).add( function( content ) {
$( '.paramvalidator-wrapper',  content ).filter(':visible')
.prepend(
$( '<input>', { 'type': 'button' } )
.val( 'סימון' )
.click( function( e ) {
e.stopPropagation();
var wrapper = $( this ).closest( '.paramvalidator-wrapper' ).filter(':visible');
wrapper
.css( { position: 'inherit' } )
.next()    // hopefully, the offending template itself
.css( { border: 'solid red 3px' } );
} )
)
.prepend( $( '<input>', { 'type': 'button' } ).val( 'סגירה' ) )
.click( function() {
var $this = $( this );
$this.slideUp( 'slow', function() { $this.remove(); } );
} )
.append($('<p>')
.append($('<a>')
.text('להפסיק לראות את ההודעות הללו')
.click(function() {
mw.loader.using(['mediawiki.api', 'mediawiki.user']).done(function() {
new mw.Api().post( {
action: 'options',
optionname: "gadget-validate-template-params",
optionvalue: 0,
token: mw.user.tokens.get('csrfToken')
}); // post
}); // using
$( '.paramvalidator-wrapper').remove();
}) // click
)
.append( $('<p>')
.append($('<a>', { href: mw.util.getUrl('ויקיפדיה:מערכת בדיקת פרמטרים/תיקון שגיאות')})
.text('הסבר והדרכה')
) )
);
if ( $( '.paramvalidator-wrapper',  content ).filter(':visible').length > 1 ) {
$( '.paramvalidator-wrapper',  content ).filter(':visible')
.prepend(
$( '<input>', { 'type': 'button' } )
.val( 'סגירת הכול' )
.click( function() { $( '.paramvalidator-wrapper' ).remove(); } )
)
.prepend(
$( '<input>', { 'type': 'button' } )
.val( 'סימון הכול' )
.click( function( e ) {
e.stopPropagation();
$( '.paramvalidator-wrapper' ).filter(':visible')
.css( { position: 'inherit' } )
.next()
.css( { border: 'solid red 3px' } );
} )
);
}
} );
} );