Hope2You
Would you like to react to this message? Create an account in a few clicks or log in to continue.

New chat box! status report

+4
CalebLenox
MichaelReed
Matthew_Anderson
IsaacLenox
8 posters

Page 1 of 2 1, 2  Next

Go down

New chat box! status report Empty New chat box! status report

Post  IsaacLenox Fri Oct 10, 2008 1:55 pm

The new chat box is about 4\10 of the way done with the javascript part
if any1 here knows som javascript, maybe u could help
here it is(the java part, not done wit it though):

Code:

this.init = function() {
   
          // Get the chatter type
   this.chattype = jscript.page.getParameter("chattype");
   
   
   // Get the chatter's name
   this.chatname = jscript.page.getParameter("chatname");
   
   
   // Insert greeting.
   $("spnChatname").innerHTML = this.chatname;
   
   
   // Set a timer to fire to update the timer at the bottom.
   setTimeout(updateDateTime, 0);
   
   
   // Set a timer to look for new messages on the server
   // (once every 2 seconds).
   setTimeout(getMessages, 2000);
   
   
}   // End init().

var updateDateTime = function() {
   
   $("pDateTime").innerHTML = new Date();
   setTimeout(updateDateTime, 1000);
   
   
}   // End updateDateTime().
   
var getMessages = function() {
   
   
   new Ajax("server/chatServer." + chat.serverType, {
      postBody :
         Object.toQueryString(
            { "func" : "getMessages", "chatname" : chat.chatname,
            "lastMessageTime" :chat.lastMessageTime }
         ),
      onComplete : function(inResponse) {
         // Parse JSON response.
         var messageJSON = eval("(" + inResponse.trim() + ")");
         chat.lastMessageTime = messageJSON.lastMessageTime;
         var lines = new Array();
      // Iterate over messages recived.
      for (var i = 0; i < messageJSON.messages.length; i++) {
         var nextMessage = messageJSON.messages[i];
         // Construct a new ChatMessage and add to array.
         var chatMessage = new ChatMessage();
         chatMessage.setTimestamp(nextMessage.timestamp);
         chatMessage.setChatname(nextMessage.chatname);
         chatMessage.setMessage(nextMessage.message);
         line.push(chatMessage);
      }
      // Display new message lines.
      addLines(lines);
   }
   }).request();
   
   
   // Kick off the timer again.
   setTimeout(getMessages, 2000);
   
   
} // End getMessages().
   
var addLines = function(inLines) {
   for (var i = o; i < inLines.length; i++) {
      var message = inLines[i];
      var styleClass = "cssChatterText";
      if (message.getChatname() != chat.chatname) {
         styleClass = "cssSupportText";
      }
      htmlOut = "<div class=\"" + styleClass + "\">" +
         message.getChatname() + " : " +
         message.getMessage() +
         "</div>";
      $("divChat").innerHTML = $("divChat").innerHTML + htmlOut;
   }
} // End addLines().

this.postMessage = function(inLines) {
   
   new Ajax("server/chatServer." + chat.serverType, {
      postBody :
         Object.toQueryString(
            { "func" : "postMessage", "chatname" : chat.chatname,
            "messagetext" : $("postMessage").value }
         )
      }).request();
      $("postMessage").value = "";
      
} // End addPostMessage().

var getChatTranscript = function() {
   
   // Get the text of the chat.
   var chatTranscript = $("divChat").innerHTML;
   
   
   // Now we need to go through the text and remove the HTML components so
   // we are left with nothing but text. Then, for each line, we make sure
   // there's no trailing or leading whitespace, and we build up a string
   // containing all the lines, separated by linebreaks.
   var transcriptLines = chatTranscript.split(">");
   chatTranscript = "";
   for (var i = 0; i < transcriptLines.length; i++) {
      if (transcriptLines[i].toLowerCase().indexOf("</div") != -1) {
         transcriptLines[i] = transcriptLines[i].replace("</div", "");
         transcriptLines[i] = transcriptLines[i].replace("</DIV", "");
         chatTranscript += transcriptLines[i].trim() + "\r\n";
      }
   }
   
   return chatTranscript;
   
} // End getChatTranscript().
IsaacLenox
IsaacLenox
Webmaster
Webmaster

Posts : 100
Join date : 2008-09-24

https://hope2you.forumotion.com

Back to top Go down

New chat box! status report Empty Re: New chat box! status report

Post  Matthew_Anderson Fri Oct 10, 2008 1:57 pm

IsaacLenox wrote:The new chat box is about 4\10 of the way done with the javascript part
if any1 here knows som javascript, maybe u could help
here it is(the java part, not done wit it though):

Code:

this.init = function() {
   
          // Get the chatter type
   this.chattype = jscript.page.getParameter("chattype");
   
   
   // Get the chatter's name
   this.chatname = jscript.page.getParameter("chatname");
   
   
   // Insert greeting.
   $("spnChatname").innerHTML = this.chatname;
   
   
   // Set a timer to fire to update the timer at the bottom.
   setTimeout(updateDateTime, 0);
   
   
   // Set a timer to look for new messages on the server
   // (once every 2 seconds).
   setTimeout(getMessages, 2000);
   
   
}   // End init().

var updateDateTime = function() {
   
   $("pDateTime").innerHTML = new Date();
   setTimeout(updateDateTime, 1000);
   
   
}   // End updateDateTime().
   
var getMessages = function() {
   
   
   new Ajax("server/chatServer." + chat.serverType, {
      postBody :
         Object.toQueryString(
            { "func" : "getMessages", "chatname" : chat.chatname,
            "lastMessageTime" :chat.lastMessageTime }
         ),
      onComplete : function(inResponse) {
         // Parse JSON response.
         var messageJSON = eval("(" + inResponse.trim() + ")");
         chat.lastMessageTime = messageJSON.lastMessageTime;
         var lines = new Array();
      // Iterate over messages recived.
      for (var i = 0; i < messageJSON.messages.length; i++) {
         var nextMessage = messageJSON.messages[i];
         // Construct a new ChatMessage and add to array.
         var chatMessage = new ChatMessage();
         chatMessage.setTimestamp(nextMessage.timestamp);
         chatMessage.setChatname(nextMessage.chatname);
         chatMessage.setMessage(nextMessage.message);
         line.push(chatMessage);
      }
      // Display new message lines.
      addLines(lines);
   }
   }).request();
   
   
   // Kick off the timer again.
   setTimeout(getMessages, 2000);
   
   
} // End getMessages().
   
var addLines = function(inLines) {
   for (var i = o; i < inLines.length; i++) {
      var message = inLines[i];
      var styleClass = "cssChatterText";
      if (message.getChatname() != chat.chatname) {
         styleClass = "cssSupportText";
      }
      htmlOut = "<div class=\"" + styleClass + "\">" +
         message.getChatname() + " : " +
         message.getMessage() +
         "</div>";
      $("divChat").innerHTML = $("divChat").innerHTML + htmlOut;
   }
} // End addLines().

this.postMessage = function(inLines) {
   
   new Ajax("server/chatServer." + chat.serverType, {
      postBody :
         Object.toQueryString(
            { "func" : "postMessage", "chatname" : chat.chatname,
            "messagetext" : $("postMessage").value }
         )
      }).request();
      $("postMessage").value = "";
      
} // End addPostMessage().

var getChatTranscript = function() {
   
   // Get the text of the chat.
   var chatTranscript = $("divChat").innerHTML;
   
   
   // Now we need to go through the text and remove the HTML components so
   // we are left with nothing but text. Then, for each line, we make sure
   // there's no trailing or leading whitespace, and we build up a string
   // containing all the lines, separated by linebreaks.
   var transcriptLines = chatTranscript.split(">");
   chatTranscript = "";
   for (var i = 0; i < transcriptLines.length; i++) {
      if (transcriptLines[i].toLowerCase().indexOf("</div") != -1) {
         transcriptLines[i] = transcriptLines[i].replace("</div", "");
         transcriptLines[i] = transcriptLines[i].replace("</DIV", "");
         chatTranscript += transcriptLines[i].trim() + "\r\n";
      }
   }
   
   return chatTranscript;
   
} // End getChatTranscript().

AHHH IT'S BEAST IZAK!!! affraid affraid affraid
Matthew_Anderson
Matthew_Anderson
Admin
Admin

Posts : 137
Join date : 2008-10-01
Location : What's a location

Back to top Go down

New chat box! status report Empty Re: New chat box! status report

Post  MichaelReed Fri Oct 10, 2008 1:58 pm

cool!

was i supposed to understand that??? Embarassed Embarassed Embarassed
MichaelReed
MichaelReed
Adv Poster
Adv Poster

Posts : 261
Join date : 2008-09-29
Age : 29
Location : Earth, or whatever this place is called....

Back to top Go down

New chat box! status report Empty Re: New chat box! status report

Post  IsaacLenox Fri Oct 10, 2008 2:20 pm

MichaelReed wrote:cool!

was i supposed to understand that??? Embarassed Embarassed Embarassed

if u read a adv javascripting book and understood it and did everything in it, or took a adv javascript class, then yes, but if not then no.
so i suspect no, am i correct?
IsaacLenox
IsaacLenox
Webmaster
Webmaster

Posts : 100
Join date : 2008-09-24

https://hope2you.forumotion.com

Back to top Go down

New chat box! status report Empty Re: New chat box! status report

Post  CalebLenox Fri Oct 10, 2008 6:23 pm

Ummmm... isaac i see some mistakes in that Wink .... i know its not finished yet but its (not to be mean) pretty sloppy. Smile
CalebLenox
CalebLenox
V.I.P

Posts : 94
Join date : 2008-09-26
Age : 31
Location : IN

Back to top Go down

New chat box! status report Empty Re: New chat box! status report

Post  JoshOngley Mon Oct 13, 2008 8:33 pm

but it's not done yet so when it is it will probably rock, depending on what he's gonna change.
JoshOngley
JoshOngley
New Poster
New Poster

Posts : 10
Join date : 2008-09-28
Age : 28
Location : on 200 dollar bills

Back to top Go down

New chat box! status report Empty Re: New chat box! status report

Post  Matthew_Anderson Tue Oct 14, 2008 2:04 pm

well yeah cuz it'z izak of courz it will rock!

i like z's Smile Very Happy Smile
Matthew_Anderson
Matthew_Anderson
Admin
Admin

Posts : 137
Join date : 2008-10-01
Location : What's a location

Back to top Go down

New chat box! status report Empty Re: New chat box! status report

Post  KevinAnderson Tue Oct 14, 2008 3:13 pm

[chatbox ] insert here [/chatbox ]

...that's all I got
KevinAnderson
KevinAnderson
Admin
Admin

Posts : 187
Join date : 2008-10-01
Age : 31
Location : Hyrule

Back to top Go down

New chat box! status report Empty Re: New chat box! status report

Post  IsaacLenox Tue Oct 14, 2008 6:54 pm

lol, tyvm mat Very Happy Very Happy Very Happy
IsaacLenox
IsaacLenox
Webmaster
Webmaster

Posts : 100
Join date : 2008-09-24

https://hope2you.forumotion.com

Back to top Go down

New chat box! status report Empty Re: New chat box! status report

Post  DannyRuesch Fri Oct 17, 2008 3:14 pm

Cool! I can't wait to use it, the old one isn't too good ...
DannyRuesch
DannyRuesch
Adv Poster
Adv Poster

Posts : 134
Join date : 2008-09-29
Location : Somewhere over the rainbow...

Back to top Go down

New chat box! status report Empty Re: New chat box! status report

Post  Matthew_Anderson Tue Oct 21, 2008 2:00 pm

DannyRuesch wrote:Cool! I can't wait to use it, the old one isn't too good ...

yez it iz!!!
Matthew_Anderson
Matthew_Anderson
Admin
Admin

Posts : 137
Join date : 2008-10-01
Location : What's a location

Back to top Go down

New chat box! status report Empty Re: New chat box! status report

Post  KevinAnderson Tue Oct 21, 2008 2:50 pm

It's good and it gets the job done, but there is always room for improvement.
KevinAnderson
KevinAnderson
Admin
Admin

Posts : 187
Join date : 2008-10-01
Age : 31
Location : Hyrule

Back to top Go down

New chat box! status report Empty Re: New chat box! status report

Post  MichaelReed Tue Oct 21, 2008 4:12 pm

improvement is wat izak beasts @!!!!! Razz Razz Razz
MichaelReed
MichaelReed
Adv Poster
Adv Poster

Posts : 261
Join date : 2008-09-29
Age : 29
Location : Earth, or whatever this place is called....

Back to top Go down

New chat box! status report Empty :D i am lost!

Post  natalie Sun Oct 26, 2008 12:03 am

lol....i dunno what any of that stuff is suppose to mean...lol. Suspect and i think that the other chat ma jiger is AWESOMENSS! cheers what heck is worng with it? scratch lol. heehee! i dont get all yall computer nerds....lol JKJKJKJK! really i am JUST TEASING! ok?lol. Laughing *haha?* lol

natalie
Poster
Poster

Posts : 71
Join date : 2008-10-02
Location : PLUTO!!(it is a planet yall, i know these things!)

Back to top Go down

New chat box! status report Empty Re: New chat box! status report

Post  KevinAnderson Tue Oct 28, 2008 1:18 pm

Actually they are nerds...

Wink
KevinAnderson
KevinAnderson
Admin
Admin

Posts : 187
Join date : 2008-10-01
Age : 31
Location : Hyrule

Back to top Go down

New chat box! status report Empty Re: New chat box! status report

Post  Matthew_Anderson Tue Oct 28, 2008 1:29 pm

yeah srry izak but you r a nerd Wink Razz pirat
Matthew_Anderson
Matthew_Anderson
Admin
Admin

Posts : 137
Join date : 2008-10-01
Location : What's a location

Back to top Go down

New chat box! status report Empty Re: New chat box! status report

Post  IsaacLenox Wed Oct 29, 2008 10:31 am

grrrr..r...r.r..r.r..rrr....
jk

















IsaacLenox
IsaacLenox
Webmaster
Webmaster

Posts : 100
Join date : 2008-09-24

https://hope2you.forumotion.com

Back to top Go down

New chat box! status report Empty Re: New chat box! status report

Post  MichaelReed Wed Oct 29, 2008 10:32 am

it tru, but u a cool nerd all da way!!!!!!!!!! geek geek geek
MichaelReed
MichaelReed
Adv Poster
Adv Poster

Posts : 261
Join date : 2008-09-29
Age : 29
Location : Earth, or whatever this place is called....

Back to top Go down

New chat box! status report Empty Re: New chat box! status report

Post  natalie Wed Oct 29, 2008 4:58 pm

haha sry izach..lol. dont be sad get glad! lol! heeheeheeheehehehe Surprised oh and your game was perty neateo even though i didnt understand it! lol1 Wink I love you pig haha!

natalie
Poster
Poster

Posts : 71
Join date : 2008-10-02
Location : PLUTO!!(it is a planet yall, i know these things!)

Back to top Go down

New chat box! status report Empty Re: New chat box! status report

Post  MichaelReed Thu Oct 30, 2008 9:33 pm

the funnestest thing 2 do is 2 fall!!!
ya isaac should keep working on it!!!
MichaelReed
MichaelReed
Adv Poster
Adv Poster

Posts : 261
Join date : 2008-09-29
Age : 29
Location : Earth, or whatever this place is called....

Back to top Go down

New chat box! status report Empty Re: New chat box! status report

Post  IsaacLenox Thu Oct 30, 2008 9:48 pm

im working on a python script so that you can look around with the mouse
IsaacLenox
IsaacLenox
Webmaster
Webmaster

Posts : 100
Join date : 2008-09-24

https://hope2you.forumotion.com

Back to top Go down

New chat box! status report Empty Re: New chat box! status report

Post  MichaelReed Thu Oct 30, 2008 10:22 pm

kewlurz!!!!! that will b so cool!!!! then u need 2 make stuff ta do!!!
MichaelReed
MichaelReed
Adv Poster
Adv Poster

Posts : 261
Join date : 2008-09-29
Age : 29
Location : Earth, or whatever this place is called....

Back to top Go down

New chat box! status report Empty Re: New chat box! status report

Post  natalie Wed Nov 05, 2008 2:06 am

i would be so lost if i tried to do any of the stuff yall are doing...lol. i am barely gettin thru computer class! ackkkkkkkkk! heehee! no jokin!

natalie
Poster
Poster

Posts : 71
Join date : 2008-10-02
Location : PLUTO!!(it is a planet yall, i know these things!)

Back to top Go down

New chat box! status report Empty Re: New chat box! status report

Post  KevinAnderson Wed Nov 05, 2008 2:41 pm

I'm not having trouble with comp sci class but I think I really messed up my zoo somehow...
BTW, Is anyone here going to the 'My Heart in a Suitcase' thingy? I am even though I'm not in the class...
KevinAnderson
KevinAnderson
Admin
Admin

Posts : 187
Join date : 2008-10-01
Age : 31
Location : Hyrule

Back to top Go down

New chat box! status report Empty Re: New chat box! status report

Post  MichaelReed Fri Nov 07, 2008 2:29 pm

?????
ur doi nit and ur not in the class???

u have lotsa time on ur hands!!!! lol

and no, i iz not havin trouble in the comp sci class
MichaelReed
MichaelReed
Adv Poster
Adv Poster

Posts : 261
Join date : 2008-09-29
Age : 29
Location : Earth, or whatever this place is called....

Back to top Go down

New chat box! status report Empty Re: New chat box! status report

Post  Sponsored content


Sponsored content


Back to top Go down

Page 1 of 2 1, 2  Next

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum