MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 3: Line 3:
(function () {
(function () {
     function colorContent(text, color) {
     function colorContent(text, color) {
         return { text, color, xpath: "//td[contains(text(),'" + text + "')]" }
         var obj = {};
        obj.text = text;
        obj.color = color;
        obj.xpath "//td[contains(text(),'" + text + "')]";
        return obj;
     }
     }
     /* Active Code */
     /* Active Code */
Line 9: Line 13:
     if (mw.config.get('wgPageName') === 'Mobile_Suits') {
     if (mw.config.get('wgPageName') === 'Mobile_Suits') {
         var colorList = [
         var colorList = [
             colorContent('Super High Tensile Steel', '#7b9095')
             colorContent('Super High Tensile Steel', '#7b9095'),
            colorContent('x Titanium Alloy','#067da1'),
            colorContent('x Luna Titanium Alloy','#0799c5')
         ]
         ]


         colorList.forEach((colorElement) => {
         for(var i = 0; i < colorList.length; i++)
        {
            var colorElement = colorList[i];
             var y = document.evaluate(
             var y = document.evaluate(
                 colorElement.xpath,
                 colorElement.xpath,
Line 26: Line 34:
                 x.style.color = colorElement.color
                 x.style.color = colorElement.color
             }
             }
         })
         }
     }
     }




}());
}());
EFF, ZEON, approveduser, Bureaucrats, Interface administrators, Administrators, uploadaccess
843

edits

Navigation menu