From 3580432cd23a8a8e4d732484924c9f00276f6c86 Mon Sep 17 00:00:00 2001 From: Justin Date: Mon, 17 Jul 2023 18:18:07 +0800 Subject: [PATCH] backend stuff for features to display save prompt --- static/app.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/static/app.js b/static/app.js index 2721555..a259f71 100755 --- a/static/app.js +++ b/static/app.js @@ -339,6 +339,7 @@ const addEventonBtns = () => { availableFeatures = document.querySelectorAll("#available-features li"); displayToFormat = document.querySelectorAll("#display-format li"); addEventOnList(); + displaySavePrompt(); } } }); @@ -353,6 +354,7 @@ const addEventonBtns = () => { availableFeatures = document.querySelectorAll("#available-features li"); displayToFormat = document.querySelectorAll("#display-format li"); addEventOnList(); + displaySavePrompt(); } } }); @@ -369,6 +371,7 @@ const addEventonBtns = () => { ); displayToFormat2 = document.querySelectorAll("#display-format-2 li"); addEventOnList(); + displaySavePrompt(); } } }); @@ -385,6 +388,7 @@ const addEventonBtns = () => { ); displayToFormat2 = document.querySelectorAll("#display-format-2 li"); addEventOnList(); + displaySavePrompt(); } } }); @@ -483,6 +487,7 @@ displayincreaseBtn.addEventListener("click", () => { prevElement.innerText = currentText; prevElement.setAttribute("class", "active"); displayItem.setAttribute("class", ""); + displaySavePrompt(); } } }); @@ -500,6 +505,7 @@ displayincreaseBtn2.addEventListener("click", () => { prevElement.innerText = currentText; prevElement.setAttribute("class", "active"); displayItem.setAttribute("class", ""); + displaySavePrompt(); } } }); @@ -517,6 +523,7 @@ displayDecreaseBtn.addEventListener("click", () => { nextElement.innerText = currentText; nextElement.setAttribute("class", "active"); displayItem.setAttribute("class", ""); + displaySavePrompt(); break; } } @@ -534,6 +541,7 @@ displayDecreaseBtn2.addEventListener("click", () => { nextElement.innerText = currentText; nextElement.setAttribute("class", "active"); displayItem.setAttribute("class", ""); + displaySavePrompt(); break; } } @@ -3149,3 +3157,30 @@ function updateCryptoPorftolio() { }, 5000); } } + + + +// SAVE FEATURES TO DISPLAY PROMPT FUNCTIONS +function displaySavePrompt() { + document.getElementById('save-prompt-message').style.display = "block"; +} + +function closeSavePrompt() { + document.getElementById('save-prompt-message').style.display = "none"; +} + +function savePrompt() { + saveSettings(); + document.getElementById('save-prompt-message').style.display = "none"; + setTimeout( + function() { + document.getElementById('saved-msg-feedback').style.display = "block"; + }, 100); + setTimeout( + function() { + document.getElementById('saved-msg-feedback').style.display = "none"; + }, 3000); +} + + +