From 1b9c36a49fa0254a7494abd484e89fdf5ecd922d Mon Sep 17 00:00:00 2001 From: sairajzero Date: Fri, 19 Apr 2019 13:00:38 +0530 Subject: [PATCH] Update v0.9 --- app/app.js | 18 ++++++++++++++---- app/index.html | 15 +++++++++++++-- app/styles.css | 18 ++++++++++++------ 3 files changed, 39 insertions(+), 12 deletions(-) diff --git a/app/app.js b/app/app.js index c1071ea..918b9e9 100644 --- a/app/app.js +++ b/app/app.js @@ -8,7 +8,7 @@ if (!window.indexedDB) { } var contacts = []; -var receiverID,senderID; +var receiverID,senderID,recStat; var selfwebsocket,receiverWebSocket; var privKey; @@ -211,6 +211,14 @@ function convertStringToInt(string){ function userDataStartUp(){ console.log("StartUp"); + + document.getElementById("sendMsgInput").addEventListener("keyup",function(event){ + if(event.keyCode === 13){ + event.preventDefault(); + sendMsg(); + } + }); + getDatafromAPI().then(function (result) { console.log(result); getDatafromIDB().then(function(result){ @@ -238,6 +246,7 @@ function userDataStartUp(){ }).catch(function (error) { console.log(error.message); }); + } function arrayToObject(array){ obj = {}; @@ -610,9 +619,10 @@ function changeReceiver(param){ function receiverStatus(status){ if(status) - document.getElementById('recipient-floID').style.backgroundColor = "#00b300"; + document.getElementById('recipient-status').style.color = "#4CC94C"; else - document.getElementById('recipient-floID').style.backgroundColor = "#ff4d4d"; + document.getElementById('recipient-status').style.color = "#CD5C5C"; + recStat = status; } function getTime(time){ @@ -633,7 +643,7 @@ function sendMsg(){ alert("Select a contact and send message"); return; } - if(receiverWebSocket.readyState !== WebSocket.OPEN){ + if(!recStat){ alert("Recipient is offline! Try again later") return } diff --git a/app/index.html b/app/index.html index 6c25824..5005027 100644 --- a/app/index.html +++ b/app/index.html @@ -23,16 +23,20 @@
+
FLO Whatsapp
created by Ranchimall
+
+ @@ -57,12 +62,14 @@
- Select Contact + O   Select Contact
+
@@ -73,15 +80,19 @@
+
- +
+
diff --git a/app/styles.css b/app/styles.css index a6c0df6..fbb4fac 100644 --- a/app/styles.css +++ b/app/styles.css @@ -106,6 +106,14 @@ body { color: #000; display: block; } + +#recipient-status{ + border-radius: 50%; + background: none; + height: 25px; + width: 25px; + color:white; +} .heading-online { display: none; padding: 0 5px; @@ -388,7 +396,6 @@ body { border-radius: 10px 10px 10px 0; background: #ffffff; font-size: 12px; - text-shadow: 0 1px 1px rgba(0, 0, 0, .2); word-wrap: break-word; display: inline-block; height: auto; @@ -399,11 +406,10 @@ body { float: right; width: auto !important; height: auto; - background: gray; + background: #dcf8c6; border-radius: 10px 10px 0 10px; padding: 4px 10px 7px !important; font-size: 12px; - text-shadow: 0 1px 1px rgba(0, 0, 0, .2); display: inline-block; word-wrap: break-word; } @@ -457,7 +463,7 @@ body { padding: 2px 5px !important; } -.reply-main textarea { +.reply-main input { width: 100%; resize: none; overflow: hidden; @@ -470,7 +476,7 @@ body { font-size: 16px; } -.reply-main textarea:focus { +.reply-main input:focus { outline: none; border: none; text-indent: 5px; @@ -574,7 +580,7 @@ body { .reply-main { padding: 2px 8px !important; } - .reply-main textarea { + .reply-main input { padding: 8px !important; font-size: 18px; }