This problem is easily solved, and whenever I get a chance to remember how to do CVS again and sit down and resubmit some fixes, I'll include it.

Add the following to the end of chatblock.js

// check to make sure JS is enabled and functional
if (Drupal.jsEnabled) {

  // add our stuff inside the header of the table
  $(document).ready(function() {
    $('#edit-chatblocktext').focus(function () {
	  // add a keydown event on focus
      $(this).keydown(function (event) {
        // get the event which is browser dependent
        var e = event.which || event.keyCode;
          
        if (e == 13) {
		  var el = document.getElementById('edit-chatblocksubmit');
		  chatblockSend(el);
		  return false;
		}
		else {
		  return true;
		}
	  });
	});
	
    $('#edit-chatblocktext').blur(function () {
	  // get rid of the keydown when we don't need it anymore
	  $(this).unbind('keydown');  
	});
  });
}

Comments

dwees’s picture

Status: Active » Needs review

Fixing some formatting caused by a poor editor:

// check to make sure JS is enabled and functional
if (Drupal.jsEnabled) {

  // add our stuff inside the header of the table
  $(document).ready(function() {
    $('#edit-chatblocktext').focus(function () {
    // add a keydown event on focus
      $(this).keydown(function (event) {
        // get the event which is browser dependent
        var e = event.which || event.keyCode;
          
        if (e == 13) {
          var el = document.getElementById('edit-chatblocksubmit');
          chatblockSend(el);
          return false;
        }
        else {
          return true;
        }
      });
    });
  
    $('#edit-chatblocktext').blur(function () {
      // get rid of the keydown when we don't need it anymore
      $(this).unbind('keydown');  
    });
  });
}
sbart76’s picture

For me it works :-) Thank you!

doitDave’s picture

Status: Needs review » Fixed

Patch modified and implemented. Works.

doitDave’s picture

Assigned: dwees » Unassigned

Status: Fixed » Closed (fixed)

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