From 20056230255ec3f901f7571955333a0a50243b2b Mon Sep 17 00:00:00 2001 From: Justin Date: Mon, 25 Sep 2023 22:23:48 +0800 Subject: [PATCH] upload global stocks function added --- static/app.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/static/app.js b/static/app.js index f0d9180..edb7a54 100755 --- a/static/app.js +++ b/static/app.js @@ -3788,6 +3788,27 @@ function uploadStockLogo() { } } +// UPLOAD CUSTOM GLOBAL STOCK LOGO +function uploadGlobalStockLogo() { + const fileInput_globalstocks = document.getElementById("globalstocks-logo-upload-browse"); + if (fileInput_globalstocks.value !== "") { + const globalstock_file = fileInput_globalstocks.files[0]; + const globalstock_upload_msg = document.getElementById("globalstocklogoupload"); + + const formData_globalstocks = new FormData(); + formData_globalstocks.append('file', globalstock_file) + fetch('/upload_globalstocks', { + method: 'POST', + body: formData_globalstocks + }) + globalstock_upload_msg.style.display = "block"; + setTimeout(function hideElement() { + globalstock_upload_msg.style.display = "none"; + }, 5000); + fileInput_globalstocks.value = ""; + } +} + // UPLOAD CUSTOM CRYPTO LOGO function uploadCryptoLogo() { const fileInput_crypto = document.getElementById("crypto-logo-upload-browse");