User:Tim Laqua/Move the search box above the Sidebar in Monobook Skin

From MediaWiki.org
Jump to navigation Jump to search

Put the following in your User:username/common.js article or to deploy site wide, MediaWiki:Common.js

function positionSearch() {
  if (skin=='monobook' && document.getElementById('p-search') && document.getElementById('p-logo')) {
    var searchDiv = document.getElementById('p-search');
    var sidebarDiv = document.getElementById('p-logo').nextSibling;
    searchDiv.parentNode.removeChild(searchDiv);
    sidebarDiv.parentNode.insertBefore(searchDiv,sidebarDiv);
  }
}

addOnloadHook(positionSearch);