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 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
- 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.
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?
Start a new sub-thread
page revision: 7, last edited: 19 Oct 2009 14:10