Changeset 548 in tmcsimulator for trunk/webapps/einotebook/script
- Timestamp:
- 12/25/2019 09:44:50 AM (6 years ago)
- Location:
- trunk/webapps/einotebook/script
- Files:
-
- 3 edited
-
index.html (modified) (1 diff)
-
scrollframe.js (modified) (1 diff)
-
simscript.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/webapps/einotebook/script/index.html
r468 r548 13 13 <body> 14 14 15 15 16 <button class="jumpToCurrentEvent" 16 17 onclick="jumpToLastExecutedEvent()">Jump to Current Event</button> 17 18 18 19 <iframe id='view' src='scrollframe.html' frameborder='0' scrolling='yes' 19 20 width='100%'></iframe> 21 22 </form> 23 20 24 </body> 21 25 </html> -
trunk/webapps/einotebook/script/scrollframe.js
r468 r548 11 11 events = theEvents; 12 12 } 13 14 function collectRatings() 15 { 16 // Consider each event in the incident script 17 for (var evtidx = 0; evtidx < events.length; evtidx++) 18 { 19 // Does this event have any evaluations? 20 if (events[evtidx].evaluations.evaluations.length > 0) 21 { 22 // Examine each evaluation contained in this event 23 for (var rating=0; rating<events[evtidx].evaluations.evaluations.length; rating++ ) 24 { 25 // Extract the rating assigned to this item 26 var item = events[evtidx].evaluations.evaluations[rating]; 27 // If it not the default value we want to save it 28 if (item.rating > 0) 29 { 30 console.log("collecting event"+evtidx + " at " + events[evtidx].time.format() +" "+item.type + " " + item.rating) 31 } 32 } 33 } 34 } 35 } 36 37 /* This is an alternative way to collect the ratings values by reading them directly from the radio buttons 38 function collectRadios() 39 { 40 var radios = document.getElementsByTagName('input'); 41 var count = 0; 42 for (var j=0; j<radios.length; j++) 43 { 44 if (radios[j].type == 'radio') 45 { 46 count++; 47 if (radios[j].checked) 48 { 49 console.log(radios[j].name + " checked " + radios[j].value) 50 } 51 } 52 } 53 alert("counted " + count + " radios"); 54 } 55 */ 56 57 // TODO 58 function submitRatings() 59 { 60 // Using POST to send the data 61 var xhr = new XMLHttpRequest(); 62 xhr.open("POST", "../../cgi-bin/saveRatings.py", true); 63 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 64 // send the collected data 65 xhr.send("msg="+outString); 66 } -
trunk/webapps/einotebook/script/simscript.js
r468 r548 70 70 } 71 71 72 // Add a submit button to the very bottom 73 html += "<button style=\"float: right\" onclick=\"collectRatings();\">Submit Ratings</button>" 72 74 // display events in iframe 73 75 getDocumentFromFrame('view').body.innerHTML = html; … … 76 78 resizeIframe(); 77 79 window.onresize = resizeIframe; 78 // This line is causing an error79 //window.frames['view'].setEvents(Script.events);80 80 // Pass the events to the scroll frame window 81 document.getElementById("view").contentWindow.setEvents(Script.events); 82 81 83 Script.events.win.scrollTo(0, readCookie('scriptScrollY')); 82 84
Note: See TracChangeset
for help on using the changeset viewer.
