Skip to content

Commit ce9113f

Browse files
committed
added more status messages when connecting
1 parent 25659cc commit ce9113f

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

public/draw.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ $(function(){
3030
var cursors = {};
3131

3232
var socket = io.connect();
33+
34+
socket.on('connect', function(){
35+
$('#bigTitle').text('Connected to server');
36+
});
3337

3438
socket.on('moving', function (data) {
3539

@@ -64,13 +68,15 @@ $(function(){
6468

6569
socket.on('drawActionHistory', function(compressedHistory){
6670
var i = 0;
71+
$('#bigTitle').text("Decompressing History...");
6772
var history = lzwCompress.unpack(compressedHistory);
73+
$('#bigTitle').text("Rendering history...");
6874
//offscreen canvas
6975
var osc = document.createElement('canvas');
7076
osc.width = 1600;
7177
osc.height = 1000;
7278
var osctx = osc.getContext('2d');
73-
//history[i].fromX, history[i].fromY, history[i].toX, history[i].toY, history[i].color
79+
7480
for(i = 0; i < history.length; i += 1){
7581
osctx.beginPath();
7682
osctx.strokeStyle = history[i].color;
@@ -81,6 +87,7 @@ $(function(){
8187
}
8288

8389
context.drawImage(osc, 0, 0);
90+
$('#bigTitle').text("Draw anywhere!");
8491

8592
});
8693

views/main.jade

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ html
2121
div#cursors
2222
canvas#paper(width="1900" height="1000") Your browser doesn't support canvas!
2323
hgroup#instructions
24-
h1 Draw anywhere!
25-
h2 You will see everyone else who is doing the same.
26-
h3 Note: Drawings are saved and get redrawn until server reboots!
24+
h1#bigTitle Connecting...
25+
h2 You will see everyone else drawing
26+
h3 Note: Drawings are saved on the server. Come back any time!
2727
div#chatArea
2828
div#settingsPanel
2929
div#settingsPanelTab Settings

0 commit comments

Comments
 (0)