Hide textarea and show error for old version.

pull/1/head
chriseth 9 years ago
parent 519dbe2d4a
commit fe02fd80ab
  1. 15
      src/app/formalVerification.js

@ -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;

Loading…
Cancel
Save