Topic on Project:Support desk/Flow

Tick "Ignore any warnings" by default

11
Kghbln (talkcontribs)

Heiya, is there a setting/way to tick "Ignore any warnings" situated in the "Upload Options" section on "Special:Upload" by default for all users. Thanks and cheers

Florianschmidtwelzow (talkcontribs)

You can use JS to do this, if you add the code to your MediaWiki:UploadForm.js page.

Kghbln (talkcontribs)

Thanks for your suggestion. Have not thought about this. Still have to figure out the code but yeah, that's a start!

Florianschmidtwelzow (talkcontribs)

haven't tested, but:

( function( $ ) {
  $( '#wpIgnoreWarning' ).prop( 'checked', true );
}( jQuery ) );
Kghbln (talkcontribs)

Hey! How cool is this???!!! I will give it a try now. Great and thanks a ton already!

Kghbln (talkcontribs)

Works great! Thank you, I am really happy! What about adding this to the Snippets list?

Florianschmidtwelzow (talkcontribs)
Kghbln (talkcontribs)

Thanks, you rule! :)

Planetenxin (talkcontribs)

This is not working for me with MW 1.27. I added the snipped in MediaWiki:UploadForm.js, cleared all caches, but nothing happens. Did I miss something?

Planetenxin (talkcontribs)

Adding this snippet to MediaWiki:Commons.js worked for me:

if ( mw.config.get ( 'wgPageName' ) == 'Special:Upload') {
  ( function( $ ) {
    $( '#wpIgnoreWarning' ).prop( 'checked', true );
  }( jQuery ) );
}
Ciencia Al Poder (talkcontribs)

Your updated script just restricts the execution of this code to Special:Upload, but does not change anything more, so if your code is working, the snippet should be working as well.

Reply to "Tick "Ignore any warnings" by default"