csrf
This commit is contained in:
parent
d8dc365b03
commit
712532a117
|
|
@ -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,24 +172,28 @@ $(document).ready(function(){
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
function sendNewMessage(){
|
function sendNewMessage()
|
||||||
$.ajax(
|
{
|
||||||
|
if($("#message").val().length > 0)
|
||||||
{
|
{
|
||||||
type: "GET",
|
$.ajax(
|
||||||
url: "{% url 'chat:chat-ajax' %}",
|
|
||||||
data : {
|
|
||||||
action : "addnewmessage",
|
|
||||||
new_chat_userid : userownid,
|
|
||||||
message : $("#message").val(),
|
|
||||||
room : {{roomdata.pk}}
|
|
||||||
},
|
|
||||||
success: function( data )
|
|
||||||
{
|
{
|
||||||
$("#message").val("");
|
type: "GET",
|
||||||
chatwebsocket.send("load__{{user.pk}}__privatechat_{{roomdata.creator.pk}}_{{roomdata.chatmember_single.pk}}");
|
url: "{% url 'chat:chat-ajax' %}",
|
||||||
chatwebsocket.send("stoptyping__{{user.pk}}__privatechat_{{roomdata.creator.pk}}_{{roomdata.chatmember_single.pk}}");
|
data : {
|
||||||
}
|
action : "addnewmessage",
|
||||||
});
|
new_chat_userid : userownid,
|
||||||
|
message : $("#message").val(),
|
||||||
|
room : {{roomdata.pk}}
|
||||||
|
},
|
||||||
|
success: function( data )
|
||||||
|
{
|
||||||
|
$("#message").val("");
|
||||||
|
chatwebsocket.send("load__{{user.pk}}__privatechat_{{roomdata.creator.pk}}_{{roomdata.chatmember_single.pk}}");
|
||||||
|
chatwebsocket.send("stoptyping__{{user.pk}}__privatechat_{{roomdata.creator.pk}}_{{roomdata.chatmember_single.pk}}");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -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 = [
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue