anchor.diff:  }
   
   main() {
  -  ClientChat client = new ClientChat('ws://' + window.location.hostname + 
  -      ':4040/ws');
  -  
  +  ClientChat client = new ClientChat('ws://' + window.location.hostname + ':4040/ws');
  +
     usernameInput
  -    ..focus()
  -    ..onKeyUp.listen((e) {
  -      if (e.keyCode == 13 && !e.ctrlKey) {
  -        usernameBtn.click();
  -      }
  -    });
  -  
  +      ..focus()
  +      ..onKeyUp.listen((e) {
  +        if (e.keyCode == 13 && !e.ctrlKey) {
  +          usernameBtn.click();
  +        }
  +      });
  +
     usernameBtn.onClick.listen((e) {
       if (usernameInput.value.trim().isNotEmpty) {
  -      client.send({"cmd":"setUsername", "arg":usernameInput.value});
  +      client.send({
  +        "cmd": "setUsername",
  +        "arg": usernameInput.value
  +      });
       }
     });
  -  
  +
     msgBtn.onClick.listen((e) {
       if (msgTextarea.value.trim().isNotEmpty) {
         client.sendMsg(msgTextarea.value);
         msgTextarea
  -        ..value = ''
  -        ..focus();
  +          ..value = ''
  +          ..focus();
       }
     });
  -  
  +
     msgTextarea.onKeyUp.listen((e) {
       if (e.keyCode == 13 && !e.ctrlKey) {
         msgBtn.click();
  
positive.code:     ws.onOpen.listen((e) {
        print("Connection OK");
      });
      
      ws.onClose.listen((e) {
        print("Connection CLOSED");
        ParagraphElement wsNotAvail = new ParagraphElement();
        wsNotAvail.text = 'Server offline, impossibile accedere alla chat.';
        wsNotAvail.classes.add("info");
        chatBox.append(wsNotAvail);
        chatBox.scrollTop = chatBox.scrollHeight;
      });
      
      ws.onMessage.listen((e) {
        Map data = JSON.decode(e.data);
        switch(data["cmd"]) {
          case "setUsername":
            username = data["arg"];
            usernameArea.style
              ..visibility = 'hidden'
              ..display = 'none';
            
            msgArea.style
              ..visibility = 'visible'
              ..display = 'inline';
            
            msgTextarea.focus();
            break;
            
          case "msg":
            DivElement messageWrapper = new DivElement();
            ParagraphElement messageP = new ParagraphElement();
            ParagraphElement userHeader = new ParagraphElement();
            userHeader.text = "[" + data["arg"]["timestamp"] + "] " +
                data["arg"]["username"] + " dice: ";
            
            userHeader.classes.add("msgHeader");
            messageP.text = data["arg"]["msg"];
            messageP.classes.add("msg");
            messageWrapper.append(userHeader);
            messageWrapper.append(messageP);
            chatBox.append(messageWrapper);
            chatBox.scrollTop = chatBox.scrollHeight;
            clean();
            break;
            
          case "info":
            ParagraphElement messageP = new ParagraphElement();
            messageP.text = "[" + data["arg"]["timestamp"] + "] " +
                data["arg"]["info"];
            
            messageP.classes.add("info");
            chatBox.append(messageP);
            chatBox.scrollTop = chatBox.scrollHeight;
            clean();
            break;
        }
      });
    }
    
    void send(Map message) {
      ws.send(JSON.encode(message));
    }
    
    void close() {
      ws.close();
    }
    
    sendMsg(String msg) {
      send({"cmd":"sendMsg","arg":{"username": username, "msg": msg}});
    }
    
    void clean() {
      if (max_messages) {
        chatBox.children.removeAt(0);
  
negative.code:   ClientChat(this.url) {
      _init();
    }
  
    void _init() {
      messageCounter = 0;
      max_messages = false;
  