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

מתקן עיצוב בוקטור
מ 9 גרסאות של הדף wikipedia:he:מדיה_ויקי:Gadget-moveVectorMenuToTabs.js יובאו
 
(7 גרסאות ביניים של 2 משתמשים אינן מוצגות)
שורה 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() {
{
function doit() {
try {
$( '#p-cactions li a' ).wrap( '<span>' );
    var cactions = document.getElementById("p-cactions");
$( '#p-cactions li' ).insertAfter( $( '#ca-js-delete, #ca-js-block, #ca-watch, #ca-unwatch' ).eq( 0 ) );
    var place = document.getElementById("ca-js-delete") || document.getElementById("ca-js-block") || document.getElementById("ca-watch");
$('#p-cactions').toggle( false );
    if ( !cactions || cactions.className !== "vectorMenu" || !place ) return;
}
 
doit();
    var item = cactions.getElementsByTagName("LI")[0];
$( document ).on( 'new-portlet-link', doit );
    while ( item && item.firstChild.nodeName === "A" )
});
    {
        var span = document.createElement("SPAN");
        span.appendChild( item.firstChild );
        place.parentNode.insertBefore ( span, place.nextSibling );
 
        item = cactions.getElementsByTagName("LI")[0];
    }
 
    cactions.style.display = "none";
  }
catch ( e )
  {
    return;
  }
}
 
if ( skin === "vector" ) addOnloadHook ( moveVectorMenuToTabs );