MediaWiki:Common.js: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
Line 305: Line 305:
         }
         }
     });
     });
     /* Deal with rainbow rows *//*
     /* Deal with rainbow rows */
     $('.rainbow').each(function(){
     $('.rainbow').each(function(){
         var rb_TotalWidth = parseInt($(this).width()),
         var rb_Height = $(this).innerHeight(),
             rb_LBorder = 0,
             rb_Width = $(this).innerWidth();
            rb_RBorder,
         var rb_Element = $(this).is('tr') ? $(this).children().first() : $(this);
            rb_CellWidth;
         var rb_ZIndex = parseInt(rb_Element.css('z-index')) || 0 - 1;
        var rb_LPos,
        rb_Element.css('position', 'relative');
            rb_RPos,
        $(document.createElement('span')).css({
            rb_LCheckpoint,
             'display': 'block',
            rb_RCheckpoint;
            'position': 'absolute',
        var rb_HSL;
             'background-image': 'linear-gradient(to right,' +  
         var rb_Element = $(this).children().length ? $(this).children() : $(this);
                 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map(function(i){
         rb_Element.each(function(){
                    return 'hsl(' + (i * 36).toString() + ',100%,50%) ' + (i * 10).toString() + '%';
            rb_CellWidth = $(this).outerWidth(true);
                }).join(',')
            rb_RBorder = rb_LBorder + rb_CellWidth;
                + ')',
            rb_LPos = rb_LBorder / rb_TotalWidth * 10;
             'top': 0,
            rb_RPos = rb_RBorder / rb_TotalWidth * 10;
             'left': 0,
            rb_LCheckpoint = Math.ceil(rb_LPos);
            'bottom': 0,
            rb_RCheckpoint = Math.floor(rb_RPos);
            'right': 0,
             rb_HSL = ['hsl(' + (rb_LPos * 36).toString() + ',100%,50%) 0%'];
            'height': rb_Height + 'px',
             for(var i = rb_LCheckpoint; i <= rb_RCheckpoint; i++){
            'width': rb_Width + 'px',
                 rb_HSL.push('hsl(' + (i * 36).toString() + ',100%,50%) ' + ((i - rb_LPos) * 10).toString() + '%');
             'z-index': rb_ZIndex
            }
         }).prependTo(rb_Element);
            rb_HSL.push('hsl(' + (rb_RPos * 36).toString() + ',100%,50%) 100%');
     });
             rb_LBorder = rb_RBorder;
             $(this).css({
                'background-image': 'linear-gradient(to right,' + rb_HSL.join(',') + ')'
             });
         });
     });*/
     /*
     /*
         $('table.odd-stripe > tbody > tr:has(td):').css('background-color', function(){
         $('table.odd-stripe > tbody > tr:has(td):').css('background-color', function(){