Added detailed examples endpoint and modified results.

This commit is contained in:
2024-12-26 15:30:00 +01:00
parent fb3acbda78
commit e6b57ce789
5 changed files with 253 additions and 24 deletions
+11 -2
View File
@@ -23,10 +23,14 @@ $(document).ready(function() {
$(".table-wrapper tbody tr").click(function() {
$(".visualization-table").show();
var grew_url = $(this).data("href");
var subtree_hash = $(this).data("subtree-hash");
var example_id = $(this).data("exid");
var grew_link_text = $(this).data("grew-link-text");
var other_examples_text = $(this).data("other-examples-text");
var example_positions = $(this).data("expositions");
var dir_name = window.location.pathname.split("/").pop()
var url = window.location.origin + '/stark/visualization/' + dir_name + '/' + example_id + '/' + example_positions
var other_examples = window.location.origin + '/stark/result/' + dir_name + '/' + subtree_hash;
var url = window.location.origin + '/stark/visualization/' + dir_name + '/' + example_id + '/' + example_positions;
$.ajax({url: url, success: function(result){
var escapedHtml = `<pre><code class="conllu">${result['annodoc']}</code></pre>`;
$(".visualization").html(escapedHtml);
@@ -37,7 +41,12 @@ $(document).ready(function() {
if (grew_url == 'unknown') {
$(".grew-link").html("/");
} else {
$(".grew-link").html("<a href=" + grew_url + ">GREW link</a>");
$(".grew-link").html("<a href=" + grew_url + ">" + grew_link_text + "</a>");
}
if (other_examples == 'unknown') {
$(".other-examples").html("/");
} else {
$(".other-examples").html("<a href=" + other_examples + ">" + other_examples_text + "</a>");
}
});
$(".th-desc").hide();