Changeset 351 in tmcsimulator for trunk/webapps/js/cmsLayer.js
- Timestamp:
- 03/31/2019 10:20:47 AM (7 years ago)
- File:
-
- 1 edited
-
trunk/webapps/js/cmsLayer.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/webapps/js/cmsLayer.js
r335 r351 115 115 document.getElementById('msgdisplay5').value = response5; 116 116 document.getElementById('msgdisplay6').value = response6; 117 save Message(response1 + "|" + response2 + "|" + response3 + "|" +117 saveCMSMessage(response1 + "|" + response2 + "|" + response3 + "|" + 118 118 response4 + "|" + response5 + "|" + response6); 119 119 } … … 128 128 document.getElementById('msgdisplay5').value = ""; 129 129 document.getElementById('msgdisplay6').value = ""; 130 save Message("|||||");130 saveCMSMessage("|||||"); 131 131 } 132 132 133 133 // Save an updated cms message to the file 134 function save Message(outMessage)134 function saveCMSMessage(outMessage) 135 135 { 136 136 // Fetch cmsID from hidden field where it was put when dialog opened. … … 144 144 messageDict[cmsID].cms.message.phase2.Line2 = msgParts[4]; 145 145 messageDict[cmsID].cms.message.phase2.Line3 = msgParts[5]; 146 // Check if there was any messages to save and 146 147 // Set icon to reflect message state 147 148 if (outMessage == "|||||") … … 155 156 cmsLayer.overrideStyle(cmsLayer.getFeatureById(cmsID), currentIcon) 156 157 // break the json string into lines for readability 157 jsonstring = JSON.stringify(Object.values(messageDict)); // ,null,4);158 jsonstring = JSON.stringify(Object.values(messageDict)); //Can't use these in GET parameter ,null,4); 158 159 outString = "{\"data\":" + jsonstring + "}"; 159 160 console.log("outString = " + outString); 160 161 var xhttp = new XMLHttpRequest(); 161 162 xhttp.open("GET", "cgi-bin/saveCMSmessage.py?msg=" + outString, true); … … 163 164 // Using POST might be a better idea ... haven't tried this yet 164 165 // var xhr = new XMLHttpRequest(); 165 // xhr.open("POST", "/cgi-bin/save Message.py?", true);166 // xhr.open("POST", "/cgi-bin/saveCMSmessage.py?", true); 166 167 // xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8'); 167 168 // send the collected data as JSON
Note: See TracChangeset
for help on using the changeset viewer.
