Made "merge STDOUT+ERR" option conf'able in editor

master
Hauke D 7 years ago
parent 3d90c22fe7
commit d856a1b817

@ -170,7 +170,11 @@ this will not work.
Additional options: Setting "mergeStdOutErr" to a true value causes
STDOUT and STDERR output to be output together, similar to the way
they would be on the console.
they would be on the console. *However,* note that WebPerl
currently doesn't think it's connected to a terminal, which means
that perl defaults to block instead of line buffering STDOUT, so
it may seem like you always see STDERR output before STDOUT. If you
want to truly intermix the two, turn on autoflush ("$|=1;").
If you set the "autorun" option, the editor will attempt to run the
script as soon as the runner is ready. *WARNING:* If you have

@ -39,7 +39,7 @@ If not, see http://perldoc.perl.org/index-licence.html
<script>
"use strict";
var mergeStdOutErr = 0; // Possible To-Do for Later: could make an options hash
var mergeStdOutErr = false; // Possible To-Do for Later: could make an options hash
var perlRunner; // the Perl runner iframe found by findPerlRunner()
var buttonBlockers = {}; // for updateButtonState()
var lastExitStatus; // for runnerState()
@ -404,15 +404,24 @@ $(function () {
});
// stdout/stderr
var mergestdoe = $('#mergestdoe');
var stdout_fn = $('#stdout .filename');
if (hash["mergeStdOutErr"]) {
mergeStdOutErr = 1;
$('#stdout .filename').val("STDOUT+STDERR");
mergeStdOutErr = true;
stdout_fn.val("STDOUT+STDERR");
mergestdoe.text("Split STDOUT+ERR");
}
else {
mergeStdOutErr = 0;
$('#stdout .filename').val("STDOUT");
mergeStdOutErr = false;
stdout_fn.val("STDOUT");
}
clearStdOutput();
mergestdoe.click(function () {
clearStdOutput();
mergeStdOutErr = !mergeStdOutErr;
stdout_fn.val( mergeStdOutErr ? "STDOUT+STDERR" : "STDOUT" );
mergestdoe.text( mergeStdOutErr ? "Split STDOUT+ERR" : "Merge STDOUT+ERR" );
});
// output files
$('.outputs').remove();
@ -454,6 +463,7 @@ $(function () {
if (!data) return;
delete data.argv;
if (!autorunstate.text().match(/without/i)) data.autorun=true;
if (mergeStdOutErr) data.mergeStdOutErr=true;
var loc = new URL(window.location);
loc.hash = encodeURIComponent(JSON.stringify(data));
copyit(loc);
@ -462,6 +472,7 @@ $(function () {
var data = getFileData();
if (!data) return;
if (!autorunstate.text().match(/without/i)) data.autorun=true;
if (mergeStdOutErr) data.mergeStdOutErr=true;
copyit(JSON.stringify(data, null, "\t"));
});
@ -513,6 +524,8 @@ $(function () {
&nbsp;
<span id="addoutput" class="fakelink">Add Output File</span>
&nbsp;
<span id="mergestdoe" class="fakelink">Merge STDOUT+ERR</span>
&nbsp;
<span id="copyurl" class="fakelink">Copy URL</span>
/ <span id="copyjson" class="fakelink">JSON</span>
(<span id="autorunstate">with</span>

Loading…
Cancel
Save