MediaWiki:Minerva.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 2: Line 2:


// Template:TLP drawer
// Template:TLP drawer
function TLPExpandDe(x) {
  var y = "tlp-children-".concat(x); //outputs something like "tlp-children-1.21"
  var z = document.getElementById(y); //outputs something like document.getElementById("tlp-children-1.21")
  var a = "tlp-button-text-".concat(x); //outputs something like "tlp-button-text-1.21"
  var b = document.getElementById(a); //outputs something like document.getElementById("tlp-button-text-1.21")
  if (z.style.display === "block") {
    z.style.display = "none";
    b.innerHTML = "Ausklappen";
  } else {
    z.style.display = "block";
    b.innerHTML = "Einklappen";
  }
}


function TLPExpandEn(x) {
function TLPExpandEn(x) {
Line 17: Line 30:
}
}


function TLPExpandDe(x) {
function TLPExpandFr(x) {
   var y = "tlp-children-".concat(x); //outputs something like "tlp-children-1.21"
   var y = "tlp-children-".concat(x); //outputs something like "tlp-children-1.21"
   var z = document.getElementById(y); //outputs something like document.getElementById("tlp-children-1.21")
   var z = document.getElementById(y); //outputs something like document.getElementById("tlp-children-1.21")
Line 24: Line 37:
   if (z.style.display === "block") {
   if (z.style.display === "block") {
     z.style.display = "none";
     z.style.display = "none";
     b.innerHTML = "Ausklappen";
     b.innerHTML = "Afficher";
   } else {
   } else {
     z.style.display = "block";
     z.style.display = "block";
     b.innerHTML = "Einklappen";
     b.innerHTML = "Masquer";
   }
   }
}
}


function TLPExpandIt(x) {
function TLPExpandIt(x) {