MediaWiki:Common.js: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Zeile 8: | Zeile 8: | ||
// importScript('mediawiki:popup.js'); | // importScript('mediawiki:popup.js'); | ||
mw.loader.load( 'https://www.univie.ac.at/rel_jap/r/index.php?title=MediaWiki:Popup.js' ); | mw.loader.load( 'https://www.univie.ac.at/rel_jap/r/index.php?title=MediaWiki:Popup.js' ); | ||
+ | /*** GLOSSAR ***/ | ||
+ | // s.a. vorlage:glossar | ||
+ | $('.glossar').each(function(){ | ||
+ | var child = $(this).find('.g_box') | ||
+ | , parent = $(this).closest('p, li') ; | ||
+ | $( parent).css("position", "relative"); | ||
+ | |||
+ | var diff = ($(this).width() - $(child).width()) / 2 | ||
+ | , left = $(this).position().left + diff | ||
+ | , right = $(parent).width() - ($(this).position().left + $(child).width() + 14); | ||
+ | |||
+ | if ( left < -10) { | ||
+ | $( child).css("left", diff - left -10 + 'px'); | ||
+ | } | ||
+ | if (right < 0 ) { | ||
+ | $( child).css("left", right + 'px'); | ||
+ | } | ||
+ | |||
+ | $( this).click(function(){ $( child).slideToggle('slow'); }); | ||
+ | $( this).mouseleave(function(){ $(child).slideUp('slow'); }); | ||
+ | |||
+ | }); |
Version vom 16. Dezember 2018, 21:36 Uhr
for (var i in wgUserGroups)
if (wgUserGroups[i] === 'sysop')
var sysopRights = true;
/*** POPUPS ***/
if (wgNamespaceNumber != 6)
// importScript('mediawiki:popup.js');
mw.loader.load( 'https://www.univie.ac.at/rel_jap/r/index.php?title=MediaWiki:Popup.js' );
/*** GLOSSAR ***/
// s.a. vorlage:glossar
$('.glossar').each(function(){
var child = $(this).find('.g_box')
, parent = $(this).closest('p, li') ;
$( parent).css("position", "relative");
var diff = ($(this).width() - $(child).width()) / 2
, left = $(this).position().left + diff
, right = $(parent).width() - ($(this).position().left + $(child).width() + 14);
if ( left < -10) {
$( child).css("left", diff - left -10 + 'px');
}
if (right < 0 ) {
$( child).css("left", right + 'px');
}
$( this).click(function(){ $( child).slideToggle('slow'); });
$( this).mouseleave(function(){ $(child).slideUp('slow'); });
});