work on chat

master
Kevin Froman 2019-07-27 02:29:16 -05:00
parent faf85c10d2
commit b24c683f5f
7 changed files with 43 additions and 12 deletions

View File

@ -68,3 +68,5 @@ def set_peer_info(peer, key, data):
c.execute('UPDATE peers SET ' + key + ' = ? WHERE id=?', command) c.execute('UPDATE peers SET ' + key + ' = ? WHERE id=?', command)
conn.commit() conn.commit()
conn.close() conn.close()
set_user_info = set_peer_info

View File

@ -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 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') @static_files_bp.route('/board/', endpoint='board')
def loadBoard(): def loadBoard():
return send_from_directory(root + 'board/', "index.html") return send_from_directory(root + 'board/', "index.html")

View File

@ -26,7 +26,7 @@ whitelist_endpoints = ('siteapi.site', 'www', 'staticfiles.onionrhome', 'staticf
'staticfiles.profilesindex', 'staticfiles.profilesindex',
'staticfiles.boardContent', 'staticfiles.sharedContent', 'staticfiles.boardContent', 'staticfiles.sharedContent',
'staticfiles.mail', 'staticfiles.mailindex', 'staticfiles.friends', 'staticfiles.friendsindex', 'staticfiles.mail', 'staticfiles.mailindex', 'staticfiles.friends', 'staticfiles.friendsindex',
'staticfiles.clandestine', 'staticfiles.clandestineIndex') 'staticfiles.chat', 'staticfiles.chatIndex')
class ClientAPISecurity: class ClientAPISecurity:
def __init__(self, client_api): def __init__(self, client_api):

View File

@ -0,0 +1,10 @@
.conversationList li{
list-style: none;
padding-top: 1em;
}
.convoListContainer{
margin-left: 1%;
border-radius: 10px solid black;
min-height: 100%;
}

View File

@ -6,11 +6,12 @@
<!--Mobile responsive--> <!--Mobile responsive-->
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title> <title>
Clandestine Onionr Chat
</title> </title>
<link rel='shortcut icon' type='image/ico' href='/shared/images/favicon.ico'> <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="/shared/main/styles-new.css">
<link rel="stylesheet" href="/chat/css/convos.css">
</head> </head>
<body> <body>
@ -35,7 +36,7 @@
<a class="navbar-item idLink" href="/mail/">Mail</a> <a class="navbar-item idLink" href="/mail/">Mail</a>
<a class="navbar-item idLink" href="/friends/">Friends</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="/board/">Circles</a>
<a class="navbar-item idLink" href="/clandestine/">Clandestine</a> <a class="navbar-item idLink" href="/chat/">Chat</a>
</div> </div>
</div> </div>
</nav> </nav>
@ -47,10 +48,10 @@
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
<h1 class="title"> <h1 class="title">
Clandestine Onionr Chat
</h1> </h1>
<h2 class="subtitle"> <h2 class="subtitle">
Instant messaging Instant Messaging
</h2> </h2>
</div> </div>
<div class="column is-7"> <div class="column is-7">
@ -77,12 +78,16 @@
<br> <br>
<div class='content'> <div class="columns">
<ul class='conversationList'></ul> <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> </div>
<script src='/shared/navbar.js'></script> <script src='/shared/navbar.js'></script>
<script src='/shared/misc.js'></script> <script src='/shared/misc.js'></script>
<script src='/clandestine/js/main.js'></script> <script src='/chat/js/main.js'></script>
</body> </body>
</html> </html>

View File

@ -5,7 +5,7 @@ function createConvoList(){
console.log(friendList) console.log(friendList)
for (friend in friendList){ for (friend in friendList){
var convoEntry = document.createElement('div') var convoEntry = document.createElement('li')
convoEntry.classList.add('convoEntry') convoEntry.classList.add('convoEntry')
convoEntry.setAttribute('data-pubkey', friend) convoEntry.setAttribute('data-pubkey', friend)
convoEntry.innerText = friendList[friend] convoEntry.innerText = friendList[friend]

6
onionr/utils/hastor.py Normal file
View File

@ -0,0 +1,6 @@
import netcontroller
def has_tor():
if netcontroller.tor_binary() is None:
return False
return True