bugfixes
This commit is contained in:
@@ -794,38 +794,11 @@ allFeaturesTextAddBtn.map((value, index) => {
|
||||
var startButton = document.getElementById("start-btn");
|
||||
// start the display
|
||||
startButton.addEventListener("click", () => {
|
||||
|
||||
let opt = getSelected(displayFormats);
|
||||
|
||||
if (opt.includes("Standard")) {
|
||||
var list_el = document.getElementById("display-format");
|
||||
|
||||
let features = getListItems(list_el);
|
||||
fetch("/start", {
|
||||
method: "PUT",
|
||||
body: JSON.stringify(features),
|
||||
});
|
||||
} else if (opt.includes("Professional")) {
|
||||
|
||||
var top_list_el = document.getElementById("display-format");
|
||||
|
||||
let top_features = getListItems(top_list_el);
|
||||
|
||||
|
||||
var bot_list_el = document.getElementById("display-format-2");
|
||||
|
||||
let bot_features = getListItems(bot_list_el);
|
||||
|
||||
|
||||
let features = [top_features, bot_features];
|
||||
|
||||
|
||||
fetch("/start", {
|
||||
method: "PUT",
|
||||
body: JSON.stringify(features),
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
var brightnessButton = document.getElementById("brightness-btn");
|
||||
@@ -913,8 +886,41 @@ dispFormatButton.addEventListener("click", () => {
|
||||
});
|
||||
});
|
||||
|
||||
// saves the feature specific settings
|
||||
function saveSettings() {
|
||||
|
||||
// gets which features are to be displayed
|
||||
function getDisplaying(){
|
||||
let opt = getSelected(displayFormats);
|
||||
|
||||
if (opt.includes("Standard")) {
|
||||
var list_el = document.getElementById("display-format");
|
||||
|
||||
let features = getListItems(list_el);
|
||||
|
||||
return features;
|
||||
} else if (opt.includes("Professional")) {
|
||||
|
||||
var top_list_el = document.getElementById("display-format");
|
||||
|
||||
let top_features = getListItems(top_list_el);
|
||||
|
||||
|
||||
var bot_list_el = document.getElementById("display-format-2");
|
||||
|
||||
let bot_features = getListItems(bot_list_el);
|
||||
|
||||
|
||||
let features = [top_features, bot_features];
|
||||
|
||||
|
||||
return features;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// gets feature specific settings
|
||||
function getFeatureSettings() {
|
||||
|
||||
let featureSelector = document.getElementById("drop");
|
||||
feature = getSelected(featureSelector);
|
||||
|
||||
@@ -973,14 +979,7 @@ function saveSettings() {
|
||||
s = getMessageSettings(page);
|
||||
break;
|
||||
}
|
||||
|
||||
settings = { ...settings, ...s }; // merge both sets of settings
|
||||
|
||||
fetch("/feature_settings", {
|
||||
method: "PUT",
|
||||
body: JSON.stringify(settings),
|
||||
});
|
||||
|
||||
|
||||
//send uploaded images and gifs
|
||||
if (pageNum == 11) {
|
||||
var data = new FormData();
|
||||
@@ -1005,11 +1004,28 @@ function saveSettings() {
|
||||
body: data,
|
||||
});
|
||||
}
|
||||
|
||||
settings = { ...settings, ...s }; // merge both sets of settings
|
||||
|
||||
return settings;
|
||||
}
|
||||
|
||||
let saveSettingsButtons = document
|
||||
.querySelectorAll(".save-btn-div")
|
||||
.forEach((button) => button.addEventListener("click", saveSettings));
|
||||
|
||||
function saveSettings() {
|
||||
|
||||
displaying = getDisplaying();
|
||||
feature_settings = getFeatureSettings();
|
||||
console.log(displaying)
|
||||
fetch("/save", {
|
||||
method: "PUT",
|
||||
body: JSON.stringify({'displaying': displaying, 'feature_settings': feature_settings}),
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
let saveSettingsButtons = document.querySelectorAll(".save-btn-div").forEach((button) => button.addEventListener("click", saveSettings));
|
||||
|
||||
// gets the stock, crypto or forex specific settings
|
||||
function getTradingSettings(page) {
|
||||
|
Reference in New Issue
Block a user