„MediaWiki:Monobook.js” változatai közötti eltérés

miert jo ha olvashatatlan?
(takaritasi probalkozasok)
(miert jo ha olvashatatlan?)
== Képek metaadatainak elrejtése ==
<pre> */
function showMDToggle() {
function showMDToggle() { if (document.createTextNode) { // Uses DOM calls to avoid document.write + XHTML issues var linkHolder = document.getElementById('metadata'); if (!linkHolder) return; var outerSpan = document.createElement('span'); outerSpan.className = 'mdtoggle'; var toggleLink = document.createElement('a'); toggleLink.id = 'mdtogglelink'; toggleLink.className = 'internal'; toggleLink.href = 'javascript:toggleMD()'; toggleLink.appendChild(document.createTextNode('elrejt')); outerSpan.appendChild(document.createTextNode('[')); outerSpan.appendChild(toggleLink); outerSpan.appendChild(document.createTextNode(']')); linkHolder.appendChild(document.createTextNode(' ')); linkHolder.appendChild(outerSpan); toggleMD(); } } function toggleMD() { var tables = document.getElementsByTagName('table'); var mdtable = null; for (var i = 0; i < tables.length; i++) { if (tables[i].getAttribute('class') && tables[i].getAttribute('class') == 'metadata') { mdtable = tables[i]; break; } } if(!mdtable) return; var md = mdtable.getElementsByTagName('tbody')[0]; var toggleLink = document.getElementById('mdtogglelink'); if(md && toggleLink && md.style.display == 'none') { changeText(toggleLink, 'elrejt'); md.style.display = 'table-row-group'; } else { changeText(toggleLink, 'mutat'); md.style.display = 'none'; } } addLoadEvent(showMDToggle);
if (document.createTextNode) {
// Uses DOM calls to avoid document.write + XHTML issues
var linkHolder = document.getElementById('metadata');
if (!linkHolder) return;
var outerSpan = document.createElement('span');
outerSpan.className = 'mdtoggle';
var toggleLink = document.createElement('a');
toggleLink.id = 'mdtogglelink';
toggleLink.className = 'internal';
toggleLink.href = 'javascript:toggleMD()';
toggleLink.appendChild(document.createTextNode('elrejt'));
outerSpan.appendChild(document.createTextNode('['));
outerSpan.appendChild(toggleLink);
outerSpan.appendChild(document.createTextNode(']'));
linkHolder.appendChild(document.createTextNode(' '));
linkHolder.appendChild(outerSpan); toggleMD();
}
}
 
function toggleMD() {
var tables = document.getElementsByTagName('table');
var mdtable = null;
for (var i = 0; i < tables.length; i++) {
if (tables[i].getAttribute('class') && tables[i].getAttribute('class') == 'metadata') {
mdtable = tables[i]; break;
}
}
if(!mdtable) return;
var md = mdtable.getElementsByTagName('tbody')[0];
var toggleLink = document.getElementById('mdtogglelink');
if(md && toggleLink && md.style.display == 'none') {
changeText(toggleLink, 'elrejt'); md.style.display = 'table-row-group';
} else {
changeText(toggleLink, 'mutat');
md.style.display = 'none';
}
}
 
addLoadEvent(showMDToggle);
 
/*
261

szerkesztés