MediaWiki:Common.js: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Admin (Diskussion | Beiträge) |
Admin (Diskussion | Beiträge) |
||
Zeile 4: | Zeile 4: | ||
var node = logo.clone() | var node = logo.clone() | ||
var link = node.find('a') | var link = node.find('a') | ||
− | node.append("<span style='position:relative; top: | + | node.append("<span style='position:relative; top:-40px'>" + name + '</span>') |
link.css('background-image', 'url(/logos/' + name + '.png)') | link.css('background-image', 'url(/logos/' + name + '.png)') | ||
link.attr('href', '/wiki/Kategorie:' + name) | link.attr('href', '/wiki/Kategorie:' + name) |
Version vom 25. Juni 2013, 14:20 Uhr
var setLogo = function(name) { var logo = $('div#p-logo').first() var node = logo.clone() var link = node.find('a') node.append("<span style='position:relative; top:-40px'>" + name + '</span>') link.css('background-image', 'url(/logos/' + name + '.png)') link.attr('href', '/wiki/Kategorie:' + name) node.insertAfter(logo) } /* Das folgende JavaScript wird für alle Benutzer geladen. */ var classList =$('body').attr('class').split(/\s+/) $.each( classList, function(index, item){ var m = item.match(/^page-Kategorie_(.*)$/) if(m) return setLogo(m[1]) }); $('#catlinks li a').each(function(){ var cat = $(this).attr('title').split(':')[1] if(cat) return setLogo(cat) }) $('form[name="accountrequest"] fieldset:nth-child(3)').hide() $('form[name="accountrequest"] fieldset:nth-child(2) p').hide() $('form[name="accountrequest"] fieldset:nth-child(2) textarea').hide()