MediaWiki:VectorPlus.js: Difference between revisions

Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
// Clone and move the "Tools" section to the right-navigation area
$(function(){
$(function(){
   var $pCactionsClone = $('#p-cactions').clone();
  // Clone the "Tools" section from the sidebar
   $pCactionsClone.attr('id', 'p-tools');
   var $toolsMenu = $('#p-tb').clone();
   $pCactionsClone.find('.vector-menu-heading').text('Tools');
 
   $pCactionsClone.insertAfter('#ca-history');
  // Create a new "Tools" section in the right-navigation
   var $newToolsMenu = $('<div id="p-newtools" class="vector-menu-content"></div>');
   $newToolsMenu.append($toolsMenu.find('ul').html());
  $newToolsMenu.prepend('<h3 id="p-newtools-label" class="vector-menu-heading">Tools</h3>');
 
  // Insert the new "Tools" section in the right-navigation after #ca-history
  $newToolsMenu.insertAfter('#ca-history');
 
  // Remove the original "Tools" section from the sidebar
   $('#p-tb').remove();
});
});

Revision as of 01:27, 23 February 2024

// Clone and move the "Tools" section to the right-navigation area
$(function(){
  // Clone the "Tools" section from the sidebar
  var $toolsMenu = $('#p-tb').clone();

  // Create a new "Tools" section in the right-navigation
  var $newToolsMenu = $('<div id="p-newtools" class="vector-menu-content"></div>');
  $newToolsMenu.append($toolsMenu.find('ul').html());
  $newToolsMenu.prepend('<h3 id="p-newtools-label" class="vector-menu-heading">Tools</h3>');

  // Insert the new "Tools" section in the right-navigation after #ca-history
  $newToolsMenu.insertAfter('#ca-history');

  // Remove the original "Tools" section from the sidebar
  $('#p-tb').remove();
});