Changeset 406 in tmcsimulator for trunk/webapps/cmsmonitor/index.html


Ignore:
Timestamp:
05/15/2019 03:32:34 PM (7 years ago)
Author:
jdalbey
Message:

Enhance CMS monitor with alternate row background colors. Fixes #109.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/webapps/cmsmonitor/index.html

    r405 r406  
    4949  padding: 0px 20% 20px 20%; 
    5050} 
     51.odd { 
     52  background-color: rgb(29, 21, 21); 
     53} 
     54.even { 
     55  background-color: #323232; 
     56} 
    5157.divider { 
    5258  font-family: Scoreboard; 
     
    96102    function loadAllcmsMessages() 
    97103    { 
     104        // counter that alternate the background color of the cms message  
     105        var cnt = 0; 
    98106        var display = document.getElementById("msgs"); 
    99107        display.innerHTML = "" 
     
    105113            for (var i = 0; i < messagejson.data.length; i++) 
    106114            { 
     115                var bg; // variable that alternate the background color for cms message 
    107116                var item = messagejson.data[i]; 
    108117                // Find the location for this message 
     
    121130                if (phase1 != "<br><br><br>" || phase2 != "<br><br>") 
    122131                { 
    123                     display.innerHTML += "<div id=\"cms_info\">" + item.cms.index + ": " +  
     132                    // Keep track of the number of non-empty cms message  
     133                    cnt++; 
     134                    // Determine odd or even cms message in order to alternate the background color 
     135                    if (cnt%2==0) { 
     136                      bg = "even"; 
     137                    } else { 
     138                      bg = "odd"; 
     139                    } 
     140                    display.innerHTML += "<div id=\"cms_info\" class=\"" + bg + "\">" + item.cms.index + ": " +  
    124141                        cmsLoc.properties.location + " " + cmsLoc.properties.street + "</div>"; 
    125                     display.innerHTML += "<div class=\"cms_content\">" + phase1 + "</div>" + 
    126                       "<div class=\"divider\"> -----------------------------------------------</div>" + 
    127                       "<div class=\"cms_content\">" + phase2 + "</div>"; 
     142                    display.innerHTML += "<div class=\"cms_content " + bg + "\">" + phase1 + "</div>" + 
     143                      "<div class=\"divider " + bg + "\"> -----------------------------------------------</div>" + 
     144                      "<div class=\"cms_content " + bg + "\">" + phase2 + "</div>"; 
    128145                } 
    129146            } 
Note: See TracChangeset for help on using the changeset viewer.