Page 1 of 1

Mchat with Messenger Function

Posted: 13 May 2010, 11:16
by Stoker
Mchat with Messenger Function
Written by Stoker

Here on this board I have modified the Mchat with a messenger function.
This means that you can jump to a new line using the keyboard combination SHIFT + ENTER, like when chatting on messenger.

Open mchat_body.html
Find:

Code: Select all

var mChatFocusFix = true;
Add after:

Code: Select all

function foo(e) {
    if (!e.shiftKey && e.keyCode==13) {
        mChat.add();
        if (e.preventDefault) e.preventDefault();
        if (e.stopPropagation) e.stopPropagation();
        e.cancelBubble = true;
        e.returnValue = false;
    }
}
Find:

Code: Select all

<input type="text" tabindex="1" name="message" class="mChatText" id="mChatMessage" />
Replace with:

Code: Select all

<textarea tabindex="1" onkeydown="foo(event)" name="message" id="mChatMessage" class="mChatText"></textarea><br />
Open mchat/mchat_prosilver.css
Find:

Code: Select all

input.mChatText
Replace with:

Code: Select all

textarea.mChatText
Find:

Code: Select all

input.mChatText:hover
Replace with:

Code: Select all

textarea.mChatText:hover
Thats it, upload the changed file and refresh the template.

Re: Mchat with Messenger Function

Posted: 13 May 2010, 22:26
by Fire-Fox
Thanks you!

Great snippet

Re: Mchat with Messenger Function

Posted: 14 May 2010, 01:14
by Inner Circle
Thanks Stoker!

Re: Mchat with Messenger Function

Posted: 15 May 2010, 09:10
by Chalong
Another great feature. :thumb:

Re: Mchat with Messenger Function

Posted: 11 Jun 2010, 21:14
by testas123
do you know how to modify mchat, to show more smileys? (add button, to show more smileys.)

Re: Mchat with Messenger Function

Posted: 11 Jun 2010, 22:06
by Kynetic
hum yes it's a good idea to add a button to see "more smileys"... ;)