MediaWiki:Common.js: Difference between revisions

no edit summary
No edit summary
Tag: Manual revert
No edit summary
Tag: Reverted
Line 334: Line 334:
     $("#ca-ve-edit").hide();
     $("#ca-ve-edit").hide();


    var rows_to_highlight = [
// Define a variable to hold the rows to highlight
        'Normal',
var _rows_to_highlight = [
        '[Enhanced]',
    'Normal',
        'PvE',
    '[Enhanced]',
        'PvP'
    'PvE',
    ]
    'PvP'
];


     rows_to_highlight.forEach(function (rowContent) {
// Define a function to highlight the rows
function highlightRows() {
     $('[class^="colortable-"] td b').parent().removeClass('tone-4');
    _rows_to_highlight.forEach(function (rowContent) {
         var rows = $('[class^="colortable-"] td b:contains("' + rowContent + '")');
         var rows = $('[class^="colortable-"] td b:contains("' + rowContent + '")');
         rows.each(function () {
         rows.each(function () {
             if ($(this).text() == rowContent) $(this).parent().addClass('tone-4');
             if ($(this).text() == rowContent) $(this).parent().addClass('tone-4');
         })
         });
     })
     });
}
 
// Define a getter and a setter for the rows to highlight
Object.defineProperty(window, 'rows_to_highlight', {
    get: function() {
        return _rows_to_highlight;
    },
    set: function(newValue) {
        _rows_to_highlight = newValue;
        highlightRows();
    }
});
 
highlightRows();
      
      
});
});