MediaWiki:Common.js: Unterschied zwischen den Versionen

Aus e-vendo Wiki
Wechseln zu: Navigation, Suche
Zeile 24: Zeile 24:
  
  
$wgHooks['SkinTemplateSetupPageCss'][] = 'wfHideVariousTabsFromAnonymous';
+
$wgHooks['SkinTemplateNavigation'][] = 'fnHideVariousTabsFromAnonymousVector';
 
 
function wfHideVariousTabsFromAnonymous( &$hidetabcss ) {
 
global $wgUser;
 
 
 
if ( !$wgUser->isLoggedIn() ) {
 
$hidetabcss .= 'li#ca-history, li#ca-viewsource, li#ca-edit, li#ca-talk, .vectorMenu { display: none; }';
 
}
 
  
 +
function fnHideVariousTabsFromAnonymousVector( SkinTemplate &$sktemplate, array &$links ) {
 +
// the old '$content_actions' array is thankfully just a
 +
// sub-array of this one
 +
fnHideVariousNamespaceTabsFromAnonymous( $sktemplate, $links['namespaces'] );
 +
fnHideVariousActionTabsFromAnonymous( $sktemplate, $links['views'] );
 
return true;
 
return true;
 
}
 
}

Version vom 12. Juli 2018, 08:00 Uhr

/* Das folgende JavaScript wird für alle Benutzer geladen. */


/* ==== accordion ==== */

$('.accordion').click(function(){
 $(this).toggleClass('active').next('.panel').slideToggle(300);
});

$('.accordion2').click(function(){
 $(this).toggleClass('active2').next('.panel2').slideToggle(300);
});

$('.accordion3').click(function(){
 $(this).toggleClass('active3').next('.panel3').slideToggle(300);
});


/* ==== back to top-button ==== */

document.getElementById("btt").addEventListener("mouseenter",function(){ this.style.opacity="1.0", this.style.transition="0.3s" });
document.getElementById("btt").addEventListener("mouseleave",function(){ this.style.opacity="0.8", this.style.transition="0.3s" });



$wgHooks['SkinTemplateNavigation'][] = 'fnHideVariousTabsFromAnonymousVector';

function fnHideVariousTabsFromAnonymousVector( SkinTemplate &$sktemplate, array &$links ) {
	// the old '$content_actions' array is thankfully just a
	// sub-array of this one
	fnHideVariousNamespaceTabsFromAnonymous( $sktemplate, $links['namespaces'] );
	fnHideVariousActionTabsFromAnonymous( $sktemplate, $links['views'] );
	return true;
}