Snippets/Tick "Ignore any warnings" automatically
![]() | |
---|---|
Language(s): | JavaScript Category:Snippets with JavaScript#Tick%20%22Ignore%20any%20warnings%22%20automatically |
Compatible with: | MediaWiki 1.20+ |
Description
Adding this snippet to MediaWiki:Common.js will tick the Ignore any warnings on Special:Upload automatically, if the user's browser has JavaScript enabled.
Code
/**
* Tick "Ignore any warnings" on Special:Upload automatically
*
* @author Florian Schmidt
* @date 2023-07-30
* @source https://www.mediawiki.org/wiki/Snippets/Tick_%22Ignore_any_warnings%22_automatically
*/
jQuery( function( $ ) {
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Upload' ) {
$( '#wpIgnoreWarning' ).prop( 'checked', true );
}
} );