MediaWiki:Common.js: Difference between revisions
MediaWiki interface page
More actions
No edit summary  |
No edit summary  |
||
| Line 26: | Line 26: | ||
   } ); |    } ); | ||
} ); | } ); | ||
// 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'); | |||
}); | |||
Latest revision as of 02:42, 2 April 2026
/* =============================================================================
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');
});