Added visualization of sentences.
This commit is contained in:
+19
-3
@@ -18,10 +18,26 @@ function getUrlParameters() {
|
||||
$(document).ready(function() {
|
||||
var params = getUrlParameters();
|
||||
// Make table rows clickable
|
||||
$(".visualization-table").hide();
|
||||
|
||||
$(".table-wrapper tbody tr").click(function() {
|
||||
var url = $(this).data("href");
|
||||
if (url) {
|
||||
window.open(url, '_blank');
|
||||
$(".visualization-table").show();
|
||||
var grew_url = $(this).data("href");
|
||||
var example_id = $(this).data("exid");
|
||||
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
|
||||
$.ajax({url: url, success: function(result){
|
||||
var escapedHtml = `<pre><code class="conllu">${result['annodoc']}</code></pre>`;
|
||||
$(".visualization").html(escapedHtml);
|
||||
$('.visualization .conllu').each(function() {
|
||||
Annodoc.embedAnnotation($(this), Annodoc.parseConllU, Config.bratCollData);
|
||||
});
|
||||
}});
|
||||
if (grew_url == 'unknown') {
|
||||
$(".grew-link").html("/");
|
||||
} else {
|
||||
$(".grew-link").html("<a href=" + grew_url + ">GREW link</a>");
|
||||
}
|
||||
});
|
||||
$(".th-desc").hide();
|
||||
|
||||
Reference in New Issue
Block a user