mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-21 05:20:36 +00:00
Work on View notifications
This commit is contained in:
@ -41,8 +41,7 @@
|
||||
<div class="col s12" id="query-display">
|
||||
<div class="card">
|
||||
<div class="card-content" id="result-list" style="overflow: hidden;">
|
||||
<div class="error-container hide show-on-error"></div>
|
||||
<div class=" row hide show-on-success">
|
||||
<div id="interactions-menu" class="row hide">
|
||||
{% include 'interactions/infos.html.j2' %}
|
||||
{% include 'interactions/export.html.j2' %}
|
||||
{% include 'interactions/create.html.j2' %}
|
||||
@ -90,6 +89,13 @@ import {
|
||||
saveQueryData,
|
||||
saveMetaData,
|
||||
} from '../../static/js/modules/corpus_analysis/client/callbacks.js';
|
||||
import {
|
||||
NotificationListener,
|
||||
ResultsList,
|
||||
} from '../../static/js/modules/corpus_analysis/view/ResultsView.js';
|
||||
import {
|
||||
recieveNotification,
|
||||
} from '../../static/js/modules/corpus_analysis/view/listeners.js';
|
||||
|
||||
/**
|
||||
* Second Phase:
|
||||
@ -104,9 +110,11 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
'dynamicMode': true});
|
||||
/**
|
||||
* Initializing the results object as a model holding all the data of a query.
|
||||
* Also holds the metadata of one query.
|
||||
* Also holds the metadata of one query. After that initialize the ResultsList
|
||||
* object as the View handeling the represnetation of the data.
|
||||
*/
|
||||
let results = new Results();
|
||||
let resultsView = new ResultsList('result-list', ResultsList.options);
|
||||
/**
|
||||
* Register listeners listening to socket.io events and their callbacks
|
||||
* Afterwards load them.
|
||||
@ -136,8 +144,17 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
listenForQueryData,
|
||||
listenForMetaData]);
|
||||
client.loadSocketEventListeners();
|
||||
/**
|
||||
* Register resultsView listeners listening to nitification events.
|
||||
*/
|
||||
const listenForNotification = new NotificationListener('notify',
|
||||
recieveNotification);
|
||||
resultsView.setNotificationListeners([listenForNotification]);
|
||||
resultsView.loadNotificationListeners();
|
||||
// Connect client to server
|
||||
client.notifyView('connecting');
|
||||
client.connect();
|
||||
|
||||
// Send a query and recieve its answer data
|
||||
let queryFormElement = document.getElementById('query-form');
|
||||
queryFormElement.addEventListener('submit', (event) => {
|
||||
|
Reference in New Issue
Block a user