James Kanjo wrote on 11 Sep 2009 13:08
Aim: To create a chat room powered by Wikidot
Why: That is a really good question. Why would you use a chatroom over a forum discussion? Meh, we'll figure that out later.
Concept: At first I thought this would only be possible with use of AutoSaving in the NewPage module. That is:
[[module ListPages ...]]
Conversations so far
[[/module]]
[[module NewPage category="chat" autosave="partial" ...]]
That way, we can make the chat category automatically redirect to the conversation page (thus refreshing the conversation).
But… damn ! The autosave feature doesn't exist!
So today I decided waste my brainpower trying to create a chatroom despite this. I succeeded at building a proof-of-concept:
Please check it out so we can all work on improving it: Chatroom.Wikidot.com
Features:
- Automatically refreshes the conversation every 30 seconds (twice per minute);
- Refreshing the conversation doesn't disrupt a message you may be in the middle of writing;
- Saving a message automatically refreshes the page;
- The conversation automatically scrolls to the bottom with every refresh;
- Previewing messages looks pretty.
Problem:
The conversation displays the conversation in Ascending order (oldest to newest), so the newest conversations are at the bottom. It only displays 50 messages (I have custom set this). The problem is that the ListPages module can't display the newest 50 pages in ascending order.
More explained, you can only have the newest pages ordered from newest to oldest. What we want is to display the 50 newest pages, but showing the newest page last.
So what do you think? Is it cool?
~ James
Damn cross-domain security errors!
Saving a message no longer automatically refreshes the page. But that's okay, because the conversation gets refreshed within 20 seconds anyway.
I also got rid of the “cancel” button, because it really had no purpose.
Nobody's tried to chat yet? C'mon! Give it a go!
What I think is that you are (a) insane and (b) my kind of insane.
Portfolio
I changed the refresh rate to 2 per minute, then I integrated the minimalistic editor, and I also created a class for the chat messages in the css. This way, previewing a message is much better.
I posted in the chat yesterday instead of here… but,
It's good ! Great work.
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
Very good work James.
Rob
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
Okay, if you've already seen the chatroom, then you were looking at the proof-of-concept version.
I encourage you to return to the Chatroom so that you can see the big changes I've made. Essentially, I put in a nice structure which is explained on the homepage.
Previously, everything was stored in the chat:_template page. This was clumsy, non-user and non-wiki friendly — as most proof-of-concepts start out to be.
Changes include:
That last one means that if you are watching the site, clicking on the links in your email notifications will take you to the chatroom (as opposed to forcing you to create a new message for the conversation).
Feel free to modify the chat-message class in the CSS page, if you want to change the look of the conversation messages.
Whilst it's possible to use forum comments to comment on people's chat messages, it doesn't work well. Because the conversation is ever-refreshing, whatever you have typed before the refresh will be lost after the refresh.
In addition to that problem, forum comments disrupt the page anchor. This means that the conversation doesn't automatically scroll to the bottom of the list — it scrolls to the active comment window.
Thanks guys for your support! But I still can't think of a reason to use a chatroom over a forum…
For me, the difference is one of presence and UI.
I'm thinking that a Comments list and a chatoom could be different visualizations of the same internal structures. While I really like the concept here, it could be a lot simpler to make it work in the Comments module as a user-selected option, or an argument to the module.
Portfolio
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
Today I finally got around to “finishing” the Chatroom project… with impressive results!
Now the chatroom only refreshes when somebody contributes to the conversation ! ! !
And every time somebody writes a new message, a sound is played to notify you* ! ! !
Please visit and say ‘hello’ in the chat interface: Chatroom @ Wikidot
* In Safari, a sound is only played if the Chatroom tab is displayed, or when you switch to the Chatroom tab.
Some ideas:
Portfolio