The module is coming along really well. Nice work.
Question though. How about binding a jquery listener to the textbox. So if the user press enter the message is send (and alt+enter for a new line)

Comments

Docc’s picture

guess it could look something like this (shift + enter is new line)

$('#edit-chatroom-message-entry-box').keyup(function(e) { 
  var messageText = $('#edit-chatroom-message-entry-box').val();
  if (messageText && e.keyCode == 13 && !e.shiftKey) {
      Drupal.chatroom.postMessage(messageText);
      $('#edit-chatroom-message-entry-box').val('').focus();
   };																								 
});
Anonymous’s picture

Assigned: Unassigned »

yes, i think this is fine. i use pidgin, and i notice that you can use both shift+enter or ctrl+enter to enter a new line, so perhaps we should support both as well?

Docc’s picture

Yeah why not.

It might be a idea to look at the following jquery plugin http://code.google.com/p/js-hotkeys/
It allows easy binding of key combinations. Because i can image there will be some more shortcuts in the future? (maybe even variable) and its only 4.4kb in size.

Anonymous’s picture

looks interesting, but will likely be after the first stable release.

i also want to bring back sound effects via a jquery plugin, so i'll be looking at how to handle adding jquery plugins as (possibly optional) dependencies at that point.

Anonymous’s picture

oh yeah, got any opinions about #629400: make private chats controls easier to use ?

Anonymous’s picture

Status: Active » Fixed

committed, thanks! please reopen if you see any issues.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.