MediaWiki:Common.js: Difference between revisions
Appearance
No edit summary Tag: Reverted |
No edit summary Tag: Reverted |
||
Line 4: | Line 4: | ||
$('table.wikitable td').each(function() { | $('table.wikitable td').each(function() { | ||
var cellContent = $(this).text().trim(); | var cellContent = $(this).text().trim(); | ||
if (cellContent === ' low risk') { | if (cellContent === ' low risk') { | ||
$(this).addClass('low-risk'); | $(this).addClass('low-risk'); | ||
} else if (cellContent === ' some concerns') { | } else if (cellContent === ' some concerns') { | ||
$(this).addClass('some-concerns'); | $(this).addClass(' some-concerns'); | ||
} else if (cellContent === ' high risk') { | } else if (cellContent === ' high risk') { | ||
$(this).addClass('high-risk'); | $(this).addClass(' high-risk'); | ||
} | } | ||
}); | }); | ||
}); | }); |
Revision as of 12:08, 21 August 2024
/* Any JavaScript here will be loaded for all users on every page load. */ $(document).ready(function() { $('table.wikitable td').each(function() { var cellContent = $(this).text().trim(); if (cellContent === ' low risk') { $(this).addClass('low-risk'); } else if (cellContent === ' some concerns') { $(this).addClass(' some-concerns'); } else if (cellContent === ' high risk') { $(this).addClass(' high-risk'); } }); });