MediaWiki:Common.js: Difference between revisions

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


     $td_normal = $('[class^="colortable-"] td b:contains("Normal")');
     var rows_to_highlight = [
    $td_enh = $('[class^="colortable-"] td b:contains("[Enhanced]")');
        'Normal',
        '[Enhanced]',
        'PvE',
        'PvP'
    ]


     if ($td_normal.text() == 'Normal') $td_normal.parent().addClass('tone-4');
     rows_to_highlight.forEach(function (rowContent) {
    if ($td_enh.text() == '[Enhanced]') $td_enh.parent().addClass('tone-4');
        var rows = $(`[class^="colortable-"] td b:contains("${rowContent}")`);
        rows.each(function () {
            if ($(this).text() == rowContent) $(this).parent().addClass('tone-4');
        })
    })
      
      
});
});
Line 444: Line 452:
     });
     });


     setTimeout(function () { document.querySelector('.current-info .segment-contents > .mw-collapsible-content').classList.add('shown') }, 100);
     setTimeout(function () { $('.current-info .segment-contents > .mw-collapsible-content').addClass('shown') }, 100);


     if (typeof character_banner_exists !== undefined) mw.loader.load('https://elwiki.net/wiki/index.php?title=MediaWiki:Character-Banner.js&action=raw&ctype=text/javascript');
     if (typeof character_banner_exists !== undefined) mw.loader.load('https://elwiki.net/wiki/index.php?title=MediaWiki:Character-Banner.js&action=raw&ctype=text/javascript');