MediaWiki:Minerva.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 15: Line 15:


function TLPExpandEn(x) {
function TLPExpandEn(x) {
   var y = "tlp-children-".concat(x); //outputs something like "tlp-children-1.21"
   var content = document.getElementById('tlp-children-'+x); //outputs something like document.getElementById("tlp-children-1.21")
  var z = document.getElementById(y); //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")
   var a = "tlp-button-text-".concat(x); //outputs something like "tlp-button-text-1.21"
   if (content.style.display == "block") {
  var b = document.getElementById(a); //outputs something like document.getElementById("tlp-button-text-1.21")
     content.style.display = "none";
   if (z.style.display === "block") {
     button.innerHTML = "Expand";
     z.style.display = "none";
     b.innerHTML = "Expand";
   } else {
   } else {
     z.style.display = "block";
     content.style.display = "block";
     b.innerHTML = "Collapse";
     button.innerHTML = "Collapse";
   }
   }
}
}


function TLPExpandFr(x) {
function TLPExpandFr(x) {
   var y = "tlp-children-".concat(x); //outputs something like "tlp-children-1.21"
   var content = document.getElementById('tlp-children-'+x); //outputs something like document.getElementById("tlp-children-1.21")
  var z = document.getElementById(y); //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")
   var a = "tlp-button-text-".concat(x); //outputs something like "tlp-button-text-1.21"
   if (content.style.display == "block") {
  var b = document.getElementById(a); //outputs something like document.getElementById("tlp-button-text-1.21")
     content.style.display = "none";
   if (z.style.display === "block") {
     button.innerHTML = "Afficher";
     z.style.display = "none";
     b.innerHTML = "Afficher";
   } else {
   } else {
     z.style.display = "block";
     content.style.display = "block";
     b.innerHTML = "Masquer";
     button.innerHTML = "Masquer";
   }
   }
}
}
Line 44: Line 40:


function TLPExpandIt(x) {
function TLPExpandIt(x) {
   var y = "tlp-children-".concat(x); //outputs something like "tlp-children-1.21"
   var content = document.getElementById('tlp-children-'+x); //outputs something like document.getElementById("tlp-children-1.21")
  var z = document.getElementById(y); //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")
   var a = "tlp-button-text-".concat(x); //outputs something like "tlp-button-text-1.21"
   if (content.style.display == "block") {
  var b = document.getElementById(a); //outputs something like document.getElementById("tlp-button-text-1.21")
     content.style.display = "none";
   if (z.style.display === "block") {
     button.innerHTML = "Espandi";
     z.style.display = "none";
     b.innerHTML = "Espandi";
   } else {
   } else {
     z.style.display = "block";
     content.style.display = "block";
     b.innerHTML = "Comprimi";
     button.innerHTML = "Comprimi";
   }
   }
}
}


function TLPExpandEs(x) {
function TLPExpandEs(x) {
   var y = "tlp-children-".concat(x); //outputs something like "tlp-children-1.21"
   var content = document.getElementById('tlp-children-'+x); //outputs something like document.getElementById("tlp-children-1.21")
  var z = document.getElementById(y); //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")
   var a = "tlp-button-text-".concat(x); //outputs something like "tlp-button-text-1.21"
   if (content.style.display == "block") {
  var b = document.getElementById(a); //outputs something like document.getElementById("tlp-button-text-1.21")
     content.style.display = "none";
   if (z.style.display === "block") {
     button.innerHTML = "Mostrar";
     z.style.display = "none";
     b.innerHTML = "Mostrar";
   } else {
   } else {
     z.style.display = "block";
     content.style.display = "block";
     b.innerHTML = "Ocultar";
     button.innerHTML = "Ocultar";
   }
   }
}
}
Line 74: Line 66:
   var content = document.getElementById("drawer-content-"+x);
   var content = document.getElementById("drawer-content-"+x);
   var button = document.getElementById("drawer-button-"+x);
   var button = document.getElementById("drawer-button-"+x);
   if (content.style.display === "block") {
   if (content.style.display == "block") {
     content.style.display = "none";
     content.style.display = "none";
button.innerHTML = "Expand";
button.innerHTML = "Expand";