mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-12 00:50:40 +00:00
Update
This commit is contained in:
@ -131,24 +131,24 @@
|
||||
client.setDisplay("init", initDisplay);
|
||||
client.setCallback("init", () => {initModal.close();});
|
||||
client.setDisplay("query", queryDisplay);
|
||||
client.setCallback("query", (response) => {
|
||||
client.setCallback("query", (payload) => {
|
||||
// This is called when a query was successfull
|
||||
results = {matches: [], cpos_lookup: {}, text_lookup: {}};
|
||||
queryResultsDeterminateElement.style.width = "0%";
|
||||
receivedMatchNumElement.innerText = "0";
|
||||
textLookupNumElement.innerText = "0";
|
||||
matchNumElement.innerText = response.num_matches;
|
||||
matchNumElement.innerText = payload.num_matches;
|
||||
});
|
||||
client.setCallback("query_results", (response) => {
|
||||
client.setCallback("query_results", (payload) => {
|
||||
// This is called when results are transmitted.
|
||||
if (response.progress === 100) {
|
||||
if (payload.progress === 100) {
|
||||
queryResultsProgressElement.classList.add("hide");
|
||||
}
|
||||
queryResultsDeterminateElement.style.width = `${response.progress}%`;
|
||||
results.matches.push(...response.chunk.matches);
|
||||
queryResultsDeterminateElement.style.width = `${payload.progress}%`;
|
||||
results.matches.push(...payload.chunk.matches);
|
||||
receivedMatchNumElement.innerText = `${results.matches.length}`;
|
||||
Object.assign(results.cpos_lookup, response.chunk.cpos_lookup);
|
||||
Object.assign(results.text_lookup, response.chunk.text_lookup);
|
||||
Object.assign(results.cpos_lookup, payload.chunk.cpos_lookup);
|
||||
Object.assign(results.text_lookup, payload.chunk.text_lookup);
|
||||
textLookupNumElement.innerText = `${Object.keys(results.text_lookup).length}`;
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user