Mchat with Messenger Function

Guides & Snippets for phpBB3. Try the Snippets here and share Your own Snippets
There is no support here! Only Read Access!
Locked
User avatar
Stoker
Site Admin
Site Admin
Posts: 3536
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

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.
Board rules! No PM support
User avatar
Fire-Fox
BBCoder IV
BBCoder IV
Posts: 275
Joined: 22 Mar 2010, 13:24
Location: Denmark

Re: Mchat with Messenger Function

Post by Fire-Fox »

Thanks you!

Great snippet
User avatar
Inner Circle
BBCoder III
BBCoder III
Posts: 107
Joined: 20 Mar 2010, 20:25
Location: Germany
Contact:

Re: Mchat with Messenger Function

Post by Inner Circle »

Thanks Stoker!
User avatar
Chalong
BBCoder II
BBCoder II
Posts: 59
Joined: 06 Mar 2010, 14:03
Location: Pforzheim / Germany
Contact:

Re: Mchat with Messenger Function

Post by Chalong »

Another great feature. :thumb:
Regards Chalong

www.chalong.de
testas123
BBCoder II
BBCoder II
Posts: 13
Joined: 11 Jun 2010, 18:09

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.)
Kynetic
BBCoder II
BBCoder II
Posts: 23
Joined: 27 Apr 2010, 22:13
Contact:

Re: Mchat with Messenger Function

Post by Kynetic »

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