MediaWiki:Common.js: Difference between revisions

No edit summary
Tag: Reverted
mNo edit summary
Tag: Reverted
Line 53: Line 53:


if ( mw.config.get( 'wgPageName' ) === 'Discord' ) {
if ( mw.config.get( 'wgPageName' ) === 'Discord' ) {
$.getScript("https://cdn.jsdelivr.net/npm/@widgetbot/html-embed")
// If we're on the Discord page, hide the "main" tab (ca-nstab-main)
.done(function() {
    $('#ca-nstab-main').hide();  // Hide the ca-nstab-main tab
    console.log("Script loaded successfully!");
 
})
    // Make the "my_namespace" tab (ca-my_namespace) active
.fail(function() {
    $('#ca-my_namespace').addClass('selected'); // Add the selected class to ca-my_namespace tab
    console.log("Failed to load script.");
} else {
});
    // If not on the Discord page, show the "main" tab again and remove the active class from ca-my_namespace
    $('#ca-nstab-main').show(); // Show the ca-nstab-main tab
    $('#ca-my_namespace').removeClass('selected'); // Remove the selected class from ca-my_namespace tab
}
}