|
|
|
|
@ -82,13 +82,13 @@ function run_perl_iframe (argv, state_callback, done_callback) {
|
|
|
|
|
var outbuf = '';
|
|
|
|
|
IFramePerl.output = function (str) { outbuf+=str }; //TODO Later: maybe dynamic output updating is possible?
|
|
|
|
|
IFramePerl.endAfterMain = true;
|
|
|
|
|
IFramePerl.stateChanged = function (from,to) {
|
|
|
|
|
IFramePerl.addStateChangeListener( function (from,to) {
|
|
|
|
|
if (state_callback) state_callback(to);
|
|
|
|
|
if (from!='Ended' && to=='Ended') {
|
|
|
|
|
iframe.remove();
|
|
|
|
|
if (done_callback) done_callback(outbuf);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
} );
|
|
|
|
|
IFramePerl.init(function () {
|
|
|
|
|
window.setTimeout(function () { IFramePerl.start(argv); }, 1);
|
|
|
|
|
});
|
|
|
|
|
@ -144,14 +144,13 @@ $( function() {
|
|
|
|
|
runonce.before( runonce_toggle );
|
|
|
|
|
runonce.hide();
|
|
|
|
|
}
|
|
|
|
|
Perl.stateChanged = function (from,to) {
|
|
|
|
|
console.debug("Perl: state changed from "+from+" to "+to);
|
|
|
|
|
Perl.addStateChangeListener( function (from,to) {
|
|
|
|
|
$('#runstate').text("State: "+to);
|
|
|
|
|
$('#runperl' ).prop("disabled", to!="Ready");
|
|
|
|
|
$('#argv' ).prop("disabled", to!="Ready");
|
|
|
|
|
$('#evalperl').prop("disabled", to!="Running");
|
|
|
|
|
$('#endperl' ).prop("disabled", to!="Running");
|
|
|
|
|
};
|
|
|
|
|
} );
|
|
|
|
|
Perl.init(final_init);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|