Updated client documentation

This commit is contained in:
l_samenv
2024-09-10 11:32:24 +02:00
parent 784d3f16fc
commit 601ebf67ee
4 changed files with 67 additions and 29 deletions

View File

@ -96,6 +96,7 @@ function AJAX(addr){
});
}
// arguments are passed like param1=value1&param2=value2...
this.postForm = function(args){
xhr.open("POST", addr, true);
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
@ -241,6 +242,9 @@ let globalControls = (function (){
let datesPopup = undefined;
/**
* Used to add the Dates Popup (initialization + adding it to the DOM)
*/
function loadDatesPopup(){
let graphsContainer = document.getElementsByClassName("graphs-container")[0];
datesPopup = new DatesPopup(graphs.gotoNow, graphs.jumpToDate);
@ -288,6 +292,10 @@ let globalIndicators = (function (){
let menuGraphicsPopup = undefined;
/**
* Defines all the entries in the menu and adds it to the DOM
* @param {*} panel The panel on which to add the menu icon
*/
function loadGraphicsMenu(panel){
menuGraphicsPopup = new MenuPopup();
@ -344,12 +352,18 @@ function loadGraphicsMenu(panel){
let exportPopup = undefined;
/**
* Used to add the export Popup (initialization + adding it to the DOM)
*/
function loadExportPopup(){
let graphsContainer = document.getElementsByClassName("graphs-container")[0];
exportPopup = new ExportPopup(exportCallback);
graphsContainer.appendChild(exportPopup);
}
/**
* Function call when the Export button is clicked in the Export popup
*/
function exportCallback(selectedVariables, startDateTimeMs, endDateTimeMs, nan, binning=null){
let binningParam = "None";
@ -364,6 +378,9 @@ function exportCallback(selectedVariables, startDateTimeMs, endDateTimeMs, nan,
let curvesSettingsPopup = undefined;
/**
* Used to add the curves settings Popup (initialization + adding it to the DOM)
*/
function loadCurvesSettingsPopup(){
let graphsContainer = document.getElementsByClassName("graphs-container")[0];
curvesSettingsPopup = new CurvesSettingsPopup(graphs.applySettingsCallback);
@ -1036,7 +1053,7 @@ let graphs = (function (){
});
}
// Changes the zoom mode icon depending on the current zoom mode
function setInnerZoomMode(){
if (currentZoomMode == 'y') {
globalControls.getControlsMap()[xyKey].changeToAlt();
@ -1046,7 +1063,7 @@ let graphs = (function (){
prevTime = null; // reset zoom speed time
}
// Callbacks
// Toggles the current zoom mode and sets it for each graph
function toggleZoomMode(){
if (currentZoomMode == 'y')
currentZoomMode = 'x';
@ -1241,6 +1258,11 @@ let graphs = (function (){
exportPopup.show(blocks,currentMinTime, currentMaxTime);
}
/**
* Function called when the user configuration needs to be applied.
* Calls the /getvars routes with the userconfiguration and reloads all the graphics
* @param {*} userConfiguration The JSON object representing the user configuration
*/
function applySettingsCallback(userConfiguration){
cursorLine(null);