When you don't use the WYSIWIG HTML Editor and you want to insert a smiley in the message, it's position will be at the end of the message. This is really annoying when you're replying to a PM, because the original message will be at the bottom, all smileys end up at the bottom of the message. (i.e. you have to cut&past the smiley-code to get the right position)
In message_form_js.asp change:
replace the AddSmileyIcon function at line 136 with the following code:
JAVASCRIPT wrote:
function AddSmileyIcon(iconCode) { var txtarea = document.frmAddMessage.message; iconCode = ' ' + iconCode + ' '; if (txtarea.createTextRange && txtarea.caretPos) { var caretPos = txtarea.caretPos; caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? iconCode + ' ' : iconCode; txtarea.focus(); } else { txtarea.value += iconCode; txtarea.focus(); } }
// Insert at Claret position. function storeCaret(textEl) { if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate(); } |
In includes/message_form_inc.asp change:
Replace the textarea-code in line 309 with the following code:
HTML wrote:
<textarea name="message" cols="57" rows="12" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);"> |
The file emoticon_smilies.asp also needs a change to function properly, see my post below!!!!
Now smileys will get the right position!
Edited by zjieb