This commit is contained in:
Stephan Porada 2020-04-23 12:07:08 +02:00
parent 191f197b6c
commit d9353e3d7d
2 changed files with 22 additions and 24 deletions

View File

@ -129,8 +129,11 @@ RessourceList.options = {
class ResultsList extends List { class ResultsList extends List {
constructor(idOrElement, options={}) { constructor(idOrElement, options={}) {
super(idOrElement, options); super(idOrElement, options);
this.eventTokens = {}; // all span tokens which are holdeing events if expert mode is on this.eventTokens = {}; // all span tokens which are holdeing events if expert
this.currentExpertTokenElements = {}; // mode is on. Collected here to delete later on
this.currentExpertTokenElements = {}; // all token elements which have added
// classes like chip and hoverable for expert view. Collected
//here to delete later on
} }

View File

@ -277,25 +277,12 @@
// ###### Defining global variables used in other functions ###### // ###### Defining global variables used in other functions ######
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 collapsibleElements; // all collapsibles on site
var contextModal; // Modal to open on inspect for further match context var contextModal; // Modal to open on inspect for further match context
var contextPerItemElement;
var contextSentencesElement;
var displayOptionsData; // Getting form data from display options
var displayOptionsFormElement; // Form holding the display informations
var downloadResultsJSONElement; // button for downloading results as JSON
var expertModeSwitchElement; // Expert mode switch Element var expertModeSwitchElement; // Expert mode switch Element
var exportModal; // Download options modal
var firstPageElement; // first page element of resultsList pagination
var hitsPerPageInputElement;
var initDisplay; // CorpusAnalysisDisplay object first undfined on DOMContentLoaded defined var initDisplay; // CorpusAnalysisDisplay object first undfined on DOMContentLoaded defined
var initDisplayElement; // Element for initialization using initDisplay
var initModal;
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 paginationElements;
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
var queryDisplayElement; // Element for initialization using queryDisplay
var queryFormElement; // the query form var queryFormElement; // the query form
var queryResultsDeterminateElement; // The progress bar for recieved results var queryResultsDeterminateElement; // The progress bar for recieved results
var queryResultsExportElement; // Download button opens download modal var queryResultsExportElement; // Download button opens download modal
@ -307,7 +294,21 @@
var resultsList; // resultsList object var resultsList; // resultsList object
var resultsListOptions; // specifies ResultsList options var resultsListOptions; // specifies ResultsList options
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 xpath; // xpath to grab first resultsList page pagination element
// ###### Defining local scope variables ######
let contextPerItemElement; // Form Element for display option
let contextSentencesElement; // Form Element for display option in inspect
let displayOptionsData; // Getting form data from display options
let displayOptionsFormElement; // Form holding the display informations
let downloadResultsJSONElement; // button for downloading results as JSON
let exportModal; // Download options modal
let firstPageElement; // first page element of resultsList pagination
let hitsPerPageInputElement;
let initDisplayElement; // Element for initialization using initDisplay
let initModal;
let paginationElements;
let queryDisplayElement; // Element for initialization using queryDisplay
let xpath; // xpath to grab first resultsList page pagination element
// ###### Initialize variables ###### // ###### Initialize variables ######
client = undefined; client = undefined;
@ -330,6 +331,8 @@
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");
textLookupCountElement = document.getElementById("text-lookup-count"); textLookupCountElement = document.getElementById("text-lookup-count");
hitsPerPageInputElement = document.getElementById("display-options-form-results_per_page");
contextPerItemElement = document.getElementById("display-options-form-result_context");
// ###### js list options and intialization ###### // ###### js list options and intialization ######
displayOptionsData = ResultsList.getDisplayOptions(displayOptionsFormElement); displayOptionsData = ResultsList.getDisplayOptions(displayOptionsFormElement);
@ -411,20 +414,12 @@
}); });
// live update of hits per page if hits per page value is changed // live update of hits per page if hits per page value is changed
hitsPerPageInputElement = document.getElementById("display-options-form-results_per_page");
let changeHitsPerPageBind = results.resultsList.changeHitsPerPage.bind(results.resultsList); let changeHitsPerPageBind = results.resultsList.changeHitsPerPage.bind(results.resultsList);
hitsPerPageInputElement.onchange = changeHitsPerPageBind; hitsPerPageInputElement.onchange = changeHitsPerPageBind;
// 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 = document.getElementById("display-options-form-result_context");
contextPerItemElement.onchange = results.resultsList.changeContext; contextPerItemElement.onchange = results.resultsList.changeContext;
// live update of context sentences in inspect modal
contextSentencesElement.onchange = (event) => {
let sValue = event.target.value;
console.log(sValue);
}
// eventListener if pagination is used to apply new context size to new page // eventListener if pagination is used to apply new context size to new page
// and also activate inspect match if progress is 100 // and also activate inspect match if progress is 100
for (let element of paginationElements) { for (let element of paginationElements) {