From d36598bdda23e82469e5300c821d3a7513f2fdc8 Mon Sep 17 00:00:00 2001 From: Stephan Porada Date: Thu, 30 Jan 2020 14:23:19 +0100 Subject: [PATCH] Update new analysis list construction --- app/static/js/nopaque.lists.js | 13 ++++++++----- app/templates/corpora/analyse_corpus.html.j2 | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/static/js/nopaque.lists.js b/app/static/js/nopaque.lists.js index d3210160..52961951 100644 --- a/app/static/js/nopaque.lists.js +++ b/app/static/js/nopaque.lists.js @@ -247,11 +247,12 @@ class JobList extends List { class ResultList extends List { - createResultRowElement(item) { + createResultRowElement(item, chunk) { let values, cpos, matchRowElement, lcCellElement, lcTokenElement, token; // gather values from item values = item.values(); - + console.log("CHONK"); + console.log(chunk); // get infos for full match row matchRowElement = document.createElement("tr"); for (cpos of values["lc"]) { @@ -261,10 +262,11 @@ class ResultList extends List { lcTokenElement.classList.add("token"); lcTokenElement.dataset.cpos = cpos; token = chunk["cpos_lookup"][cpos]; - lcTokenElement = token["word"]; - console.log(lcTokenElement.outerHTML); + lcTokenElement.innerText = token["word"]; + lcCellElement.appendChild(lcTokenElement); // let hit_tokens = ""; } + matchRowElement.appendChild(lcCellElement); // // get infos of match // let textTitles = new Set(); // for (cpos of match["hit"]) { @@ -305,7 +307,8 @@ class ResultList extends List { // // matchRowElement.appendChild(rc_tokens); // // matchRowElement.appendChild(index); // } - // return matchRowElement + console.log(matchRowElement.outerHTML); + return matchRowElement } } diff --git a/app/templates/corpora/analyse_corpus.html.j2 b/app/templates/corpora/analyse_corpus.html.j2 index a1054be4..04d511c1 100644 --- a/app/templates/corpora/analyse_corpus.html.j2 +++ b/app/templates/corpora/analyse_corpus.html.j2 @@ -382,7 +382,7 @@ } resultList.add(resultItems, items => { for (let item of items) { - item.elm = resultList.createResultRowElement(item);} + item.elm = resultList.createResultRowElement(item, chunk);} }); resultList.update(); });