Kinky Solutions Code Chat Beta 1.0

Posted March 5, 2007 at 9:36 AM by Ben Nadel

Tags: ColdFusion

Last week, I tried to help three people debug code over AIM (Trillian). If anyone out there has tried to do this, you know that it is a NIGHTMARE! Instant messaging was just not built for programmer-talk. I love helping people debug their code though (as it helps me learn / think as well). And, I don't want to stop doing that. To help come up with a better way to get involved, I have quickly thrown together (thursday / friday night) something I am calling Kinky Solutions Code Chat Beta 1.0.

Code Chat is an AJAX powered web-based IM "client" that has a box for standard "text" messages but the real magic is that it has a box for "code" messages as well. These code messages handle standard "Tabbing" and display quite nicely in the chat history. Take a look at this screen shot:


 
 
 

 
Kinky Solutions Code Chat Beta 1.0  
 
 
 

As you can see, the text and code chat items are formatting specifically for their "type." The code item is actually a PRE tag so that it keeps all the formatting. The code textarea at the bottom of the IM client will actually let you "Tab" characters. It uses JavaScript to catch the TAB key and inserts it rather than tabbing away from the textarea input. I have tested this on IE, FireFox, and Safari (not extensively) and they all seem to handle this nicely.

I am NOT great at AJAX, so I am not sure if the algorithm here is working nicely. I don't know about memory leaks or any of that stuff, so who knows how this will function after being left open for some time.

Right now, you only get to see the chat items that are there for the page load. However, all chat items are getting stored in my database. I have plans to allow search as well as full-transcript downloads. Of course, that is if this thing seems to be useful. If it's just a load of horse poop, then I will just abandon the project and chalk it up to a good AJAX learning experience.

I am not going to sit at my desk with this open (at least not most of the time), as I don't feel the need to hit my server 30 times a minute (AJAX) if no one is there. If you want me to help you debug some code, just hit me up on regular IM and we can open up the Code Chat beta (if you want). But for today, I might leave it open, just to see if anyone has any feedback.

To see it in action, go to:

http://www.bennadel.com/index.cfm?dax=chat

KNOWN BUGS:

  1. Double submit (sometimes).
  2. "+" symbol not showing up.
  3. Focus lost when chat history is updated.



Reader Comments

Mar 5, 2007 at 10:07 AM // reply »
1 Comments

Looks great. Only thing is that plus signs don't get rendered.

I need one of these to work with my partners abroad ;)


Mar 5, 2007 at 10:14 AM // reply »
11,238 Comments

That is so freakin strange! I just tried it and you are right... what the heck is that about?

Maybe that is a URLDecode() issue.


Mar 5, 2007 at 3:30 PM // reply »
33 Comments

This is a nice touch. One question, did you build this on top of a database? I built an IM client once to chat with my girlfriend because all IM clients were blocked at her work, and I just ran it through the application scope. It worked beautifully. I actually made the code into a reusable Javascript API, although I never tested it much...


Mar 5, 2007 at 3:33 PM // reply »
11,238 Comments

@Thomas,

I built it on top of a simple DB table (chat_code). I had thought about running it off of the APPLICATION scope or maybe even XML files... but the DB just felt like the simplest answer.

How did you flush the App variables so they didn't get too big? Just curious.


Mar 5, 2007 at 3:40 PM // reply »
33 Comments

The moment a message was received by the person it was addressed to it was removed from the app scope. In your case it's more difficult because you have a chat room, not an IM program. To be able to remove from the app scope, you'd need to have a mechanism to track if the message has been retrieved by everybody in the room, then you could delete it. But you're fine with the DB table anyway.


Mar 5, 2007 at 4:04 PM // reply »
11,238 Comments

@Thomas,

Technically, nothing in the DB chat should last longer than a minute (very generous). I could always work that way. But, one thing I want to do is make it searchable... which will be great with the DB.


Mar 5, 2007 at 4:11 PM // reply »
33 Comments

No way dude. Searching the application scope would be totally awesome and super practical. Forget the DB! *end of sarcasm* hehehe


Mar 5, 2007 at 4:12 PM // reply »
11,238 Comments

He he :)


Mar 6, 2007 at 5:24 AM // reply »
1 Comments

When "plus bug" will be fixed?


Mar 6, 2007 at 8:30 AM // reply »
11,238 Comments

@Sailor,

The "+" bug has been fixed using the encodeURIComponent() method. The "+" was being decoded as a space in the URL on the ColdFusion side of things.


Post A Comment

Comment Etiquette: Please do not post spam. Please keep the comments on-topic. Please do not post unrelated questions or large chunks of code. And, above all, please be nice to each other - we're trying to have a good conversation here.

Please review the following issues:

Author Name:


Author Email:

Author Website:

Comment:

Supported HTML tags for formatting: <strong>bold</strong>   <em>italic</em>   <code>code</code>







  • Help Wanted - Find Your Next ColdFusion Job
Ben Nadel's Company - Epicenter Consulting Recent Blog Comments
May 19, 2013 at 2:31 PM
My Experience With AngularJS - The Super-heroic JavaScript MVW Framework
It's funny really just how well that image describes the way I would imagine most people that go with angular for some project is. I have had a similar roller-coaster ride with it as well, but not qu ... read »
May 17, 2013 at 7:42 PM
HashKeyCopier - An AngularJS Utility Class For Merging Cached And Live Data
Ben - thanks so much for posting these Angular articles and findings, they've been a huge help towards learning one of the more 'complex' JavaScript frameworks out there (IMO). I have been using Angu ... read »
May 16, 2013 at 5:01 PM
UPDATE: Parsing CSV Data Files In ColdFusion With csvToArray()
Your code was the closest thing I've found to obtaining some direction for converting ISO fields to values that CF can translate properly. Thank you for posting! ... read »
May 15, 2013 at 10:37 PM
Very Simple Pusher And ColdFusion Powered Chat
hi id making plz easy ... read »
May 15, 2013 at 6:07 PM
Making SOAP Web Service Requests With ColdFusion And CFHTTP
Ben, you once again saved my bacon at work. Thank you, thank you, thank you! ... read »
May 15, 2013 at 4:15 PM
What If All User Interface (UI) Data Came In Reports?
@Josh, Thanks! @Ben, I definitely recommend the David West book "Object Thinking" I've been quoting from. It goes deeply into the philosophy and history of OO programming. His breadth ... read »
May 15, 2013 at 11:36 AM
Ask Ben: Print Part Of A Web Page With jQuery
I found this helpfull when you need to keep (refresh) the original parent page after closing the iframe child print dialog (Hoping you're not using a form at this time so it won't submit again): On ... read »
May 14, 2013 at 7:13 PM
What If All User Interface (UI) Data Came In Reports?
@Jonah, If there's any books you'd recommend on the subject of domain modelling, I'd love to hear it. I just downloaded the free PDF of "Domain Driven Design Quickly". Figured I'd give it ... read »
InVision App - Prototyping Made Beautiful With Prototyping Tools