Jump to content

User:Sheldont22/vector.js

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by Sheldont22 (talk | contribs) at 16:58, 2 August 2011 (Created page with '// changes the drop-down menu in Vector into tabs function fixTab(item) { var node = item.firstChild; if (node.tagName.toLowerCase() != 'span') item.inner...'). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
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.
// changes the drop-down menu in Vector into tabs
 
function fixTab(item) {
  var node = item.firstChild;
  if (node.tagName.toLowerCase() != 'span')
    item.innerHTML = "<span>" + item.innerHTML + "</span>";
}
 
$(function() {
  document.getElementById('p-cactions').className = 'vectorTabs';
  var elems = document.getElementById('p-cactions').getElementsByTagName('li');
  for (var i = 0; i < elems.length; i++)
    fixTab(elems[i]);
  mw.util.addCSS('div#p-cactions {margin-left: 5px;}');
})
 
window.TwinkleInit = (window.TwinkleInit || []).concat( function() {
  var twinkleElem = document.getElementById('p-twinkle');
  if (twinkleElem)
    twinkleElem.className = 'vectorTabs';
  mw.util.addCSS('div#p-twinkle {margin-left: 5px;}');
});