Mchat with Messenger Function

Guides & Snippets for phpBB3.
Try the Snippets here and share Your own Snippets

Mchat with Messenger Function

Post 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

Post by Fire-Fox »

Thanks you!

Great snippet

Re: Mchat with Messenger Function

Post by Inner Circle »

Thanks Stoker!

Re: Mchat with Messenger Function

Post by Chalong »

Another great feature. :thumb:

Re: Mchat with Messenger Function

Post by testas123 »

do you know how to modify mchat, to show more smileys? (add button, to show more smileys.)

Re: Mchat with Messenger Function

Post by Kynetic »

hum yes it's a good idea to add a button to see "more smileys"... ;)