Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nopaque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Looking for advice? Join the
Matrix channel for GitLab users in Bielefeld
!
Show more breadcrumbs
SFB 1288 - INF
nopaque
Commits
9f341b90
Commit
9f341b90
authored
4 years ago
by
Stephan Porada
Browse files
Options
Downloads
Patches
Plain Diff
Some more documentation!
parent
74104922
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
web/app/static/js/nopaque.callbacks.js
+9
-1
9 additions, 1 deletion
web/app/static/js/nopaque.callbacks.js
web/app/templates/corpora/analyse_corpus.html.j2
+27
-25
27 additions, 25 deletions
web/app/templates/corpora/analyse_corpus.html.j2
with
36 additions
and
26 deletions
web/app/static/js/nopaque.callbacks.js
+
9
−
1
View file @
9f341b90
// This callback is called on a socket.on "corpus_analysis_send_meta_data".
// Handels incoming corpus metadata
function
recvMetaData
(
payload
)
{
function
recvMetaData
(
payload
)
{
results
.
metaData
.
init
(
payload
)
results
.
metaData
.
init
(
payload
)
console
.
log
(
results
.
metaData
);
console
.
log
(
results
.
metaData
);
}
}
// This callback is called in socket.on "corpus_analysis_inspect_match" but
// only if the response.type is "sub-results".
// Saves the incoming inspect match results into results.subResultsData.
function
saveSubResultsChoices
(
response
)
{
function
saveSubResultsChoices
(
response
)
{
console
.
log
(
"
Recieve match with context
"
);
console
.
log
(
"
Recieve match with context
"
);
results
.
subResultsData
.
init
();
results
.
subResultsData
.
init
();
...
@@ -28,8 +33,9 @@ function saveSubResultsChoices(response) {
...
@@ -28,8 +33,9 @@ function saveSubResultsChoices(response) {
}
}
// This callback is called on socket.on "query".
// Does some hiding, showing disabling etc.
function
querySetup
(
payload
)
{
function
querySetup
(
payload
)
{
// This is called when a query was successfull
// some hiding and resetting
// some hiding and resetting
let
textarea
=
subResultsIdListElement
.
getElementsByTagName
(
"
textarea
"
)[
0
];
let
textarea
=
subResultsIdListElement
.
getElementsByTagName
(
"
textarea
"
)[
0
];
textarea
.
innerText
=
""
;
textarea
.
innerText
=
""
;
...
@@ -54,6 +60,8 @@ function querySetup(payload) {
...
@@ -54,6 +60,8 @@ function querySetup(payload) {
results
.
data
.
match_count
=
payload
.
match_count
;
results
.
data
.
match_count
=
payload
.
match_count
;
}
}
// This callback is called on socket.on "query_results"
// this handels the incoming result chunks
function
queryRenderResults
(
payload
)
{
function
queryRenderResults
(
payload
)
{
let
resultItems
;
// array of built html result items row element
let
resultItems
;
// array of built html result items row element
// This is called when results are transmitted and being recieved
// This is called when results are transmitted and being recieved
...
...
This diff is collapsed.
Click to expand it.
web/app/templates/corpora/analyse_corpus.html.j2
+
27
−
25
View file @
9f341b90
...
@@ -363,12 +363,14 @@
...
@@ -363,12 +363,14 @@
<script>
<script>
// ###### Defining global variables used in other functions ######
// ###### Defining global variables used in other functions ######
var addToSubResultsElement; // Button to start adding matches to sub-results
var addToSubResultsElement; // Button to start adding matches to sub-results
var addToSubResultsFromInspectElement; // button in inspect mdoal to add this match to the sub results
var client; // CorpusAnalysisClient first undefined on DOMContentLoaded defined
var client; // CorpusAnalysisClient first undefined on DOMContentLoaded defined
var collapsibleElements; // All collapsibleElements on this page
var collapsibleElements; // All collapsibleElements on this page
var contextModal; // Modal to open on inspect for further match context
var contextModal; // Modal to open on inspect for further match context
var data; // full JSON object holding match results
var data; // full JSON object holding match results
var expertModeSwitchElement; // Expert mode switch Element
var expertModeSwitchElement; // Expert mode switch Element
var initDisplay; // CorpusAnalysisDisplay object first undfined on DOMContentLoaded defined
var initDisplay; // CorpusAnalysisDisplay object first undfined on DOMContentLoaded defined
var interactionElements; // Interaction elements and their parameters
var matchCountElement; // Total nr. of matches will be displayed in this element
var matchCountElement; // Total nr. of matches will be displayed in this element
var progress; // global progress value
var progress; // global progress value
var queryDisplay; // CorpusAnalysisDisplay object first undfined on DOMContentLoaded defined
var queryDisplay; // CorpusAnalysisDisplay object first undfined on DOMContentLoaded defined
...
@@ -381,13 +383,11 @@
...
@@ -381,13 +383,11 @@
var results; // results object
var results; // results object
var resultsList; // resultsList object
var resultsList; // resultsList object
var resultsListOptions; // specifies ResultsList options
var resultsListOptions; // specifies ResultsList options
var subResultsCreateElement; // if presses sub results will be created from ids
var subResultsExportElement; // button to download sub results
var subResultsIdListElement; // list showing marked matches for sub corpus creation
var textLookupCountElement // Nr of texts the matches occured in will be shown in this element
var textLookupCountElement // Nr of texts the matches occured in will be shown in this element
var interactionElements; // Interaction elements and their parameters
var textTitlesElement; // matched text titles
var textTitlesElement; // matched text titles
var subResultsIdListElement; // list showing marked matches for sub corpus creation
var subResultsExportElement; // button to download sub results
var subResultsCreateElement; // if presses sub results will be created from ids
var addToSubResultsFromInspectElement; // button in inspect mdoal to add this match to the sub results
// ###### Defining local scope variables ######
// ###### Defining local scope variables ######
let contextPerItemElement; // Form Element for display option
let contextPerItemElement; // Form Element for display option
...
@@ -406,8 +406,9 @@
...
@@ -406,8 +406,9 @@
let xpath; // xpath to grab first resultsList page pagination element
let xpath; // xpath to grab first resultsList page pagination element
// ###### Initialize variables ######
// ###### Initialize variables ######
client = undefined;
addToSubResultsElement = document.getElementById("add-to-sub-results");
addToSubResultsElement = document.getElementById("add-to-sub-results");
addToSubResultsFromInspectElement = document.getElementById("add-to-sub-results-from-inspect");
client = undefined;
collapsibleElements = document.querySelector('.collapsible.expandable');
collapsibleElements = document.querySelector('.collapsible.expandable');
contextModal = document.getElementById("context-modal");
contextModal = document.getElementById("context-modal");
contextPerItemElement = document.getElementById("display-options-form-result_context");
contextPerItemElement = document.getElementById("display-options-form-result_context");
...
@@ -428,12 +429,11 @@
...
@@ -428,12 +429,11 @@
queryResultsProgressElement = document.getElementById("query-results-progress");
queryResultsProgressElement = document.getElementById("query-results-progress");
queryResultsUserFeedbackElement = document.getElementById("query-results-user-feedback");
queryResultsUserFeedbackElement = document.getElementById("query-results-user-feedback");
receivedMatchCountElement = document.getElementById("received-match-count");
receivedMatchCountElement = document.getElementById("received-match-count");
subResultsCreateElement = document.getElementById("sub-results-create-div");
subResultsExportElement = document.getElementById("sub-results-export");
subResultsIdListElement = document.getElementById("sub-results-match-ids-div");
textLookupCountElement = document.getElementById("text-lookup-count");
textLookupCountElement = document.getElementById("text-lookup-count");
textTitlesElement = document.getElementById("text-titles");
textTitlesElement = document.getElementById("text-titles");
subResultsIdListElement = document.getElementById("sub-results-match-ids-div");
subResultsExportElement = document.getElementById("sub-results-export");
subResultsCreateElement = document.getElementById("sub-results-create-div");
addToSubResultsFromInspectElement = document.getElementById("add-to-sub-results-from-inspect");
// ###### js list options and intialization ######
// ###### js list options and intialization ######
displayOptionsData = ResultsList.getDisplayOptions(displayOptionsFormElement);
displayOptionsData = ResultsList.getDisplayOptions(displayOptionsFormElement);
...
@@ -531,8 +531,11 @@
...
@@ -531,8 +531,11 @@
// live update of lr context per item if context value is changed
// live update of lr context per item if context value is changed
contextPerItemElement.onchange = results.jsList.changeContext;
contextPerItemElement.onchange = results.jsList.changeContext;
// stuff that happens in the list table and should also be checked and
// Initialization of interactionElemnts
// updated if the pagination is used
// An interactionElement is an object identifing a switch or button via
// htmlID. Callbacks are set for these elements which will be triggered on
// a pagination interaction by the user or if the status of the element has
// been altered. (Like the switche has ben turned on or off).
interactionElements = new Array();
interactionElements = new Array();
let expertModeInteraction = new InteractionElement("display-options-form-expert_mode");
let expertModeInteraction = new InteractionElement("display-options-form-expert_mode");
expertModeInteraction.setCallback("on",
expertModeInteraction.setCallback("on",
...
@@ -565,18 +568,6 @@
...
@@ -565,18 +568,6 @@
results.jsList)
results.jsList)
interactionElements.push(expertModeInteraction, subResultsInteraction, activateInspectInteraction, changeContextInteraction);
interactionElements.push(expertModeInteraction, subResultsInteraction, activateInspectInteraction, changeContextInteraction);
// eventListener if pagination is used to apply new context size to new page
// and also activate inspect match if progress is 100
// also adds more interaction buttons like add to sub results
for (let element of paginationElements) {
element.addEventListener("click", (event) => {
results.jsList.pageChangeEventInteractionHandler(interactionElements);
});
}
// checks if a change for every interactionElement happens and executes
// checks if a change for every interactionElement happens and executes
// the callbacks accordingly
// the callbacks accordingly
for (let interaction of interactionElements) {
for (let interaction of interactionElements) {
...
@@ -596,8 +587,19 @@
...
@@ -596,8 +587,19 @@
continue
continue
}
}
};
};
// eventListener if pagination is used to apply new context size to new page
// and also activate inspect match if progress is 100
// also adds more interaction buttons like add to sub results
for (let element of paginationElements) {
element.addEventListener("click", (event) => {
results.jsList.pageChangeEventInteractionHandler(interactionElements);
});
}
});
});
// ### Download events and sub-results creation ###
// Add onclick to open download modal when Export Results button is pressed
// Add onclick to open download modal when Export Results button is pressed
queryResultsExportElement.onclick = () => {
queryResultsExportElement.onclick = () => {
exportModal.open();
exportModal.open();
...
@@ -631,7 +633,7 @@
...
@@ -631,7 +633,7 @@
results.data.createSubResultsData();
results.data.createSubResultsData();
}
}
// Add onclick to open download modal when sub
results button is pressed
// Add onclick to open download modal when sub
-
results button is pressed
subResultsExportElement.onclick = () => {
subResultsExportElement.onclick = () => {
exportModal.open();
exportModal.open();
console.log(results.subResultsData);
console.log(results.subResultsData);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment