MediaWiki:Common.js: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Admin (Diskussion | Beiträge) |
Admin (Diskussion | Beiträge) |
||
(19 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 1: | Zeile 1: | ||
var setLogo = function(name) | var setLogo = function(name) | ||
{ | { | ||
+ | if(name.match(/\s/)){ | ||
+ | name = name.replace(/\s.*/, '') | ||
+ | } | ||
var logo = $('div#p-logo').first() | var logo = $('div#p-logo').first() | ||
var node = logo.clone() | var node = logo.clone() | ||
− | node.find('a').css('background-image', 'url(/logos/' + name + '.png)') | + | var link = node.find('a') |
+ | // node.append("<span style='position:relative; left: 20px; top:-60px'>" + name + '</span>') | ||
+ | link.css('background-image', 'url(/logos/' + name + '.png)') | ||
+ | link.attr('href', '/wiki/Kategorie:' + name) | ||
node.insertAfter(logo) | node.insertAfter(logo) | ||
+ | |||
} | } | ||
Zeile 20: | Zeile 27: | ||
}) | }) | ||
− | + | ||
+ | $('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() |
Aktuelle Version vom 25. Juni 2013, 14:31 Uhr
var setLogo = function(name) { if(name.match(/\s/)){ name = name.replace(/\s.*/, '') } var logo = $('div#p-logo').first() var node = logo.clone() var link = node.find('a') // node.append("<span style='position:relative; left: 20px; top:-60px'>" + 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()