MediaWiki:VectorPlus.js: Difference between revisions

Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
// Add a custom dropdown for the specified tools
$(function(){
$(document).ready(function() {
   var $pCactionsClone = $('#p-cactions').clone();
  // Create the dropdown
  $pCactionsClone.attr('id', 'p-tools');
   var toolsDropdown = '<div class="custom-tools-dropdown">' +
   $pCactionsClone.find('.vector-menu-heading').text('Tools');
    '<div class="pBody">' +
   $pCactionsClone.insertAfter('#ca-history');
    '<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();
});
});

Revision as of 01:25, 23 February 2024

$(function(){
  var $pCactionsClone = $('#p-cactions').clone();
  $pCactionsClone.attr('id', 'p-tools');
  $pCactionsClone.find('.vector-menu-heading').text('Tools');
  $pCactionsClone.insertAfter('#ca-history');
});