From 9b45ac79e51949169d24f64387f4eb8352028651 Mon Sep 17 00:00:00 2001 From: Holger Trampe Date: Sun, 24 May 2020 10:33:36 +0200 Subject: [PATCH] =?UTF-8?q?Chat=20mit=20BUtton=20f=C3=BCr=20eine=20Person?= =?UTF-8?q?=20FERTIG!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chat/templates/chat/chat_allusers.html | 2 +- chat/templates/chat/chat_content.html | 10 +++--- .../templates/chat/chat_content_basechat.html | 33 +++++++++++------- .../__pycache__/settings.cpython-38.pyc | Bin 4697 -> 4750 bytes digitaleagentur/settings.py | 31 ++++++++-------- users/templates/users/base.html | 5 +-- 6 files changed, 45 insertions(+), 36 deletions(-) diff --git a/chat/templates/chat/chat_allusers.html b/chat/templates/chat/chat_allusers.html index 1edd0ff..973f16c 100644 --- a/chat/templates/chat/chat_allusers.html +++ b/chat/templates/chat/chat_allusers.html @@ -4,7 +4,6 @@ z-index: 999; height: 100%; width: 100%; - border-radius: 50%; } .icon-container { width: 50px; @@ -69,6 +68,7 @@ { $("#dynamicchatwindow_content").html(data); $("#dynamicchatwindow").show(); + localStorage.setItem("basechatid", userid); } }); diff --git a/chat/templates/chat/chat_content.html b/chat/templates/chat/chat_content.html index 942bb3b..766d0d1 100644 --- a/chat/templates/chat/chat_content.html +++ b/chat/templates/chat/chat_content.html @@ -153,11 +153,12 @@ $(document).ready(function(){ }) - + sending = true; function sendNewMessage() { - if($("#message").val().length > 0) + if($("#message").val().length > 0 && sending) { + sending = false; $.ajax( { type: "GET", @@ -173,7 +174,8 @@ $(document).ready(function(){ $("#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}}"); - } + sending = true; + } }); } } @@ -181,7 +183,7 @@ $(document).ready(function(){ $(document).on('keypress',function(e) { if(e.which == 13) { - if($("#message").val().length > 0){ + if($("#message").val().length > 0 && sending){ sendNewMessage(); } } diff --git a/chat/templates/chat/chat_content_basechat.html b/chat/templates/chat/chat_content_basechat.html index 9b23693..db01b59 100644 --- a/chat/templates/chat/chat_content_basechat.html +++ b/chat/templates/chat/chat_content_basechat.html @@ -1,9 +1,9 @@ {% load counter_tag %} @@ -65,7 +71,7 @@ {% if message.author == request.user %}
- +
{{message.sendtime|date:"H:i"}}
@@ -77,7 +83,7 @@ {% else %}
- +
{{message.author.first_name}} {{message.author.last_name}}, {{message.sendtime|date:"H:i"}}
@@ -114,6 +120,7 @@ function closeSingleChat(){ chatwebsocket.close(); $("#dynamicchatwindow").hide(); + localStorage. removeItem("basechatid"); } $(document).ready(function(){ @@ -189,12 +196,13 @@ $(document).ready(function(){ } }) - + var sending = true; function sendNewMessage() - { - if($("#message").val().length > 0) + { + if($("#message").val().length > 0 && sending) { + sending = false; $.ajax( { type: "GET", @@ -210,15 +218,16 @@ $(document).ready(function(){ $("#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}}"); + sending = true; } - }); + }); } } $(document).on('keypress',function(e) { if(e.which == 13) { - if($("#message").val().length > 0){ + if($("#message").val().length > 0 && sending == true){ sendNewMessage(); } } diff --git a/digitaleagentur/__pycache__/settings.cpython-38.pyc b/digitaleagentur/__pycache__/settings.cpython-38.pyc index 362ae6fb10fd29ab5e0ac9173c74cbb0d37486e7..9a54d9780216d52d20c92e9244800fa385b23b8d 100644 GIT binary patch delta 652 zcmX|9%Tg0T6rG-Q5=fZgnE)XWg`gsu08!9Xsf0&DKtM@G;Hp6IjKlCuC6lOe!5>&f z&BjF*vUHta(2WcBy6_XMa_vH!sPw5mr~B0H+h=jVhTjb;nxc3lv1s(m#?XnfN2H*U zRJf@b9%_M?T7|Zu2?|t!X0)KS>NFX(qm4SyPCj&yA3o}YpSsYAE_5S+9s~^+b&Ea$ z^imJ{5IQ-F9~&VG;vVkf0Va{a6s9p_G*B;QsSim*f*UE!A&q$~7~EudSmg$z5Eijy zFf3PPx`an`S>$<)6}`h?q9#+7MV@|Sp@~}-PwKo{=QWcVoCdH?VGtb;;wfDbp{|O3 z4bNx@&*?fgXc(Jx16y=cXS@7^v(6FSeacQ5a-9-I>&}QC#rCO8qj*7M|C|OuI5FsS zOZ2;qmoyFoZV_k#J20_piimUvaz+~3t9j&ArVi{_R=yaIMxmESM(v;6XTNf+hAV3E zz{*F8Rv~8{MWCAtvLsddi=}-2s9;TA6bC7AIQAM7`oWt8N^Xy9E3=jIws~lkv~WM(t9&uUOsnnmG9sSp=Z gh}%C}b_N}s3CR4fo}U@#GP}Sp{+oO4x2@m*0G|A`E&u=k delta 618 zcmY*WOHUI~6rMZWzB?_2(w4VKQ4wtmDv}13@*BAjoOf)1d^0Qic)At2RhM(ZuAH*wac9j z^it>Xm;3?l;I8PUF5JTe3Yf$crZIzA;iqoQQ4i*Y0v{G|AB%W^CBaRGQs+giV?$Q!c+$Y94J4BZPW^aB2WdQ~0lc6~Qq*M` zSFlNg*rKa=Nkh=-8eY+LgYEDSo(5(N-w8Wm*iI^xZ7?|_3!JDl41-4gF@C(3%nb;- zDev7viAG_Ko%8SZir5;o_SRzq!oV|QDTei0Ka>;t@gC>B4GZ zvQV5Ux Bs}BGG diff --git a/digitaleagentur/settings.py b/digitaleagentur/settings.py index b1bcf68..45dae74 100644 --- a/digitaleagentur/settings.py +++ b/digitaleagentur/settings.py @@ -14,38 +14,35 @@ from datetime import datetime, timedelta # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - -############################################## LOCAL ##################################### -BASE_URL = "http://localhost:8000/" +############################################## DEV ##################################### +BASE_URL = "https://dev01.digitale-agentur.com/" CRONAPIKEY = "gCddsaz6NOnE9QbXZM5LasdEk122D" MAILINFOKEY = "jka7sd8iukashdna78skduJAHDsu6dilaksdjba65a68iadbhjak" # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -# Database -# https://docs.djangoproject.com/en/2.2/ref/settings/#databases +# MAIL DEV +EMAIL_HOST = 'smtp.strato.de' +EMAIL_PORT = 587 +EMAIL_USE_TLS = True +EMAIL_HOST_USER = "support@dev01.digitale-agentur.com" +EMAIL_HOST_PASSWORD = "n2xd7emyKZFb6UREzvbintuUIG" +DEFAULT_FROM_EMAIL = "support@dev01.digitale-agentur.com" + # DEV DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', - 'NAME' : 'digitaleagentur', - 'USER' : 'root', - 'PASSWORD' : '', + 'NAME' : 'digitaleagentur_dev01', + 'USER' : 'digitaleagentur_dev01', + 'PASSWORD' : 't3TvtGAOkFHYXdJlUMIu9u3U', 'PORT' : 3306 } } -# MAIL DEV -EMAIL_HOST = 'gymhum.de' -EMAIL_PORT = 587 -EMAIL_USE_TLS = True -EMAIL_HOST_USER = "holger.trampe" -EMAIL_HOST_PASSWORD = "Motte2016_!" -DEFAULT_FROM_EMAIL = "holger.trampe@gymhum.de" - # REDIS REDIS_URL = ("localhost", 6379) -################################################### LOCAL ############################### +############################################## DEV ##################################### diff --git a/users/templates/users/base.html b/users/templates/users/base.html index 80b4e39..de767e8 100644 --- a/users/templates/users/base.html +++ b/users/templates/users/base.html @@ -440,7 +440,7 @@ -