mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-04-06 01:04:22 +00:00
Fix inspect activation on queryFinished
This commit is contained in:
parent
ebe598312f
commit
7de4b391df
@ -60,6 +60,9 @@ function sendQuery(event) {
|
|||||||
|
|
||||||
// Function used when CQP server sends back the query results using socketio
|
// Function used when CQP server sends back the query results using socketio
|
||||||
function recieveResults(response) {
|
function recieveResults(response) {
|
||||||
|
let toolTipInfoElement;
|
||||||
|
|
||||||
|
queryFinished = false;
|
||||||
|
|
||||||
// ERROR code checking
|
// ERROR code checking
|
||||||
if (response["code"] === 0) {
|
if (response["code"] === 0) {
|
||||||
@ -134,14 +137,12 @@ function recieveResults(response) {
|
|||||||
console.log(queryStatus);
|
console.log(queryStatus);
|
||||||
queryResultsDeterminateElement.style["width"] = `${queryStatus}%`;
|
queryResultsDeterminateElement.style["width"] = `${queryStatus}%`;
|
||||||
console.log(queryResultsDeterminateElement.style["width"]);
|
console.log(queryResultsDeterminateElement.style["width"]);
|
||||||
let toolTipInfoElement = document.getElementById("tool-tip-info");
|
toolTipInfoElement = document.getElementById("tool-tip-info");
|
||||||
toolTipInfoElement.addEventListener("mouseover", function(event) {
|
|
||||||
M.Tooltip.init(toolTipInfoElement, {"html": `<p>The Server is still sending you your results. Functions like "Export Results" and "Match Inspect" will be available after all matches have been loaded.</p>`,
|
M.Tooltip.init(toolTipInfoElement, {"html": `<p>The Server is still sending you your results. Functions like "Export Results" and "Match Inspect" will be available after all matches have been loaded.</p>`,
|
||||||
"inDuration": 1500,
|
"inDuration": 1500,
|
||||||
"margin": 15,
|
"margin": 15,
|
||||||
"position": "top",
|
"position": "top",
|
||||||
"transitionMovement": 0})
|
"transitionMovement": 0});
|
||||||
});
|
|
||||||
// enable download and inspect when query is finished
|
// enable download and inspect when query is finished
|
||||||
// also sets queryFinished to true
|
// also sets queryFinished to true
|
||||||
if (queryStatus === 100) {
|
if (queryStatus === 100) {
|
||||||
@ -178,6 +179,7 @@ function inspect(dataIndex) {
|
|||||||
function showMatchContext(message) {
|
function showMatchContext(message) {
|
||||||
console.log("### match_context ###");
|
console.log("### match_context ###");
|
||||||
console.log("Incoming data:", message);
|
console.log("Incoming data:", message);
|
||||||
|
let contextResultsElement = document.getElementById("context-results");
|
||||||
contextResultsElement.innerHTML = "<p> </p>";
|
contextResultsElement.innerHTML = "<p> </p>";
|
||||||
document.getElementById("context-modal-loading").classList.add("hide");
|
document.getElementById("context-modal-loading").classList.add("hide");
|
||||||
document.getElementById("context-modal-ready").classList.remove("hide");
|
document.getElementById("context-modal-ready").classList.remove("hide");
|
||||||
|
@ -237,7 +237,6 @@ server side -->
|
|||||||
var loadingModal;
|
var loadingModal;
|
||||||
var exportModal;
|
var exportModal;
|
||||||
// create some global variables
|
// create some global variables
|
||||||
var hitsPerPage;
|
|
||||||
var result;
|
var result;
|
||||||
var resultList;
|
var resultList;
|
||||||
var queryFinished;
|
var queryFinished;
|
||||||
@ -246,9 +245,8 @@ server side -->
|
|||||||
var queryResultsDeterminateElement;
|
var queryResultsDeterminateElement;
|
||||||
var queryResultsTableElement;
|
var queryResultsTableElement;
|
||||||
var queryLoadingElement;
|
var queryLoadingElement;
|
||||||
var toolTipInfoElement;
|
var queryFormElement;
|
||||||
|
var hitsPerPageInputElement;
|
||||||
var contextResultsElement;
|
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
contextModal = M.Modal.init(document.getElementById("context-modal"),
|
contextModal = M.Modal.init(document.getElementById("context-modal"),
|
||||||
@ -277,23 +275,20 @@ server side -->
|
|||||||
// getting some HTML-elements to use/hide/remove/show or add some other
|
// getting some HTML-elements to use/hide/remove/show or add some other
|
||||||
// elements to them.
|
// elements to them.
|
||||||
// These elements will be used inside functions in nopaque.analyse_corpus.js
|
// These elements will be used inside functions in nopaque.analyse_corpus.js
|
||||||
var queryResultsDeterminateElement = document.getElementsByClassName("determinate")[0];
|
queryResultsDeterminateElement = document.getElementsByClassName("determinate")[0];
|
||||||
var queryResultsTableElement = document.getElementById("recieved-query-results");
|
queryResultsTableElement = document.getElementById("recieved-query-results");
|
||||||
var queryLoadingElement = document.getElementById("getting-query-results");
|
queryLoadingElement = document.getElementById("getting-query-results");
|
||||||
var exportQueryResultsElement = document.getElementById("export-query-results");
|
exportQueryResultsElement = document.getElementById("export-query-results");
|
||||||
|
|
||||||
|
|
||||||
var contextResultsElement = document.getElementById("context-results");
|
|
||||||
|
|
||||||
// socket.io analysis submit to the CQP server
|
// socket.io analysis submit to the CQP server
|
||||||
let queryFormElement = document.getElementById("query-form");
|
queryFormElement = document.getElementById("query-form");
|
||||||
queryFormElement.addEventListener("submit", sendQuery);
|
queryFormElement.addEventListener("submit", sendQuery);
|
||||||
|
|
||||||
// get context of one match if inspected
|
// get context of one match if inspected
|
||||||
nopaque.socket.on("match_context", showMatchContext);
|
nopaque.socket.on("match_context", showMatchContext);
|
||||||
|
|
||||||
// live update of hits per page
|
// live update of hits per page if hits per page value is changed
|
||||||
var hitsPerPageInputElement = document.getElementById("hits-per-page");
|
hitsPerPageInputElement = document.getElementById("hits-per-page");
|
||||||
hitsPerPageInputElement.onchange = changeHitsPerPage;
|
hitsPerPageInputElement.onchange = changeHitsPerPage;
|
||||||
|
|
||||||
// live update of lr context per item if context value is changed
|
// live update of lr context per item if context value is changed
|
||||||
|
Loading…
x
Reference in New Issue
Block a user