Changeset 401 in tmcsimulator for trunk/webapps/einotebook/script/script.js


Ignore:
Timestamp:
05/15/2019 06:07:22 AM (7 years ago)
Author:
jdalbey
Message:

Fix #149, #112. Add emphasis to timebox. Partial fix to highlighting problem. Use Scoreboard font in CMS monitor.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/webapps/einotebook/script/script.js

    r359 r401  
    5151                         
    5252                        // IF there was previously a current event THEN 
    53                         if (highlightLatestEvent.oldEvent.id != Event.invalidID) 
     53                        if (highlightLatestEvent.oldEvent.id != Event.invalidID && currentEvent.id != 0) 
    5454                        { 
    5555                                highlightLatestEvent.oldEvent.unhighlight(); 
     
    6464} 
    6565 
     66 
     67/** Change color of text of expired events so they appear disabled. 
     68  * @param events The list of events 
     69  * @param currEvent The current event 
     70  */ 
     71function greyOldEvents(events, currEvent) 
     72{ 
     73          // Examine all events 
     74   for (var evtNum = 0; evtNum < events.length; evtNum++) 
     75   { 
     76                // Change color of those before current time and Event 
     77      if (events[evtNum].time.compareTo(currEvent.time) < 0 && currEvent.id != events[evtNum].id)  
     78      { 
     79                        events[evtNum].unhighlight(); 
     80      } 
     81        } 
     82} 
     83 
    6684/** 
    6785 * Loads the the script tab for the given document. 
     
    83101                // add the Event's html 
    84102                html += Script.events[i].html(); 
    85         //console.log(Script.events[i].html()); 
    86         } 
     103        } 
     104        
    87105         
    88106        // display events in iframe 
     
    97115        Script.events.win.scrollTo(0, readCookie('scriptScrollY')); 
    98116         
     117        greyOldEvents(Script.events, Script.events.getLastExecutedEvent(readCookie("time"))); 
    99118        highlightLatestEvent(); 
    100119 
Note: See TracChangeset for help on using the changeset viewer.