diff --git a/TrimSP.html b/TrimSP.html index a275856..e16643c 100644 --- a/TrimSP.html +++ b/TrimSP.html @@ -4,8 +4,16 @@ - - + + diff --git a/TrimSPlib.js b/TrimSPlib.js index 923bfe1..72ac418 100644 --- a/TrimSPlib.js +++ b/TrimSPlib.js @@ -3748,6 +3748,10 @@ async function startSequence() { randStr = (Math.random() + 1).toString(36).substring(7); All["fileNamePrefix"] = randStr; All["workPath"] = "/tmp/" + randStr; + // prep_cfg() reads these values from the DOM, so keep the hidden web + // fields synchronized with the randomized server-side run directory. + document.getElementById("fileNamePrefix").value = All["fileNamePrefix"]; + document.getElementById("workPath").value = All["workPath"]; updateStatusBar({ backend: 'Web backend' }); } updateStatusBar({ workPath: All["workPath"], run: 'Starting run...' }); diff --git a/TrimSPweb.js b/TrimSPweb.js index cb9f2a8..b7062b3 100644 --- a/TrimSPweb.js +++ b/TrimSPweb.js @@ -6,6 +6,12 @@ function writeAsciiFile(filename,content) { //console.log(filename, content); // Prepare CGI args use POST for long files let cgiargs = "fn="+filename; // POST + // Forward the GUI-selected RNG backend to the CGI wrapper, which passes it + // to trimspNL as the optional second command-line argument. + let rngType = document.getElementById("rngType"); + if (rngType) { + cgiargs += "&rngType=" + rngType.value; + } let lines = content.split(/\n/); let prefix = filename.split(/\//); for (let i=0; i