MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
 
(9 intermediate revisions by the same user not shown)
Line 2: Line 2:
/* Class Code */
/* Class Code */
(function () {
(function () {
     class ColorContent; {
     function colorContent(text, color) {
        constructor(text, color) {
        var obj = {};
            this.text = text
        obj.text = text;
            this.color = color
        obj.color = color;
         }
         obj.xpath "//td[contains(text(),'" + text + "')]";
        get xpath() {
         return obj;
            return "//td[contains(text(),'" + this.text + "')]"
         }
     }
     }
     /* Active Code */
     /* Active Code */
Line 15: Line 13:
     if (mw.config.get('wgPageName') === 'Mobile_Suits') {
     if (mw.config.get('wgPageName') === 'Mobile_Suits') {
         var colorList = [
         var colorList = [
             new 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 32: Line 34:
                 x.style.color = colorElement.color
                 x.style.color = colorElement.color
             }
             }
         })
         }
     }
     }




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

edits

Navigation menu