Advertisement
Guest User

Untitled

a guest
Mar 6th, 2012
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Checks if the user is chatbot
  2. if (userName == 'ChatBot'){
  3.     //Places the chatbot avatar in the variable
  4.     var AvatarPic = '<img src="img/chatbot.png"></img> ';
  5. }
  6. //Checks if the user is a guest
  7. else if(userRole == 0){
  8.     var AvatarPic = '<img src="img/guest.png"></img> ';
  9. }
  10. else{
  11.     //Places the UNIQUE user avatar in the variable
  12.     //outcome of this will be:
  13.     //<img title="UniqueUserName" alt="UniqueUserName" src="img/userID.png"></img>
  14.     var AvatarPic = '<img title="'
  15.                 + userName
  16.                 +'" alt="'
  17.                 + userName
  18.                 + '" src="img/'
  19.                 + userID
  20.                 +'.png"></img> ';
  21. }
  22.    
  23.  
  24. //Here is where everything is written to chat          
  25. return  '<div id="'
  26.         + this.getMessageDocumentID(messageID)
  27.         + '" class="'
  28.         + rowClass
  29.         + '">'
  30.         + this.getDeletionLink(messageID, userID, userRole, channelID)
  31.         + dateTime
  32.         //This is where the Avatar Line is inserted (just before the AjaxChat username
  33.         + AvatarPic        
  34.         + '<span class="'
  35.         + userClass
  36.         + '"'
  37.         + this.getChatListUserNameTitle(userID, userName, userRole, ip)
  38.         + ' dir="'
  39.         + this.baseDirection
  40.         + '" onclick="ajaxChat.insertText(this.firstChild.nodeValue);">'
  41.         + userName
  42.         + '</span>'
  43.         + colon
  44.         + this.replaceText(messageText)
  45.         + '</div>';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement