לדלג לתוכן

מדיה ויקי:Gadget-moveVectorMenuToTabs.js: הבדלים בין גרסאות בדף

מתוך צפונות ויקי
מתקן את התיקון הקודם
מודרניזציה.
שורה 1: שורה 1:
// for vector skin: replace the links in the dropdown menu with regular tabs and hide the menu
// for vector skin: replace the links in the dropdown menu with regular tabs and hide the menu
// written by [[user:Mikimik]]
// written by [[user:Mikimik]]
function moveVectorMenuToTabs()
$(function() {
{
$('#p-cactions li a').wrap($('<span>'));  
try {
$('div#p-views ul').append($('#p-cactions li'));  
    var cactions = document.getElementById("p-cactions");
$('#p-cactions').remove();
    var place = document.getElementById("ca-js-delete") || document.getElementById("ca-js-block") || document.getElementById("ca-watch");
});
    if ( !cactions || cactions.className !== "vectorMenu" || !place ) return;
 
    for ( var item = cactions.getElementsByTagName("LI")[0] ; item && item.firstChild && item.firstChild.nodeName === "A" ; item = cactions.getElementsByTagName("LI")[0] )
    {
        var span = document.createElement("SPAN");
        span.appendChild( item.firstChild );
        item.appendChild( span );
        place.parentNode.insertBefore( item, place.nextSibling );
    }
 
    cactions.style.display = "none";
  }
catch ( e )
  {
    return;
  }
}
 
if ( skin === "vector" ) addOnloadHook ( moveVectorMenuToTabs );

גרסה מ־00:50, 5 ביוני 2012

// for vector skin: replace the links in the dropdown menu with regular tabs and hide the menu
// written by [[user:Mikimik]]
$(function() {
$('#p-cactions li a').wrap($('<span>')); 
$('div#p-views ul').append($('#p-cactions li')); 
$('#p-cactions').remove();
});