Enjoy!
- Owen
Add this to chat.html.tpl.php in your theme:
- A good place is right above or below the line for the nick button (the only other <input> element)
- Code: Select all
<input id="<?php echo $prefix; ?>words_submit" type="button" value="Send Message" title="Send Message" onclick="if (!pfc.isconnected) return false; sendbutton();" />
Add this to chat-post.js.tpl.php in your theme:
- Code: Select all
/**
* Put here the JS code to execute just after the pfcClient object instance creation
*/
function sendbutton() {
if (!pfc.isconnected) return false;
pfc.clearError(Array(pfc.el_words));
var w = pfc.el_words;
var wval = w.value;
re = new RegExp("^(/[a-z]+)( (.*)|)");
if (wval.match(re))
{
/* a user command */
cmd = wval.replace(re, '$1');
param = wval.replace(re, '$2');
pfc.handleRequest(cmd, param.substr(0,<?php echo $max_text_len; ?> + pfc.clientid.length));
}
else
{
/* a classic 'send' command*/
pfc.handleRequest('/send', wval.substr(0,<?php echo $max_text_len; ?>));
}
w.value = '';
return false;
}