From 315e860eff81e93ac98539f39a72f8a7d2caabc7 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Sun, 18 Aug 2019 15:10:28 -0500 Subject: [PATCH] added chat sendbox --- onionr/communicatorutils/uploadblocks.py | 7 ++++++- onionr/static-data/www/chat/css/convos.css | 14 ++++++++++++++ onionr/static-data/www/chat/index.html | 9 +++++++++ onionr/static-data/www/chat/js/resizes.js | 6 ++++++ 4 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 onionr/static-data/www/chat/js/resizes.js diff --git a/onionr/communicatorutils/uploadblocks.py b/onionr/communicatorutils/uploadblocks.py index 0d4bb270..221089e2 100755 --- a/onionr/communicatorutils/uploadblocks.py +++ b/onionr/communicatorutils/uploadblocks.py @@ -19,6 +19,7 @@ ''' import logger from communicatorutils import proxypicker +import onionrexceptions import onionrblockapi as block from onionrutils import localcommand, stringvalidators, basicrequests from communicator import onlinepeers @@ -42,7 +43,11 @@ def upload_blocks_from_communicator(comm_inst): continue triedPeers.append(peer) url = 'http://' + peer + '/upload' - data = {'block': block.Block(bl).getRaw()} + try: + data = {'block': block.Block(bl).getRaw()} + except onionrexceptions.NoDataAvailable: + finishedUploads.append(bl) + break proxyType = proxypicker.pick_proxy(peer) logger.info("Uploading block %s to %s" % (bl[:8], peer), terminal=True) resp = basicrequests.do_post_request(url, data=data, proxyType=proxyType) diff --git a/onionr/static-data/www/chat/css/convos.css b/onionr/static-data/www/chat/css/convos.css index 4e65b76b..24d8a093 100644 --- a/onionr/static-data/www/chat/css/convos.css +++ b/onionr/static-data/www/chat/css/convos.css @@ -16,4 +16,18 @@ .connectStatus{ float: right; +} + +.friendsTitle{ + text-align: center; + display: block; +} + +.chatInput{ + position: fixed; + bottom: 0; + +} +.chatInput textarea{ + resize: none; } \ No newline at end of file diff --git a/onionr/static-data/www/chat/index.html b/onionr/static-data/www/chat/index.html index 2a790be7..a44f8049 100755 --- a/onionr/static-data/www/chat/index.html +++ b/onionr/static-data/www/chat/index.html @@ -17,6 +17,7 @@ + @@ -84,10 +85,18 @@
+ Friends +
    +
    +

    + +

    + +
    diff --git a/onionr/static-data/www/chat/js/resizes.js b/onionr/static-data/www/chat/js/resizes.js new file mode 100644 index 00000000..94fc1ebe --- /dev/null +++ b/onionr/static-data/www/chat/js/resizes.js @@ -0,0 +1,6 @@ +let doResize = function(){ + let chatInput = document.getElementsByClassName('chatInput')[0] + chatInput.style.width = "50%"; +} +doResize() +window.onresize = doResize \ No newline at end of file