Skip to content

Commit

Permalink
Minor fix for displaying annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
mczuk committed Aug 1, 2019
1 parent 68fac5e commit 7da3a13
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion engine/include/utils/CReportContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ static function insertAnnotationsWithRelations(HtmlStr2 $htmlStr, $annotations,
$annotationIndex = array();
$annotationRelations = array();
foreach ($annotations as $an){
$annotationIndex[$an['id']] = $annotations;
$annotationIndex[$an['id']] = $an;
}
foreach ($relations as $relation){
if ( isset($annotationIndex[$relation['source_id']]) && isset($annotationIndex[$relation['target_id']]) ) {
Expand Down
10 changes: 5 additions & 5 deletions public_html/js/page_report_preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ $(document).ready(function(){

setupAnnotationTypeTree();

createAnaphoraLinks();
displatyAnnotationRelations();
setStage();
setSentences();

Expand Down Expand Up @@ -181,24 +181,24 @@ function setStage(){
/**
* Tworzy wizualizację połączeń anaforycznych. Indeksuje anotacje, które biorą udział w relacji.
*/
function createAnaphoraLinks(){
function displatyAnnotationRelations(){
$("sup.relin").remove();
$("sup.rel").each(function(){
var target_id = $(this).attr('target');
$("#an" + target_id).addClass("_anaphora_target");
$(".ann#an" + target_id).addClass("_relation_target");
$(this).attr('targetgroupid',$("#an" + target_id).attr('groupid'));
$(this).attr('targetsubgroupid',$("#an" + target_id).attr('subgroupid'));
$(this).attr('sourcesubgroupid',$("#an" + $(this).attr('sourcegroupid')).attr('subgroupid'));
$(this).attr('sourcegroupid',$("#an" + $(this).attr('sourcegroupid')).attr('groupid'));
});
$("span._anaphora_target").each(function(){
$("span._relation_target").each(function(){
$(this).before("<sup class='relin' targetsubgroupid="+$(this).attr('subgroupid')+" targetgroupid="+$(this).attr('groupid')+">"+anaphora_target_n+"</sup>");
$(this).removeClass("_anaphora_target");
anaphora_target_n++;
});
$("sup.rel").each(function(){
var target_id = $(this).attr('target');
var target_anaphora_n = $("#an" + target_id).prev("sup").text();
var target_anaphora_n = $(".ann#an" + target_id).prev("sup").text();
var title = $(this).attr("title");
if(title == 'Continous'){
$(this).text("⇢" + target_anaphora_n);
Expand Down

0 comments on commit 7da3a13

Please sign in to comment.