mozilla/socialapi-demo — pull request #9 by fqueze (2012-12-06 18:54:38+00:00)
Title: Disable the chat input box until the data channel is connected.

Pressing return in the input box submits the form. Submitting the form will reload the HTML document. Something we really don't want. We avoid that by returning false in the onsubmit handler, however that handler is only set when the data channel is connected. Before we have that channel, pressing enter in the textbox currently breaks completely the call.

My first idea to fix this was to add an onsubmit handler returning false during the onload event of the document, but just disabling the textbox is enough, and that's clearner :).