Jump to content

User:Tom-/monobook.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Tom- (talk | contribs) at 00:36, 26 October 2005. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
document.attachEvent("onreadystatechange", function() {
  var deleteItem = document.getElementById("ca-delete");
  
  if (deleteItem)
  {
    var deleteLink = deleteItem.getElementsByTagName("a")[0]
    if (deleteLink)
    {
      deleteLink.accessKey = "";
      setTimeout(function(){ deleteLink.accessKey = ""; }, 500);
    }
  }
 }
);

var mpTitle = "Wikipedia:WikiProject Usability/Main Page/Draft";
var isMainPage = (document.title.substr(0, mpTitle.length) == mpTitle)

if (isMainPage) 
{
document.write('<style type="text/css"> #siteSub, #contentSub { display: none; } #content, #content div.thumb, #p-cactions li a, #p-cactions li a:hover, #p-cactions li.selected a { background: #fff; } </style>');

var mpSmallEnabled;
var mpMinWidth = 700;

function mainPageTransform()
{
	var mpContentEl = document.getElementById("bodyContent");
	var mpBrowseEl = document.getElementById("EnWpMpBrowse");
	var mpContainEl = document.getElementById("EnWpMpBrowseContainer");
	var mpMarginEl = document.getElementById("EnWpMpMargin");
	var mpEl = document.getElementById("EnWpMainPage");

	if (!mpSmallEnabled && mpContentEl.offsetWidth < mpMinWidth)
	{
		mpContainEl.insertBefore(mpBrowseEl, mpContainEl.firstChild);
		mpBrowseEl.className = "browse-bottom";
		mpMarginEl.style.marginRight = 0;
		mpSmallEnabled = true;
	}
	else if (mpSmallEnabled && mpContentEl.offsetWidth > mpMinWidth)
	{
		mpEl.insertBefore(mpBrowseEl, mpEl.firstChild);
		mpBrowseEl.className = "browse-right";
		mpMarginEl.style.marginRight = "13.8em";
		mpSmallEnabled = false;
	}
}

onreadystatechange = onresize = mainPageTransform;

}