Changeset 4 for src/main/webapp/newsession.xhtml
- Timestamp:
- 09/24/19 14:13:26 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/webapp/newsession.xhtml
r2 r4 40 40 <div id="box" class="box"> 41 41 <br /> <b>Participants</b> <br /> Parties Server: <input type="url" 42 name="url" id="partiesserverurl" value="localhost:8080/partiesserver-1.0.0" 42 name="url" id="partiesserverurl" 43 value="localhost:8080/partiesserver-1.0.0" 43 44 pattern=".*:[0-9]+/partiesserver" size="30" 44 onchange="connectParties()"> </input> <br /> 45 <br /> <b>Editnext party</b> <br /> Party: <select id="partyselection">45 onchange="connectParties()"> </input> <br /> <br /> <b>Edit 46 next party</b> <br /> Party: <select id="partyselection"> 46 47 </select> <br /> Profile: <select id="profileselection"> 47 48 </select> <br /> … … 71 72 72 73 <div id="started" style="visibility: hidden"> 74 Your session started. Waiting for the results. <br /> 75 </div> 76 <div id="results" style="visibility: hidden"> 73 77 Your session started.<br /> <a href="" id="logref">view the log 74 78 file</a> <br /> <a href="" id="plotref">render a utilities plot</a>. … … 78 82 79 83 <script type="application/javascript"> 84 80 85 81 86 … … 310 315 if (this.readyState == 4) { 311 316 if (this.status == 200) { 317 var logurl="log/"+this.responseText+".json"; 312 318 document.getElementById("startbutton").disabled=true; 313 document.getElementById("logref").href= "log/"+this.responseText+".json";319 document.getElementById("logref").href=logurl; 314 320 document.getElementById("plotref").href="plotlog.xhtml?id="+this.responseText; 321 document.getElementById("started").setAttribute("style",""); 315 322 316 sometimeWhen(function() { x=x+1; return x==3},317 function() { document.getElementById(" started").setAttribute("style",""); });323 sometimeWhen(function() { return urlExists(logurl) }, 324 function() { document.getElementById("results").setAttribute("style",""); }); 318 325 319 326 } … … 327 334 } 328 335 336 337 /** 338 @return true iff the URL exists. 339 */ 340 function urlExists(urlToFile) { 341 // Warning. Synchronous XMLHttpRequest on the main thread is 342 // deprecated because of its detrimental effects to the end user’s 343 // experience. For more help http://xhr.spec.whatwg.org/ 344 var xhr = new XMLHttpRequest(); 345 xhr.open('HEAD', urlToFile, false); 346 xhr.send(); 347 348 return (xhr.status == "200") 349 } 329 350 330 351 /** … … 361 382 362 383 384 363 385 </script> 364 386
Note:
See TracChangeset
for help on using the changeset viewer.