summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorAnton Luka Šijanec <sijanecantonluka@gmail.com>2020-02-24 21:39:34 +0100
committerAnton Luka Šijanec <sijanecantonluka@gmail.com>2020-02-24 21:39:34 +0100
commit504627994841454050ac3b127244cf79e7f45e2f (patch)
treed181b3510ca10958aead0b9de9be9e7798f5185e /js
parentkrneki (diff)
downloadbeziapp-504627994841454050ac3b127244cf79e7f45e2f.tar
beziapp-504627994841454050ac3b127244cf79e7f45e2f.tar.gz
beziapp-504627994841454050ac3b127244cf79e7f45e2f.tar.bz2
beziapp-504627994841454050ac3b127244cf79e7f45e2f.tar.lz
beziapp-504627994841454050ac3b127244cf79e7f45e2f.tar.xz
beziapp-504627994841454050ac3b127244cf79e7f45e2f.tar.zst
beziapp-504627994841454050ac3b127244cf79e7f45e2f.zip
Diffstat (limited to 'js')
-rw-r--r--js/messaging.js13
1 files changed, 13 insertions, 0 deletions
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"]) +
'</div></div></div>';
});
+ 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 += '<br><img src="' + readerEvent.target.result + '" />'; // this is the content!
+ if(document.getElementById("msg-added-image").innerHTML.length > 1) {
+ document.getElementById("msg-added-image").innerHTML += '<img style=width:20mm src="' + readerEvent.target.result + '" />'; // this is the content!
+ } else {
+ document.getElementById("msg-added-image").innerHTML = "<input type=button value='Remove images' class='btn waves-effect waves-light' "
+ +"onclick=additionalstufftoaddtomessage='';document.getElementById('msg-added-image').innerHTML='' /><br>Note: GimB servers don't like large messages, "
+ +"so only very small images may be attached or your message will not be delivered.<br>Attached images:<br><img style=width:20mm "
+ +"src='"+readerEvent.target.result+"' />"; // 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);