MediaWiki:Common.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 730: Line 730:
     $('#bodyContent').append(downloadButton);
     $('#bodyContent').append(downloadButton);
});
});
$(document).ready(function() {
$(document).ready(function() {
     // Get the page title from the MediaWiki configuration
     // Get the page title from the MediaWiki configuration
     var pageTitle = mw.config.get('wgTitle');
     var pageTitle = mw.config.get('wgTitle');
 
   
     // Determine if the page is a subpage (contains a forward slash)
     // Check if the page title contains a forward slash
     if (pageTitle.indexOf('/') === -1) {
     if (pageTitle.indexOf('/') === -1) {
         // Show the download button if it's a top-level page
         // Show the download button if it's a top-level page