MediaWiki:Common.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 304: Line 304:
     $('table[cellpadding="5"][border="1"][style] tr[style*="rgb(68, 68, 68)"] th').css('border-color', 'black');
     $('table[cellpadding="5"][border="1"][style] tr[style*="rgb(68, 68, 68)"] th').css('border-color', 'black');


     $('table[cellpadding="5"][border="1"][style] tr:not(.dungeon-page-fields tr), .segment-header:not(.job-change-collapsible .segment-header), .segment .mw-collapsible-text').each(function () {
     $('table[cellpadding="5"][border="1"][style] tr:not(.dungeon-page-fields tr), .segment-header:not(.job-change-collapsible .segment-header)').each(function () {
         if ($(this).hasClass('mw-collapsible-text')) {
         var rgb = $(this).css('backgroundColor');
            var rgb = $(this).parents('.segment').find('.segment-header:eq(0)').css('backgroundColor');
        } else {
            var rgb = $(this).css('backgroundColor');
        }
         var colors = rgb.match(/\d+/g);
         var colors = rgb.match(/\d+/g);
         var o = Math.round(((parseInt(colors[0]) * 299) + (parseInt(colors[1]) * 587) + (parseInt(colors[2]) * 114)) / 1000);
         var o = Math.round(((parseInt(colors[0]) * 299) + (parseInt(colors[1]) * 587) + (parseInt(colors[2]) * 114)) / 1000);
Line 318: Line 314:
         }
         }
     });
     });
$('.segment .mw-collapsible-text').each(function() {
var color = $(this).parents('.segment').find('.segment-header:eq(0)').css('color');
    var shadow = $(this).parents('.segment').find('.segment-header:eq(0)').css('text-shadow');
    $(this).css({color: color, textShadow: shadow})
});


});
});