2015-07-14 19:23:35 +02:00
|
|
|
$("#btn_validate").click( function () {
|
|
|
|
$("#warnings").html("");
|
|
|
|
$("#errors").html("");
|
|
|
|
$("#results").html("");
|
|
|
|
|
|
|
|
validate($("#ta_turtle").val(), function (feedback) {
|
|
|
|
$.each(feedback.warnings, function (index, warning) {
|
2016-11-29 10:55:57 +01:00
|
|
|
$("#warnings").append($('<li id="warning' + index + '">').text(warning));
|
2015-07-14 19:23:35 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
$.each(feedback.errors, function (index, error) {
|
2016-11-29 10:55:57 +01:00
|
|
|
$("#errors").append($('<li id="error' + index + '">').text(error));
|
2015-07-14 19:23:35 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
if (feedback.errors.length === 0 && feedback.warnings.length === 0) {
|
2016-11-29 10:55:57 +01:00
|
|
|
$("#results").append("Congrats! Your syntax is correct.");
|
2015-07-14 19:23:35 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|