User:Krinkle/VectorSearchNav.js

From Meta, a Wikimedia project coordination wiki

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.
// Description: Puts the searchbar in the left column in the Vector-skin.
// Author: [[meta:User:Krinkle]]
// Version: 1.04
// URL: http://meta.wikimedia.org/wiki/User:Krinkle/Scripts/VectorSearchNav
// Stats: [[File:Krinkle_VectorSearchNav.js]]
jQuery(function(){ $ = jQuery;
  // Move bar to the left
  $("#p-search").prependTo("#mw-panel");
  $("#p-search").attr("id", "custom-search");
  // Make it look better
  $("#custom-search").attr("class", "portal persistent");
  $("#p-navigation").removeClass("first");
  $("#simpleSearch").attr("class", "body");
  $("#searchInput").css("width", "90px");
  // Fix up the dropdown menu
  $("div.vectorMenu ul").css("right", "0");
  $("#right-navigation").css("margin-right", "1em");
  $("#custom-search").append('<style type="text/css">#simpleSearch label { left: 0.5em !important; } .suggestions { left: 19px !important; } </style>');
  $("body > .suggestions").css("left", "19px !important").css("right", "auto !important");
});