Commit fe02fd80 authored by chriseth's avatar chriseth

Hide textarea and show error for old version.

parent 519dbe2d
...@@ -6,17 +6,26 @@ function FormalVerification (outputElement, renderer) { ...@@ -6,17 +6,26 @@ function FormalVerification (outputElement, renderer) {
} }
FormalVerification.prototype.compiling = function () { FormalVerification.prototype.compiling = function () {
$('#formalVerificationInput', this.outputElement).val(''); $('#formalVerificationInput', this.outputElement)
.val('')
.hide();
$('#formalVerificationErrors').empty(); $('#formalVerificationErrors').empty();
}; };
FormalVerification.prototype.compilationFinished = function (compilationResult) { FormalVerification.prototype.compilationFinished = function (compilationResult) {
if (compilationResult.formal !== undefined) { if (compilationResult.formal === undefined) {
this.renderer.error(
'Formal verification not supported by this compiler version.',
$('#formalVerificationErrors'),
true
);
} else {
if (compilationResult.formal['why3'] !== undefined) { if (compilationResult.formal['why3'] !== undefined) {
$('#formalVerificationInput', this.outputElement).val( $('#formalVerificationInput', this.outputElement).val(
'(* copy this to http://why3.lri.fr/try/ *)' + '(* copy this to http://why3.lri.fr/try/ *)' +
compilationResult.formal['why3'] compilationResult.formal['why3']
); )
.show();
} }
if (compilationResult.formal.errors !== undefined) { if (compilationResult.formal.errors !== undefined) {
var errors = compilationResult.formal.errors; var errors = compilationResult.formal.errors;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment