$(function() {
    // When we're using HTTPS, use WSS too.
    var ws_scheme = window.location.protocol == "https:" ? "wss" : "ws";
    var chatsock = new ReconnectingWebSocket(ws_scheme + '://' + window.location.host + "/chat" + window.location.pathname);    
    chatsock.onmessage = function(message) {
        var data = JSON.parse(message.data);
        var chat = $("#chat")
        var ele = $('<tr></tr>')

        ele.append(
            $("<td></td>").text(data.timestamp)
        )
        ele.append(
            $("<td></td>").text(data.handle)
        )
        ele.append(
            $("<td></td>").text(data.message)
        ) 
        chat.append(ele)
    };

    $("#chatform").on("submit", function(event) {
        var message = {
            handle: $('#handle').val(),
            message: $('#message').val(),
            typo: 'Vote'
        }
        chatsock.send(JSON.stringify(message));
        $("#message").val('').focus();
        return false;
    });

    $("#startGame").on("submit", function(event) {
        var message = {
            handle: $('#handle').val(),
            message: 'vote',
            typo: 'startGame'
        }
        chatsock.send(JSON.stringify(message));
        $("#message").val('').focus();
        return false;
    });

    $("#identification").on("submit", function(event) {
        var message = {
            handle: $('#handle').val(),
            message: 'vote',
            typo: 'identification'
        }
        chatsock.send(JSON.stringify(message));
        $("#message").val('').focus();
        return false;
    });

    $("#jugdementView").on("submit", function(event) {
        var message = {
            handle: $('#handle').val(),
            message: 'vote',
            typo: 'judgement'
        }
        chatsock.send(JSON.stringify(message));
        $("#message").val('').focus();
        return false;
    });
    $("#poison").on("submit", function(event) {
        var message = {
            handle: $('#handle').val(),
            message: $('#message').val(),
            typo: 'poison'
        }
        chatsock.send(JSON.stringify(message));
        $("#message").val('').focus();
        return false;
    });

    $("#save").on("submit", function(event) {
        var message = {
            handle: $('#handle').val(),
            message: $('#message').val(),
            typo: 'save'
        }
        chatsock.send(JSON.stringify(message));
        $("#message").val('').focus();
        return false;
    });

    $("#bloom").on("submit", function(event) {
        var message = {
            handle: $('#handle').val(),
            message: 'vote',
            typo: 'save'
        }
        chatsock.send(JSON.stringify(message));
        $("#message").val('').focus();
        return false;
    });

    $("#bloom").on("submit", function(event) {
        var message = {
            handle: $('#handle').val(),
            message: 'vote',
            typo: 'save'
        }
        chatsock.send(JSON.stringify(message));
        $("#message").val('').focus();
        return false;
    });
});

(function my_func() {
    // your code
    var message = {
            handle: 'keepalive',
            message: 'vote',
            typo: 'keepalive'
        }
        chatsock.send(JSON.stringify(message));
        $("#message").val('').focus();
        console.log(1)
        setTimeout( my_func, 30);
     })();
@@ -1,8 +1,199 @@
+var ws_scheme = window.location.protocol == %22https:%22 ? %22wss%22 : %22ws%22;%0Avar chatsock = new ReconnectingWebSocket(ws_scheme + '://' + window.location.host + %22/chat%22 + window.location.pathname);%0A%0A
 $(functi
@@ -243,24 +243,26 @@
 SS too.%0A    
+//
 var ws_schem
@@ -318,24 +318,26 @@
 : %22ws%22;%0A    
+//
 var chatsock
@@ -3298,16 +3298,46 @@
 );%0A%7D);%0A%0A
+consloe.log('hello world');%0A%0A$
 (functio
@@ -3346,24 +3346,24 @@
 my_func() %7B%0A
-
     // your 
@@ -3481,32 +3481,245 @@
 live'%0A        %7D%0A
+        //var ws_scheme = window.location.protocol == %22https:%22 ? %22wss%22 : %22ws%22;%0A        //var chatsock = new ReconnectingWebSocket(ws_scheme + '://' + window.location.host + %22/chat%22 + window.location.pathname);   %0A
         chatsock
@@ -3811,16 +3811,17 @@
 e.log(1)
+;
 %0A       
@@ -3847,16 +3847,16 @@
 c, 30);%0A
-
      %7D)(
@@ -3857,8 +3857,9 @@
    %7D)();
+%0A

fix sharen bug