This commit is contained in:
Holger Trampe 2020-05-19 22:03:29 +02:00
parent d8dc365b03
commit 712532a117
3 changed files with 23 additions and 29 deletions

View File

@ -98,15 +98,7 @@
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
function scrollDown(){
//$('#chatmessages').animate({scrollTop: $('#chatmessages').prop("scrollHeight")}, 500);
}
$(document).ready(function(){ $(document).ready(function(){
$('#chatcontentcomplete').scrollTop( $('#chatcontentcomplete').height()*200 ) $('#chatcontentcomplete').scrollTop( $('#chatcontentcomplete').height()*200 )
}); });
@ -127,9 +119,6 @@ $(document).ready(function(){
chatwebsocket = new WebSocket(ws_string+window.location.host+"/ws/chat/{{roomdata.creator.pk}}/{{roomdata.chatmember_single.pk}}/") chatwebsocket = new WebSocket(ws_string+window.location.host+"/ws/chat/{{roomdata.creator.pk}}/{{roomdata.chatmember_single.pk}}/")
} }
chatwebsocket.onmessage = function(e) { chatwebsocket.onmessage = function(e) {
datainfo = e["data"].split("__"); datainfo = e["data"].split("__");
if(datainfo[0] == "starttyping") if(datainfo[0] == "starttyping")
@ -183,7 +172,10 @@ $(document).ready(function(){
}) })
function sendNewMessage(){ function sendNewMessage()
{
if($("#message").val().length > 0)
{
$.ajax( $.ajax(
{ {
type: "GET", type: "GET",
@ -202,6 +194,7 @@ $(document).ready(function(){
} }
}); });
} }
}
$(document).on('keypress',function(e) { $(document).on('keypress',function(e) {

View File

@ -61,6 +61,7 @@ X_FRAME_OPTIONS = 'SAMEORIGIN'
SECRET_KEY = '_qv2t2lmsctjxpbb4rrp=op%_20_hxzonv^mvty1o85c)l$s^q' SECRET_KEY = '_qv2t2lmsctjxpbb4rrp=op%_20_hxzonv^mvty1o85c)l$s^q'
ALLOWED_HOSTS = ['digitale-agentur.com', 'www.digitale-agentur.com', '127.0.0.1', 'localhost', 'dev01.digitale-agentur.com', '10.0.2.2'] ALLOWED_HOSTS = ['digitale-agentur.com', 'www.digitale-agentur.com', '127.0.0.1', 'localhost', 'dev01.digitale-agentur.com', '10.0.2.2']
CSRF_TRUSTED_ORIGINS = ['127.0.0.1', 'localhost']
# Application definition # Application definition
INSTALLED_APPS = [ INSTALLED_APPS = [