Changeset 632 in tmcsimulator for trunk/webapps/einotebook/script/scrollframe.js


Ignore:
Timestamp:
02/03/2021 06:34:04 AM (5 years ago)
Author:
jdalbey
Message:

Remove code made obsolete by modifications for #251

File:
1 edited

Legend:

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

    r631 r632  
    1212} 
    1313 
    14 // Collect all the ratings from the events - OBSOLETE 
    15 function collectRatings()  
    16 { 
    17     var output = "" 
    18     var ratingCount = 0 
    19     // Consider each event in the incident script 
    20     for (var evtidx = 0; evtidx < events.length; evtidx++) 
    21     { 
    22         // Does this event have any evaluations? 
    23         if (events[evtidx].evaluations.evaluations.length > 0) 
    24         { 
    25             // Examine each evaluation contained in this event 
    26             for (var rating=0; rating<events[evtidx].evaluations.evaluations.length; rating++ ) 
    27             { 
    28                 // Extract the rating assigned to this item 
    29                 var item = events[evtidx].evaluations.evaluations[rating]; 
    30                 // If it not the default value we want to save it 
    31                 if (item.rating > 0) 
    32                 {   // Build a string for the log in this format: 
    33                     //03:01:00, Evaluation, CMS, Poor 
    34                     output += events[evtidx].time.format() +", Evaluation, "+item.type + ", " + item.ratingQualities[item.rating] + "\n" 
    35                     ratingCount += 1;   
    36                 } 
    37             } 
    38         } 
    39     } 
    40     submitRatings(output); 
    41     alert(ratingCount + " rating were saved.") 
    42 } 
    4314 
    44 /* This is an alternative way to collect the ratings values by reading them directly from the radio buttons  
    45 function collectRadios() 
    46 { 
    47     var radios = document.getElementsByTagName('input'); 
    48     var count = 0; 
    49     for (var j=0; j<radios.length; j++) 
    50     { 
    51         if (radios[j].type == 'radio')  
    52         { 
    53             count++; 
    54             if (radios[j].checked)  
    55             { 
    56                 console.log(radios[j].name + " checked " + radios[j].value)                         
    57             } 
    58         } 
    59     } 
    60     alert("counted " + count + " radios"); 
    61 } 
    62 */ 
    6315 
    64 // Send the string of ratings to the server - OBSOLETE 
    65 function submitRatings(logString) 
    66 { 
    67         // Using POST to send the data  
    68         var xhr = new XMLHttpRequest(); 
    69         xhr.open("POST", "/cgi-bin/saveRatingsToLog.py", true); 
    70         xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 
    71         // send the collected data 
    72         xhr.send("msg="+logString); 
    73 } 
Note: See TracChangeset for help on using the changeset viewer.