MediaWiki:VectorPlus.js: Difference between revisions

Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 3: Line 3:
   // Create the dropdown
   // Create the dropdown
   var toolsDropdown = '<div class="custom-tools-dropdown">' +
   var toolsDropdown = '<div class="custom-tools-dropdown">' +
     '<button class="dropbtn">Tools</button>' +
     '<div class="pBody">' +
     '<div class="dropdown-content">' +
    '<ul>' +
    '<li id="ca-tools" class="collapsible">' +
    '<a href="#" class="mw-collapsible-toggle"></a>' +
     '<div class="pBody">' +
    '<ul>' +
     $('#t-whatlinkshere, #t-recentchanges, #t-permalink, #t-info').prop('outerHTML') +
     $('#t-whatlinkshere, #t-recentchanges, #t-permalink, #t-info').prop('outerHTML') +
    '</ul>' +
    '</div>' +
    '</li>' +
    '</ul>' +
     '</div>' +
     '</div>' +
     '</div>';
     '</div>';

Revision as of 01:22, 23 February 2024

// Add a custom dropdown for the specified tools
$(document).ready(function() {
  // Create the dropdown
  var toolsDropdown = '<div class="custom-tools-dropdown">' +
    '<div class="pBody">' +
    '<ul>' +
    '<li id="ca-tools" class="collapsible">' +
    '<a href="#" class="mw-collapsible-toggle"></a>' +
    '<div class="pBody">' +
    '<ul>' +
    $('#t-whatlinkshere, #t-recentchanges, #t-permalink, #t-info').prop('outerHTML') +
    '</ul>' +
    '</div>' +
    '</li>' +
    '</ul>' +
    '</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();
});