לדלג לתוכן

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

מתוך צפונות ויקי
מתקן את התיקון הקודם
מ 9 גרסאות של הדף wikipedia:he:מדיה_ויקי:Gadget-moveVectorMenuToTabs.js יובאו
 
(6 גרסאות ביניים של משתמש אחר אחד אינן מוצגות)
שורה 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();
    for ( var item = cactions.getElementsByTagName("LI")[0] ; item && item.firstChild && item.firstChild.nodeName === "A" ; item = cactions.getElementsByTagName("LI")[0] )
$( document ).on( 'new-portlet-link', doit );
    {
});
        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 );

גרסה אחרונה מ־12:35, 5 בדצמבר 2022

// for vector skin: replace the links in the dropdown menu with regular tabs and hide the menu
// written by [[user:Mikimik]]
$(function() {
	function doit() {
		$( '#p-cactions li a' ).wrap( '<span>' );
		$( '#p-cactions li' ).insertAfter( $( '#ca-js-delete, #ca-js-block, #ca-watch, #ca-unwatch' ).eq( 0 ) );
		$('#p-cactions').toggle( false );
	}
	doit();
	$( document ).on( 'new-portlet-link', doit );
});