#*********************************** * renders the html instant messaging client. * that is included in the header. * * 1) Print some invisible div's containing the messages, status and the roster. The * DIV's have special ID's * 2) Write some links for the top navigation. When clicking the link, overlib displays * the content from the invisible DIV's. The content is fetched from the DIV using * the browsers innerHTML method. ***********************************# ## only proceed if connected to server otherwise nothing is shown #if($imclient.isConnected()) #set ($presence = $imclient.getStatus()) #*********************************** * Message ***********************************#
## single message in queue #if ($imclient.hasMessage() && !$imclient.hasMessages())
## 15px space for help icon #if ($imclient.getMessage().getType().toString() == "normal") $r.translate("im.message.from") $imclient.getMessage().getFrom()
$r.translate("im.message.sendtime") $!imclient.getSendDate()
$r.translate("im.message.subject") $!imclient.getMessage().getSubject()
$imclient.getMessageFormatted($!imclient.getMessage().getBody())

$r.translate("im.message") $r.translate("im.message.delete")
#set ($fromadress = $imclient.parseJid($imclient.getMessage().getFrom())) #if($imclient.getFlashClientIsRunning()) $r.translate("im.message.answer") $r.translate("im.message.answer.linktext") #else $r.translate("im.message.answer") $r.translate("im.message.answer.linktext") #end #elseif ($imclient.getMessage().getType().toString() == "chat") $r.translate("im.message.from") $imclient.getMessage().getFrom()
$r.translate("im.message.sendtime") $!imclient.getSendDate()
$imclient.getMessageFormatted($!imclient.getMessage().getBody())
#set ($fromadress = $imclient.parseJid($imclient.getMessage().getFrom())) #if($imclient.getFlashClientIsRunning())

$r.translate("im.message.answer") $r.translate("im.message.answer.linktext") #else

$r.translate("im.message.answer") $r.translate("im.message.answer.linktext") #end
$r.translate("im.message") $r.translate("im.message.delete") #end
## several messages are in queue for the user #elseif ($imclient.hasMessages())
## 15px space for help icon #if ($imclient.getMessage().getType().toString() == "normal") $r.translate("im.message.from") $imclient.getMessage().getFrom()
$r.translate("im.message.sendtime") $!imclient.getSendDate()
$r.translate("im.message.subject") $!imclient.getMessage().getSubject()
$imclient.getMessageFormatted($!imclient.getMessage().getBody())

$r.translate("im.message") $r.translate("im.message.delete")
#set ($fromadress = $imclient.parseJid($imclient.getMessage().getFrom())) #if($imclient.getFlashClientIsRunning()) $r.translate("im.message.answer") $r.translate("im.message.answer.linktext") #else $r.translate("im.message.answer") $r.translate("im.message.answer.linktext") #end #elseif ($imclient.getMessage().getType().toString() == "chat") ## collect all messges form an other user and display at once #if ($imclient.hasSeveralMessagesOfSameUser($imclient.getMessage().getFrom())) $r.translate("im.message.from") $imclient.getMessage().getFrom()
$r.translate("im.message.sendtime") $!imclient.getSendDate()
#foreach ($singleMessage in $imclient.getMessagesByUsername($imclient.getMessage().getFrom())) $imclient.getMessageFormatted($singleMessage.getBody())
#end #set ($fromadress = $imclient.parseJid($imclient.getMessage().getFrom())) #if($imclient.getFlashClientIsRunning())

$r.translate("im.message.answer") $r.translate("im.message.answer.linktext") #else

$r.translate("im.message.answer") $r.translate("im.message.answer.linktext") #end
$r.translate("im.message") $r.translate("im.message.delete") #else $r.translate("im.message.from") $imclient.getMessage().getFrom()
$r.translate("im.message.sendtime") $!imclient.getSendDate()
$imclient.getMessageFormatted($!imclient.getMessage().getBody())
#set ($fromadress = $imclient.parseJid($imclient.getMessage().getFrom())) #if($imclient.getFlashClientIsRunning())

$r.translate("im.message.answer") $r.translate("im.message.answer.linktext") #else

$r.translate("im.message.answer") $r.translate("im.message.answer.linktext") #end
$r.translate("im.message") $r.translate("im.message.delete") #end #end
#end
#*********************************** * Status changer list ***********************************#
## 15px space for help icon #set ($ri = 0) #foreach($mode in $presencemodes) $r.translate("presence.status.$ri")
#set ($ri = $ri +1) #end
#*********************************** * Buddies roster ***********************************#
## 15px space for help icon #if ($imclient.getShowOfflineBuddies()) $r.translate("im.hide.offline.buddies") #else $r.translate("im.show.offline.buddies") #end
## show or hide groups #if ($imclient.isShowGroupsInRoster()) $r.translate("im.show.groups") #else $r.translate("im.hide.groups") #end

#if (!$imclient.isShowGroupsInRoster()) #foreach ($rosterGroup in $imclient.getRoster())
$rosterGroup.getName() $imclient.buddyCountOnlineForGroup($rosterGroup.getName())
#foreach($entry in $imclient.getRosterGroupEntries($rosterGroup.getName())) #set($entrypresence = $imclient.getUserPresence($entry.getUser())) #if($imclient.getShowOfflineBuddies() || $entrypresence != "offline") #if($imclient.getFlashClientIsRunning()) $!entry.getName()
#else $!entry.getName()
#end #set ($atLeastOne = true) #end #end
#end #else ## show only distinct users without group #foreach ($entry in $imclient.getDistinctRoster()) #set($entrypresence = $imclient.getUserPresence($entry.getUser())) #if($imclient.getShowOfflineBuddies() || $entrypresence != "offline") #if($imclient.getFlashClientIsRunning()) $!entry.getName()
#else $!entry.getName()
#end #set ($atLeastOne = true) #end #end #end #if ($atLeastOne)

#end $othersConnected.countConnectedUsers() $r.translate("im.others.connected")
#*********************************** * Message ***********************************# #if ($imclient.hasMessage()) #if ($imclient.getMessage().getType().toString() == "normal") #elseif ($imclient.getMessage().getType().toString() == "chat") #end #end #*********************************** * Status changer ***********************************# #*********************************** * Buddies ***********************************# $imclient.buddyCountOnline() ## end rendering roster #end