work on chat
parent
faf85c10d2
commit
b24c683f5f
|
@ -68,3 +68,5 @@ def set_peer_info(peer, key, data):
|
|||
c.execute('UPDATE peers SET ' + key + ' = ? WHERE id=?', command)
|
||||
conn.commit()
|
||||
conn.close()
|
||||
|
||||
set_user_info = set_peer_info
|
|
@ -24,6 +24,14 @@ static_files_bp = Blueprint('staticfiles', __name__)
|
|||
|
||||
root = os.getcwd() + '/static-data/www/' # should be set to onionr install directory from onionr startup
|
||||
|
||||
@static_files_bp.route('/chat/', endpoint='chatIndex')
|
||||
def chat_index():
|
||||
return send_from_directory(root + 'chat/', "index.html")
|
||||
|
||||
@static_files_bp.route('/chat/<path:path>', endpoint='chat')
|
||||
def load_chat(path):
|
||||
return send_from_directory(root + 'chat/', path)
|
||||
|
||||
@static_files_bp.route('/board/', endpoint='board')
|
||||
def loadBoard():
|
||||
return send_from_directory(root + 'board/', "index.html")
|
||||
|
|
|
@ -26,7 +26,7 @@ whitelist_endpoints = ('siteapi.site', 'www', 'staticfiles.onionrhome', 'staticf
|
|||
'staticfiles.profilesindex',
|
||||
'staticfiles.boardContent', 'staticfiles.sharedContent',
|
||||
'staticfiles.mail', 'staticfiles.mailindex', 'staticfiles.friends', 'staticfiles.friendsindex',
|
||||
'staticfiles.clandestine', 'staticfiles.clandestineIndex')
|
||||
'staticfiles.chat', 'staticfiles.chatIndex')
|
||||
|
||||
class ClientAPISecurity:
|
||||
def __init__(self, client_api):
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
.conversationList li{
|
||||
list-style: none;
|
||||
padding-top: 1em;
|
||||
}
|
||||
|
||||
.convoListContainer{
|
||||
margin-left: 1%;
|
||||
border-radius: 10px solid black;
|
||||
min-height: 100%;
|
||||
}
|
|
@ -6,11 +6,12 @@
|
|||
<!--Mobile responsive-->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>
|
||||
Clandestine
|
||||
Onionr Chat
|
||||
</title>
|
||||
<link rel='shortcut icon' type='image/ico' href='/shared/images/favicon.ico'>
|
||||
<link rel='stylesheet' href='/shared/main/bulma.min.css'>
|
||||
<link rel="stylesheet" href="/shared/main/bulma.min.css">
|
||||
<link rel="stylesheet" href="/shared/main/styles-new.css">
|
||||
<link rel="stylesheet" href="/chat/css/convos.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@ -35,7 +36,7 @@
|
|||
<a class="navbar-item idLink" href="/mail/">Mail</a>
|
||||
<a class="navbar-item idLink" href="/friends/">Friends</a>
|
||||
<a class="navbar-item idLink" href="/board/">Circles</a>
|
||||
<a class="navbar-item idLink" href="/clandestine/">Clandestine</a>
|
||||
<a class="navbar-item idLink" href="/chat/">Chat</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
@ -47,10 +48,10 @@
|
|||
<div class="columns">
|
||||
<div class="column">
|
||||
<h1 class="title">
|
||||
Clandestine
|
||||
Onionr Chat
|
||||
</h1>
|
||||
<h2 class="subtitle">
|
||||
Instant messaging
|
||||
Instant Messaging
|
||||
</h2>
|
||||
</div>
|
||||
<div class="column is-7">
|
||||
|
@ -77,12 +78,16 @@
|
|||
|
||||
<br>
|
||||
|
||||
<div class='content'>
|
||||
<div class="columns">
|
||||
<div class="column has-background-dark has-text-light is-one-fifth content convoListContainer">
|
||||
<ul class='conversationList'></ul>
|
||||
</div>
|
||||
<div class="column chatBox"></div>
|
||||
</div>
|
||||
|
||||
<script src='/shared/navbar.js'></script>
|
||||
<script src='/shared/misc.js'></script>
|
||||
<script src='/clandestine/js/main.js'></script>
|
||||
<script src='/chat/js/main.js'></script>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -5,7 +5,7 @@ function createConvoList(){
|
|||
console.log(friendList)
|
||||
|
||||
for (friend in friendList){
|
||||
var convoEntry = document.createElement('div')
|
||||
var convoEntry = document.createElement('li')
|
||||
convoEntry.classList.add('convoEntry')
|
||||
convoEntry.setAttribute('data-pubkey', friend)
|
||||
convoEntry.innerText = friendList[friend]
|
|
@ -0,0 +1,6 @@
|
|||
import netcontroller
|
||||
|
||||
def has_tor():
|
||||
if netcontroller.tor_binary() is None:
|
||||
return False
|
||||
return True
|
Loading…
Reference in New Issue