MediaWiki:Common.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 293: Line 293:
genSetRandDARTNumber();
genSetRandDARTNumber();


function matchHeaderText(force) {
function matchHeaderText() {
     $('table[cellpadding="5"][border="1"][style] tr[style]:not(.dungeon-page-fields tr), .segment-header:not(.job-change-collapsible .segment-header, .auto-coloring-off .segment-header)').each(function () {
     $('table[cellpadding="5"][border="1"][style] tr[style]:not(.dungeon-page-fields tr), .instance-page .segment-header, .auto-header-color .segment-header').each(function () {
         var rgb = $(this).css('backgroundColor');
         var rgb = $(this).css('backgroundColor');
         var colors = rgb.match(/\d+/g);
         var colors = rgb.match(/\d+/g);
Line 300: Line 300:
         if ($(this).parents('.section-characters').length) return;
         if ($(this).parents('.section-characters').length) return;
         if (o < 155 && rgb != 'rgba(0, 0, 0, 0)') {
         if (o < 155 && rgb != 'rgba(0, 0, 0, 0)') {
             $(this).addClass('force-white'); //css('color', 'white').css('text-shadow', '1px 1px 1px #000');
             $(this).addClass('force-white');
         } else if ($(this).parents('.instance-page').length || $(this).parents('.auto-header-color').length || force) {
         } else {
             $(this).addClass('force-black'); //.css('color', 'black').css('text-shadow', 'none');
             $(this).addClass('force-black');
         }
         }
     });
     });
     setTimeout(function () {
     setTimeout(function () {
         $('.segment-partial .mw-collapsible-text, .segment .mw-collapsible-text').each(function () {
         $('.segment-partial .mw-collapsible-text, .segment .mw-collapsible-text').each(function () {
             var color = $(this).parents('.segment').find('.segment-header:eq(0)').css('color');
             var matched_white = $(this).parents('.segment').find('.segment-header:eq(0)').hasClass('force-white');
             var shadow = $(this).parents('.segment').find('.segment-header:eq(0)').css('text-shadow');
             var matched_black = $(this).parents('.segment').find('.segment-header:eq(0)').hasClass('force-black');
             $(this).css({ color: color, textShadow: shadow })
             if (matched_white) {
                $(this).addClass('force-white')
            } else if (matched_black) {
                $(this).addClass('force-black')
            }
         });
         });
     }, 50);
     }, 50);