Jump to content

MediaWiki:Common.js: Difference between revisions

From CAMIH
No edit summary
Tag: Reverted
No edit summary
Tag: Manual revert
 
(One intermediate revision by the same user not shown)
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');
         }
         }
     });
     });
});
});

Latest revision as of 12:10, 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');
        }
    });
});