MediaWiki:Mobile.js

/* Any JavaScript here will be loaded for users using the mobile site */

/* Add cell-type classes to tables with the .feature-colors class */ var cells = document.querySelectorAll(".feature-colors td"); for (var i = 0; i < cells.length; i++) { if (cells[i].innerHTML.trim.toUpperCase == "Y") { cells[i].classList.add("feature-yes", "feature"); } else if (cells[i].innerHTML.trim.toUpperCase == "P") { cells[i].classList.add("feature-partial", "feature"); } else if (cells[i].innerHTML.trim.toUpperCase == "-") { cells[i].classList.add("feature-unavailable", "feature"); }   }

/* Add cell-type classes to datatables */ var cells = document.querySelectorAll(".cargoTable td"); for (var i = 0; i < cells.length; i++) { if (cells[i].innerHTML.trim.toUpperCase == "Y") { cells[i].classList.add("feature-yes", "feature"); } else if (cells[i].innerHTML.trim.toUpperCase == "P") { cells[i].classList.add("feature-partial", "feature"); } else if (cells[i].innerHTML.trim.toUpperCase == "-") { cells[i].classList.add("feature-unavailable", "feature"); }   }