Zuletzt bearbeitet vor einem Jahr
von Margit Link-Rodrigue

MediaWiki:Common.js: Unterschied zwischen den Versionen

Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
 
(29 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
/* Das folgende JavaScript wird für alle Benutzer geladen. */
/*BITV tabelle
 
var allTableCells = document.getElementById("bitv").getElementsByTagName("td");
 
 
for( var i = 0; i < allTableCells.length; i++ ) {
 
var node = allTableCells[i];
 
 
//get the text from the first child node - which should be a text node
 
var currentText = node.childNodes[0].nodeValue;
 
currentText = currentText.trim();
 
 
//check for 'one' and assign this table cell's background color accordingly
 
if (currentText == "Erfüllt") {
node.style.backgroundColor = "#c5e8c9";
}
if (currentText == "Eher Erfüllt") {
node.style.backgroundColor = "#c5e8c9";
}
else if (currentText == "Teilweise Erfüllt") {
node.style.backgroundColor = "#f7e1b2";
}
else if (currentText == "Eher nicht Erfüllt") {
node.style.backgroundColor = "#e9c4c4";
}
else if (currentText == "Nicht Erfüllt") {
node.style.backgroundColor = "#e9c4c4";
}
else if (currentText == "Nicht anwendbar") {
node.style.backgroundColor = "#d2d2d2";
}
 
}
*/
/*remedy for issues with Recentchanges filter */
 
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Watchlist' ) {
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Watchlist' ) {
  document.body.classList.add( 'mw-rcfilters-ui-initialized' );
document.body.classList.add( 'mw-rcfilters-ui-initialized' );
}
}
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'RecentChanges' ) {
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Recentchanges' ) {
  document.body.classList.add( 'mw-rcfilters-ui-initialized' );
document.body.classList.add( 'mw-rcfilters-ui-initialized' );
}
}


/*Target based tabs*/
/*Close details elements
var hashLinks = document.querySelectorAll("a[href^='#']");
// Fetch all the details element.
[].forEach.call(hashLinks, function (link) {
const details = document.querySelectorAll("details");
   link.addEventListener("click", function (event) {
 
     event.preventDefault();
// Add the onclick listeners.
     history.pushState({}, "", link.href);
details.forEach((targetDetail) => {
   
   targetDetail.addEventListener("click", () => {
    // Update the URL again with the same hash, then go back
     // Close all the details that are not targetDetail.
    history.pushState({}, "", link.href);
     details.forEach((detail) => {
     history.back();
      if (detail !== targetDetail) {
        detail.removeAttribute("open");
      }
     });
   });
   });
});
}); */
 
 
/*BITV tabelle*/
var table = document.getElementById("bitv");
for (var i = 0, row; row = table.rows[i]; i++) {
for (var j = 0, cell; cell = row.cells[j]; j++) {
if (cell.innerText == '') {
cell.style.backgroundColor = 'RGBA(85,83,108,0.4)';
}else if (cell.innerText = Erfüllt) {
cell.style.backgroundColor = 'RGBA(170,214,136,0.4)';
}else if (cell.innerText > 15 && cell.innerText <=20) {
cell.style.backgroundColor = 'RGBA(170,214,136,0.4)';
}else if (cell.innerText > 20 && cell.innerText <=25) {
cell.style.backgroundColor = 'RGBA(152,195,119,0.6)';
}else if (cell.innerText > 25 && cell.innerText <=30) {
cell.style.backgroundColor = 'RGBA(139,189,120,0.9)';
}else if (cell.innerText > 30 && cell.innerText <=60) {
cell.style.backgroundColor = 'RGBA(94,167,88,0.9)';
}else if (cell.innerText > 60 && cell.innerText <=150) {
cell.style.backgroundColor = 'RGBA(88,157,65,0.3)';
}else if (cell.innerText > 150 && cell.innerText <=10000) {
cell.style.backgroundColor = 'RGBA(95,160,97,0.6)';
}else if (cell.innerText > 10000 && cell.innerText <=20000) {
cell.style.backgroundColor = 'RGBA(105,170,90,0.7)';
}else if (cell.innerText > 20000 && cell.innerText <=30000) {
cell.style.backgroundColor = 'RGBA(115,164,76,0.6)';
}else if (cell.innerText > 30000) {
cell.style.backgroundColor = 'RGBA(98,143,94,0.4)';
}
}

Aktuelle Version vom 4. Mai 2023, 17:23 Uhr

/*BITV tabelle

var allTableCells = document.getElementById("bitv").getElementsByTagName("td");


for( var i = 0; i < allTableCells.length; i++ ) {

var node = allTableCells[i];


//get the text from the first child node - which should be a text node

var currentText = node.childNodes[0].nodeValue;

currentText = currentText.trim();


//check for 'one' and assign this table cell's background color accordingly

if (currentText == "Erfüllt") {
node.style.backgroundColor = "#c5e8c9";
}
if (currentText == "Eher Erfüllt") {
node.style.backgroundColor = "#c5e8c9";
}
else if (currentText == "Teilweise Erfüllt") {
node.style.backgroundColor = "#f7e1b2";
}
else if (currentText == "Eher nicht Erfüllt") {
node.style.backgroundColor = "#e9c4c4";
}
else if (currentText == "Nicht Erfüllt") {
node.style.backgroundColor = "#e9c4c4";
}
else if (currentText == "Nicht anwendbar") {
node.style.backgroundColor = "#d2d2d2";
}

}
*/
/*remedy for issues with Recentchanges filter */

if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Watchlist' ) {
document.body.classList.add( 'mw-rcfilters-ui-initialized' );
}
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Recentchanges' ) {
document.body.classList.add( 'mw-rcfilters-ui-initialized' );
}

/*Close details elements
// Fetch all the details element.
const details = document.querySelectorAll("details");

// Add the onclick listeners.
details.forEach((targetDetail) => {
  targetDetail.addEventListener("click", () => {
    // Close all the details that are not targetDetail.
    details.forEach((detail) => {
      if (detail !== targetDetail) {
        detail.removeAttribute("open");
      }
    });
  });
}); */
Keine Kategorien vergebenBearbeiten