Changeset 468 in tmcsimulator for trunk/webapps/einotebook/notebook.js
- Timestamp:
- 07/28/2019 05:27:26 AM (7 years ago)
- File:
-
- 1 edited
-
trunk/webapps/einotebook/notebook.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/webapps/einotebook/notebook.js
r415 r468 1 /*2 function loadXMLDoc()3 {4 if (window.XMLHttpRequest)5 {6 xmlhttp = new XMLHttpRequest();7 }8 else9 {10 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");11 }12 13 xmlhttp.onreadystatechange=function()14 {15 if (xmlhttp.readyState==4 && xmlhttp.status==200)16 {17 document.getElementById("myDiv").innerHTML = xmlhttp.responseText;18 }19 }20 21 xmlhttp.open("GET", "ajax_info.txt", true);22 xmlhttp.send("");23 }24 */25 26 1 /** 27 2 * Sets the selected tab to the summary tab and loads the summary page. … … 31 6 { 32 7 console.log("setupNotebook() starting"); 33 changeTab('summaryTab'); 8 changeTab('summaryTab'); // Initially show Summary tab 34 9 showContent('summaryPageContent') 35 loadSummary(); 10 loadSummaryPage(); 11 loadPages(); 36 12 setCookie("time", "0"); 37 13 setCookie("scriptScrollY", 0); 38 14 setCookie("summaryScrollY", 0); 15 run(); // start the script scrolling 39 16 } 40 17 41 18 /** 42 * Runs the script. 19 * Loads the summary tab page; 20 */ 21 function loadSummaryPage() 22 { 23 incidents.doc = getDocumentFromFrame('summaryTabPage'); 24 window.frames[0].loadSummary(incidents); 25 } 26 27 /** 28 * Loads content of the pages for Simulation Script and Current Event 29 */ 30 function loadPages() 31 { 32 window.frames[1].loadScript(events, incidents); 33 window.frames[2].loadScript(events, incidents); 34 } 35 36 /** 37 * Start scrolling the script in an infinite loop. 43 38 */ 44 39 function run() 45 40 { 46 41 run.initialDelay = 1000; 47 48 42 setTimeout("run.run()", run.initialDelay); 49 43 50 44 run.run = function() 51 45 { 52 // document.getElementById("simulationStatus").innerHTML = "RUNNING";53 46 setTime(); 54 updateStatus();55 47 }; 56 }57 58 /**59 * Displays fading text alerts in the status box (left-top corner).60 */61 function updateStatus()62 {63 // IF last event if it has not been set before THEN64 if (typeof updateStatus.lastEvent == 'undefined')65 {66 updateStatus.lastEvent = null;67 }68 69 var latestEvent = events.getLastExecutedEvent(readCookie("time"));70 71 72 // IF a new event executed THEN73 if (updateStatus.lastEvent != latestEvent)74 {75 var i;76 for (i=0; i<latestEvent.length; i++) {77 // IF the new event has evaluations THEN78 if (latestEvent[i].evaluations.evaluations.length == 0)79 {80 // document.getElementById('updateStatus').innerHTML = "New Event";81 }82 else83 {84 // document.getElementById('updateStatus').innerHTML = "New Evaluation";85 }86 }87 88 89 // fades the text90 updateStatus.fade = function fade()91 {92 // IF the fade color is not black yet THEN93 if (fade.hex < 255)94 {95 fade.hex += 5;96 // document.getElementById('updateStatus').style.color =97 "rgb(" + fade.hex + ", " + fade.hex + ", " + fade.hex + ")";98 setTimeout("updateStatus.fade()", 100);99 }100 else101 {102 // document.getElementById('updateStatus').style.color = "white";103 }104 105 };106 107 updateStatus.fade.hex = 0;108 updateStatus.fade();109 updateStatus.lastEvent = latestEvent;110 }111 112 setTimeout("updateStatus();", 1000);113 48 } 114 49 … … 129 64 setTime.time = seconds; 130 65 // increment time by one second (or initialize it if it has not been set before) 131 // setTime.time = (typeof setTime.time == 'undefined') ? 0 : ++setTime.time;66 // setTime.time = (typeof setTime.time == 'undefined') ? 0 : ++setTime.time; 132 67 133 68 setCookie("time", "" + setTime.time); … … 152 87 document.getElementById("summaryTab").className = "notActive"; 153 88 document.getElementById("scriptTab").className = "notActive"; 154 document.getElementById(" CADTab").className = "notActive";89 document.getElementById("currentTab").className = "notActive"; 155 90 document.getElementById("mapsTab").className = "notActive"; 156 91 157 92 /* Set the selected tab to being active */ 158 93 document.getElementById(id).className = "activeTab"; 159 }160 161 /**162 * Loads the script tab page;163 */164 function loadScript()165 {166 }167 168 /**169 * Loads the summary tab page;170 */171 function loadSummary()172 {173 94 } 174 95 … … 204 125 hideContent('summaryPageContent'); 205 126 hideContent('scriptPageContent'); 206 hideContent('c adPageContent');127 hideContent('currentEventPageContent'); 207 128 hideContent('mapsPageContent'); 208 129 document.getElementById(d).style.display = "block";
Note: See TracChangeset
for help on using the changeset viewer.
