From a9ea6578432aef503e6720af1cc6ce2761631a27 Mon Sep 17 00:00:00 2001 From: chao-master Date: Thu, 7 Apr 2016 01:56:03 +0100 Subject: [PATCH] migrated project to websockets and python3, added logging and a few other bobs --- client/chat.js | 7 ++- client/demo.html | 2 +- server/rooms.py | 30 ++++++----- server/server.py | 121 ++++++++++++++++++++++++++------------------ server/smartJson.py | 21 +++++++- 5 files changed, 114 insertions(+), 67 deletions(-) mode change 100644 => 100755 server/server.py diff --git a/client/chat.js b/client/chat.js index 3982d36..957476b 100644 --- a/client/chat.js +++ b/client/chat.js @@ -1,4 +1,4 @@ -var chatSocket = new WebSocket("ws://localhost:8000"); +var chatSocket = new WebSocket("ws://"+window.location.hostname+":8000"); $(document).ready(function(){ $("#chatInput").keyup(function (e) { @@ -36,7 +36,9 @@ var messageHandlers = { join:function(msg){ addToChat(msg.client.nick+" has joined "+msg.room.name); $("*[data-show-for]").hide(); - $("*[data-show-for='"+msg.room.type+"']").show(); + for(var i=0;i -