Questions about Timestamp and Font color

17 views
Skip to first unread message

Astor

unread,
Sep 14, 2012, 11:21:02 AM9/14/12
to ajax...@googlegroups.com
Hi,

1) I've seen variables about timestamp formating in config.js but I don't have any timestamp before both chatroom and im messages, and I can't find any variable activating it, did I miss something or is it not implemented yet ?

2) I'm very bad in Javascript, but when trying to find a timestamp function in the source code, I stumbled upon functions regarding changing the font, size and color of texts. But when I'm chatting, either IM or in a chatroom, I don't have any button letting me changing the style of my text, I only have the Emoticon panel. Again, I can't find any variable to activate it, is it possible ?

3) Finally, I noticed a little bug, at least on Google Chrome (I have version 20), When a chatroom window is full and the scrolling bar appear, the windows tries to scroll down to most recent message each time a new message is sent, but it fails and only scroll halfway to the bottom. That's very annoying as each time someone writes on the channel, you go back a few line up and can't see what people are saying, I have to scroll back down.

Best regards and thank you for this awesome chatting system,

Morgan

ajaximrpg

unread,
Sep 14, 2012, 1:30:16 PM9/14/12
to ajax...@googlegroups.com
Hi,

Thank you for posting.

1)  Timestamps were implemented but were removed and I forgot about them (sorry about that).  Originally, message formatting was done client-side and a few other places but, for reasons such as dice-rolling and chatlogs, I moved these to the server side.  If you want to hardcode your server to add timestamps, you can edit the ajax_act.php file to change the format() function of the AjaxActionServer class.  All messages go through the format() function now so, if you want to change the HTML of a message, you change it there.

2)  The font, size and color of text was also removed.  The original implementation was quick-and-dirty and was more of a hack than a feature.  For example, you'd try to put a single word in italics and it'd do the entire message.  However, if you want to type HTML tags into messages to do formatting, you can modify js/im.js in the following way:

Replace:

IM.sendMessage(user, room, message.replace(/&/g, "&amp;").replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\n/g, "<br/>"));

With:

// IM.sendMessage(user, room, message.replace(/&/g, "&amp;").replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\n/g, "<br/>"));
IM.sendMessage(user, room, message.replace(/\n/g, "<br/>"));

With that change, you can type a message like "This is in <i>italics</i>" and it will work.

I'm not sure about reactivating the original implementation.  It might be possible but I didn't put any effort into preserving it because it just wasn't right in my eyes.

3)  I'll have to reproduce the Google bug and make a fix.  Thanks for letting me know.

I do take suggestions and proposed/missing features seriously but it takes quite a while to get around with them.

Let me know if you have more questions or if I can clarify something more.

Dan
----------------
Totally free.  Totally easy.  Totally open.  Play RPGs instantly.

ajaximrpg

unread,
Sep 14, 2012, 1:44:57 PM9/14/12
to ajax...@googlegroups.com
Morgan,

Regarding #3, I tried to reproduce this but failed with Google Chrome version 21.

What operating system are you running on?

Do you have any special settings, like a different default font, changed the default font size or something else?

It's the message sender that experiences the problem, not the message recipient, right?

Is it in a chat room or a person-to-person chat?  (It shouldn't matter but person-to-person is a little flakier.)

Dan
----------------
Totally free.  Totally easy.  Totally open.  Play RPGs instantly.

On Friday, September 14, 2012 8:21:03 AM UTC-7, Astor wrote:

Morgan Hotonnier

unread,
Sep 14, 2012, 2:37:01 PM9/14/12
to ajax...@googlegroups.com
On Fri, Sep 14, 2012 at 7:44 PM, ajaximrpg <ajax...@svexpertise.com> wrote:
> Morgan,
>
> Regarding #3, I tried to reproduce this but failed with Google Chrome
> version 21.
>
> What operating system are you running on?

Windows 7, I'm using a portable version 20 of Google Chrome at work,
that's where I have this issue. indeed it's not bugging on my Chrome
21 at home, don't bother with this bug if it is on such an isolated
version :).

>
> Do you have any special settings, like a different default font, changed the
> default font size or something else?

Anything left as is.

>
> It's the message sender that experiences the problem, not the message
> recipient, right?

Both

>
> Is it in a chat room or a person-to-person chat? (It shouldn't matter but
> person-to-person is a little flakier.)

It was in a chatroom



Thank you a lot for your previous answer, I'll manage to activate the
features by myself with your guidance now that I know where to look.


--
Morgan Hotonnier
Reply all
Reply to author
Forward
0 new messages