From 504627994841454050ac3b127244cf79e7f45e2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Mon, 24 Feb 2020 21:39:34 +0100 Subject: multiple attached pictures, ability to remove them, storage bar >> msgz --- js/messaging.js | 13 +++++++++++++ pages/messaging.html | 19 ++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/js/messaging.js b/js/messaging.js index ed53880..f5d2e13 100644 --- a/js/messaging.js +++ b/js/messaging.js @@ -272,6 +272,9 @@ function displayData() { filterXSS(element["cas"]["ura"]) + ":" + filterXSS(element["cas"]["minuta"]) + ''; }); + document.getElementById("storage-bar").hidden = false; + document.getElementById("storage-progressbar").style.width = Number(Number(messages.length/120)*100).toFixed(2)+"%"; + document.getElementById("storage-desc").innerHTML = messages.length+"/120 messages "+document.getElementById("storage-progressbar").style.width; } async function sendMessage(recipient_number, subject, body) { @@ -345,6 +348,14 @@ function setupEventListeners() { // here we tell the reader what to do when it's done reading... reader.onload = readerEvent => { additionalstufftoaddtomessage += '
'; // this is the content! + if(document.getElementById("msg-added-image").innerHTML.length > 1) { + document.getElementById("msg-added-image").innerHTML += ''; // this is the content! + } else { + document.getElementById("msg-added-image").innerHTML = "
Note: GimB servers don't like large messages, " + +"so only very small images may be attached or your message will not be delivered.
Attached images:
"; // ravno obratni narekovaji + } M.toast({ html: "Image added as an attachment." }); } } @@ -362,7 +373,9 @@ function setupEventListeners() { document.getElementById("msg-body").value = ""; document.getElementById("full-name").value = ""; document.getElementById("msg-subject").value = ""; + document.getElementById("msg-send").disabled = true; additionalstufftoaddtomessage = ""; + document.getElementById("msg-added-image").innerHTML = ""; }).catch(function (err) { M.toast({ html: "Unable to read directory of people. Message could not be sent." }); console.log(err); diff --git a/pages/messaging.html b/pages/messaging.html index 70f61a9..eaeb962 100644 --- a/pages/messaging.html +++ b/pages/messaging.html @@ -124,10 +124,27 @@ system_update
+

+

+
+ Message storage used in this folder: +
+
+ 0/120 messages 10% +
+
+
+
+

+ You can only have 120 messages per message folder, older messages will not be shown. Remember to delete read and sent + messages regulary to avoid any issues. +

+
+

- \ No newline at end of file + -- cgit v1.2.3