MediaWiki:Common.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 84: Line 84:
function closeExportOptions() {
function closeExportOptions() {
   document.getElementById("export-options").style.display = "none";
   document.getElementById("export-options").style.display = "none";
}
/* ======================================= Tractatus Logico-Philosophicus (tree-like view) ======================================= */
// Template:TLP drawer
function TLPExpandDe(x) {
  var content = document.getElementById('tlp-children-'+x); //outputs something like document.getElementById("tlp-children-1.21")
  var button = document.getElementById('tlp-button-text-'+x); //outputs something like document.getElementById("tlp-button-text-1.21")
  if (content.style.display == "block") {
    content.style.display = "none";
    button.innerHTML = "Ausklappen";
  } else {
    content.style.display = "block";
    button.innerHTML = "Einklappen";
  }
}
function TLPExpandEn(x) {
  var content = document.getElementById('tlp-children-'+x); //outputs something like document.getElementById("tlp-children-1.21")
  var button = document.getElementById('tlp-button-text-'+x); //outputs something like document.getElementById("tlp-button-text-1.21")
  if (content.style.display == "block") {
    content.style.display = "none";
    button.innerHTML = "Expand";
  } else {
    content.style.display = "block";
    button.innerHTML = "Collapse";
  }
}
function TLPExpandFr(x) {
  var content = document.getElementById('tlp-children-'+x); //outputs something like document.getElementById("tlp-children-1.21")
  var button = document.getElementById('tlp-button-text-'+x); //outputs something like document.getElementById("tlp-button-text-1.21")
  if (content.style.display == "block") {
    content.style.display = "none";
    button.innerHTML = "Afficher";
  } else {
    content.style.display = "block";
    button.innerHTML = "Masquer";
  }
}
function TLPExpandIt(x) {
  var content = document.getElementById('tlp-children-'+x); //outputs something like document.getElementById("tlp-children-1.21")
  var button = document.getElementById('tlp-button-text-'+x); //outputs something like document.getElementById("tlp-button-text-1.21")
  if (content.style.display == "block") {
    content.style.display = "none";
    button.innerHTML = "Espandi";
  } else {
    content.style.display = "block";
    button.innerHTML = "Comprimi";
  }
}
function TLPExpandEs(x) {
  var content = document.getElementById('tlp-children-'+x); //outputs something like document.getElementById("tlp-children-1.21")
  var button = document.getElementById('tlp-button-text-'+x); //outputs something like document.getElementById("tlp-button-text-1.21")
  if (content.style.display == "block") {
    content.style.display = "none";
    button.innerHTML = "Mostrar";
  } else {
    content.style.display = "block";
    button.innerHTML = "Ocultar";
  }
}
function drawerExpand(x) {
  var content = document.getElementById("drawer-content-"+x);
  var button = document.getElementById("drawer-button-"+x);
  if (content.style.display == "block") {
    content.style.display = "none";
button.innerHTML = "Expand";
  } else {
    content.style.display = "block";
    button.innerHTML = "Collapse";
  }
}
}