Author: scottbw
Date: Mon Apr 15 14:37:30 2013
New Revision: 1468099
URL: http://svn.apache.org/r1468099
Log:
Fixed input on simplechat to work on Opera Mobile using virtual keyboard. See
WOOKIE-340.
Modified:
wookie/trunk/widgets/simplechat/chat.js
wookie/trunk/widgets/simplechat/index.htm
Modified: wookie/trunk/widgets/simplechat/chat.js
URL:
http://svn.apache.org/viewvc/wookie/trunk/widgets/simplechat/chat.js?rev=1468099&r1=1468098&r2=1468099&view=diff
==============================================================================
--- wookie/trunk/widgets/simplechat/chat.js (original)
+++ wookie/trunk/widgets/simplechat/chat.js Mon Apr 15 14:37:30 2013
@@ -47,12 +47,17 @@ function init() {
///// Send a new message
-function sendMessage() {
- if (isActive){
+function sendMessage(event) {
+ event.preventDefault();
+ try {
+ if (isActive){
var text = dwr.util.getValue("text");
dwr.util.setValue("text", "");
post(username, text, thumbnail);
}
+ } catch (err) {;
+ return false;
+ }
}
function post(user,text,url){
Modified: wookie/trunk/widgets/simplechat/index.htm
URL:
http://svn.apache.org/viewvc/wookie/trunk/widgets/simplechat/index.htm?rev=1468099&r1=1468098&r2=1468099&view=diff
==============================================================================
--- wookie/trunk/widgets/simplechat/index.htm (original)
+++ wookie/trunk/widgets/simplechat/index.htm Mon Apr 15 14:37:30 2013
@@ -27,11 +27,13 @@
<link rel="stylesheet" href="chat.css" type="text/css"/>
</head>
<body onload="init()">
- <div id="chatlog"></div>
+ <div id="chatlog"></div>
+ <form name="chatform" onsubmit="return sendMessage(event);">
<div id="input">
<label for="text">Chat:</label>
- <input id="text" onkeypress="dwr.util.onReturn(event, sendMessage)"/>
+ <input name="text" id="text"/>
</div>
+ </form>
</body>
<!-- fix forIE cashing - must go here even though its in the wrong place
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">