added chat sendbox
parent
a5490b9f28
commit
315e860eff
|
@ -19,6 +19,7 @@
|
||||||
'''
|
'''
|
||||||
import logger
|
import logger
|
||||||
from communicatorutils import proxypicker
|
from communicatorutils import proxypicker
|
||||||
|
import onionrexceptions
|
||||||
import onionrblockapi as block
|
import onionrblockapi as block
|
||||||
from onionrutils import localcommand, stringvalidators, basicrequests
|
from onionrutils import localcommand, stringvalidators, basicrequests
|
||||||
from communicator import onlinepeers
|
from communicator import onlinepeers
|
||||||
|
@ -42,7 +43,11 @@ def upload_blocks_from_communicator(comm_inst):
|
||||||
continue
|
continue
|
||||||
triedPeers.append(peer)
|
triedPeers.append(peer)
|
||||||
url = 'http://' + peer + '/upload'
|
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)
|
proxyType = proxypicker.pick_proxy(peer)
|
||||||
logger.info("Uploading block %s to %s" % (bl[:8], peer), terminal=True)
|
logger.info("Uploading block %s to %s" % (bl[:8], peer), terminal=True)
|
||||||
resp = basicrequests.do_post_request(url, data=data, proxyType=proxyType)
|
resp = basicrequests.do_post_request(url, data=data, proxyType=proxyType)
|
||||||
|
|
|
@ -17,3 +17,17 @@
|
||||||
.connectStatus{
|
.connectStatus{
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.friendsTitle{
|
||||||
|
text-align: center;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chatInput{
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
.chatInput textarea{
|
||||||
|
resize: none;
|
||||||
|
}
|
|
@ -17,6 +17,7 @@
|
||||||
<script defer src='/shared/direct-connections.js'></script>
|
<script defer src='/shared/direct-connections.js'></script>
|
||||||
<script defer src='/chat/js/messages.js'></script>
|
<script defer src='/chat/js/messages.js'></script>
|
||||||
<script defer src='/chat/js/message-feed.js'></script>
|
<script defer src='/chat/js/message-feed.js'></script>
|
||||||
|
<script defer src='/chat/js/resizes.js'></script>
|
||||||
<script defer src='/chat/js/main.js'></script>
|
<script defer src='/chat/js/main.js'></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
@ -84,10 +85,18 @@
|
||||||
|
|
||||||
<div class="columns chatContent">
|
<div class="columns chatContent">
|
||||||
<div class="column has-background-grey-dark has-text-light is-one-fifths content convoListContainer">
|
<div class="column has-background-grey-dark has-text-light is-one-fifths content convoListContainer">
|
||||||
|
<span class='friendsTitle'>Friends</span>
|
||||||
|
<hr>
|
||||||
<ul class='conversationList'></ul>
|
<ul class='conversationList'></ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="column chatBox has-text-light has-background-dark is-four-fifths">
|
<div class="column chatBox has-text-light has-background-dark is-four-fifths">
|
||||||
<span class="chatFeed"></span>
|
<span class="chatFeed"></span>
|
||||||
|
<div class="field has-addons">
|
||||||
|
<p class="control chatInput">
|
||||||
|
<textarea class="textarea" name="message-to-send" id="message-to-send" placeholder="Type your message" rows="1"></textarea>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
let doResize = function(){
|
||||||
|
let chatInput = document.getElementsByClassName('chatInput')[0]
|
||||||
|
chatInput.style.width = "50%";
|
||||||
|
}
|
||||||
|
doResize()
|
||||||
|
window.onresize = doResize
|
Loading…
Reference in New Issue