MediaWiki:VectorPlus.js

Revision as of 01:22, 23 February 2024 by Makko Oko (talk | contribs)
Jump to navigation Jump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
// 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();
});