MediaWiki:Common.js
MediaWiki interface page
More actions
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
/* =============================================================================
MediaWiki:Common.js
UnfinishedProjects Wiki
| TABLE OF CONTENTS |
| Utilizing Gadgets Extension |
Category Pages — MediaWiki:Gadget-categories.js
Tutorial Hub — MediaWiki:Gadget-tutorials.js
Project Hubs — MediaWiki:Gadget-projects.js
============================================================================= */
// Require license selection on Special:Upload
$( function () {
if ( mw.config.get( 'wgPageName' ) !== 'Special:Upload' ) return;
$( '#mw-upload-form' ).on( 'submit', function ( e ) {
var val = $( '#wpLicense' ).val();
if ( !val || val === '' ) {
e.preventDefault();
mw.notify( 'Please select a license before uploading.', {
type: 'error',
autoHide: false
} );
$( '#wpLicense' ).css( 'border', '2px solid red' );
}
} );
} );
// Enable 3D flip card toggle interactions
$(document).on('click', '.js-flip-btn', function (e) {
e.preventDefault();
$(this).closest('.project-card-inner, .tutorial-card-inner').toggleClass('is-flipped');
});