MediaWiki:VectorPlus.js: Difference between revisions
Jump to navigation
Jump to search
(Created page with "$(document).ready(function() { // Check if the current page has a "Tools" menu if ($("#p-tb").length) { // Create a new dropdown menu var dropdown = $("<li>", { "class": "interlanguage-link interwiki-tools" }); var dropdownLink = $("<a>", { "href": "#", "text": "Tools" }); var dropdownList = $("<ul>"); // Move the "What links here" link to the dropdown menu var whatLinksHere = $("#t-whatlinkshere"); if (whatLinksHere.length) { dropd...") |
mNo edit summary |
||
Line 1: | Line 1: | ||
// Add a custom dropdown for the specified tools | |||
$(document).ready(function() { | $(document).ready(function() { | ||
// | // Create the dropdown | ||
var toolsDropdown = '<div class="custom-tools-dropdown">' + | |||
/ | '<button class="dropbtn">Tools</button>' + | ||
'<div class="dropdown-content">' + | |||
$('#t-whatlinkshere, #t-recentchanges, #t-permalink, #t-info').prop('outerHTML') + | |||
'</div>' + | |||
'</div>'; | |||
// Insert the dropdown after the "View history" button | |||
$('#ca-history').after(toolsDropdown); | |||
// Remove the original tools | |||
$('#t-whatlinkshere, #t-recentchanges, #t-permalink, #t-info').remove(); | |||
}); | }); |
Revision as of 01:16, 23 February 2024
// Add a custom dropdown for the specified tools
$(document).ready(function() {
// Create the dropdown
var toolsDropdown = '<div class="custom-tools-dropdown">' +
'<button class="dropbtn">Tools</button>' +
'<div class="dropdown-content">' +
$('#t-whatlinkshere, #t-recentchanges, #t-permalink, #t-info').prop('outerHTML') +
'</div>' +
'</div>';
// Insert the dropdown after the "View history" button
$('#ca-history').after(toolsDropdown);
// Remove the original tools
$('#t-whatlinkshere, #t-recentchanges, #t-permalink, #t-info').remove();
});