221
edits
No edit summary |
No edit summary |
||
Line 731: | Line 731: | ||
}); | }); | ||
$(document).ready(function() { | $(document).ready(function() { | ||
// Get the page title | // 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) | ||
if (pageTitle.indexOf('/') === -1) { | if (pageTitle.indexOf('/') === -1) { | ||
// | // Show the download button if it's a top-level page | ||
$('a[href*="/find_epub.php"]').show(); | $('a[href*="/find_epub.php"]').show(); | ||
} else { | } else { | ||
// | // Hide the download button if it's a subpage | ||
$('a[href*="/find_epub.php"]').hide(); | $('a[href*="/find_epub.php"]').hide(); | ||
} | } | ||
}); | }); |