Changeset 55
- Timestamp:
- 08/16/07 08:06:05 (17 years ago)
- Location:
- trunk/instant_messenger
- Files:
-
- 28 added
- 14 deleted
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/instant_messenger/controller.php
r20 r55 2 2 // Explode action from cExecuteForm function 3 3 $cExecuteFormReturn = false; 4 if($_POST['_action']) { 4 $returnMode = $_REQUEST['returnMode']; 5 if($_POST['_action']) { 5 6 if($_FILES) { 6 7 $count_files = $_POST['countFiles']; 7 $array_files = array(); 8 for($idx = 1; $idx <= $count_files; $idx++) { 8 $array_files = array(); 9 for($idx = 1; $idx <= $count_files; $idx++) { 9 10 if($_FILES['file_'.$idx] && !$_FILES['file_'.$idx]['error']) 10 $array_files[] = $_FILES['file_'.$idx]; 11 $array_files[] = $_FILES['file_'.$idx]; 11 12 } 12 13 $_POST['FILES'] = $array_files; 13 } 14 } 14 15 list($app,$class,$method) = explode('.',@$_POST['_action']); 15 16 $cExecuteFormReturn = true; … … 17 18 // Explode action from cExecute function 18 19 else if($_GET['action']) 20 { 21 unset($_GET['returnMode']); 19 22 list($app,$class,$method) = explode('.',@$_GET['action']); 23 } 20 24 // NO ACTION 21 25 else 22 26 return $_SESSION['response'] = 'false'; 23 27 24 28 // Load dinamically class file. 25 29 if($app == '$this') … … 27 31 else 28 32 $filename = '../'.$app.'/inc/class.'.$class.'.inc.php'; 29 30 include_once($filename); 31 32 // Create new Object (class loaded). 33 34 include_once($filename); 35 36 // Create new Object (class loaded). 33 37 $obj = new $class; 34 35 // Prepare parameters for execution. 38 39 // Prepare parameters for execution. 36 40 $params = array(); 37 38 // If array $_POST is not null , the submit method is POST. 41 42 // If array $_POST is not null , the submit method is POST. 39 43 if($_POST) { 40 44 $params = $_POST; 41 45 } 42 46 // If array $_POST is null , and the array $_GET > 1, the submit method is GET. 43 else if(count($_GET) > 1) { 47 else if(count($_GET) > 1) { 44 48 array_shift($_GET); 45 49 $params = $_GET; … … 47 51 48 52 $result = array(); 49 50 51 // if params is not empty, then class method with parameters. 53 54 55 // if params is not empty, then class method with parameters. 52 56 if($params) 53 57 $result = $obj -> $method($params); 54 else 58 else 55 59 $result = $obj -> $method(); 56 57 // Return result json string into xml object. 60 61 // Return result json string into xml object. 58 62 if(!$cExecuteFormReturn) 59 63 { 60 encode($result, 'encode'); 61 $result = ( !is_object($result) && !is_array($result) ) ? $result : json_encode($result); 64 $dom = new DOMDocument;//('1.0', 'UTF-8'); 62 65 63 $dom = new DOMDocument;//('1.0', 'UTF-8'); 66 if ( $returnMode == 'JSON') 67 { 68 $root = $dom->appendChild(new DOMElement('retorno')); 69 encode($result, 'encode'); 70 $result = ( !is_object($result) && !is_array($result) ) ? $result : json_encode($result); 64 71 65 $root = $dom->appendChild(new DOMElement('retorno')); 66 $root->appendChild($dom->createCDATASection($result)); 72 $root->appendChild($dom->createCDATASection($result)); 73 } 74 else 75 { 76 $_SESSION['phpgw_info']['instant_messenger']['debug2'] = $result; 77 $dom->loadXML('<retorno>' . utf8_encode($result) . '</retorno>'); 78 } 67 79 80 $dom->normalizeDocument(); 68 81 $retorno = $dom->saveXML(); 69 82 header('Pragma: anytextexeptno-cache', true); 70 header('Content-type: text/xml ');83 header('Content-type: text/xml, charset=UTF-8'); 71 84 print $retorno; 72 85 } -
trunk/instant_messenger/docs/change_log.txt
r33 r55 6 6 27/04/2007 [0.001] 7 7 - Vcard, corrigido para a visualização de caracteres e acentos. 8 10/05/2007 [0.001] 9 - Busca de ids no ldap 10 - O envio de autorização, está dentro do menu do botão direito, quando clicado em cima do 11 nome do contato. 12 - A montagem da lista de contatos é feita direto no elemento da página. 13 - Correção para cadastro dos contatos com acentos. 14 23/05/2007 [0.001] 15 - Na tela de autorização do contato, é mostrado o nome, email e a foto do contato que estão no LDAP 16 - Correção na Hora que aparece ao lado da mensagem. 17 13/06/2007 [0.001] 18 - Criação da opção preferências, onde por padrão ja existem marcadas as opções : Mostrar marcação de tempo e Aviso de 19 Mensagens recebidas => Normal. 8 14/08/2007 9 - Criado script IMManager.php, para conexão com o servidor Jabberd. 10 - Mudança de status, offline, online, ausente,...etc, conforme documentação do xmpp 11 - Novo layout para a troca de mensagens. 12 -
trunk/instant_messenger/inc/class.Ujabber.inc.php
r41 r55 1 1 <?php 2 /************************************************************* 3 * Classe Jabber - Expresso * 4 * ------------------------------------------------------- * 5 * Com Autenticação no Servidor Jabber * 6 * Rodrigo Souza - rodsouza@celepar.pr.gov.br * 7 * Alexandre Correia - alexandrecorreia@celepar.pr.gov.br * 8 *************************************************************/ 9 10 require_once "class.Jabber.inc.php"; 11 require_once "class.db_im.inc.php"; 12 13 class Ujabber extends Jabber 2 3 class Ujabber 14 4 { 15 16 private $server = "localhost"; 17 private $port = "5222"; 18 19 private $username = false; 20 private $password = false; 21 private $resource = false; 22 23 private $jid = false; 24 private $email = ""; 25 private $contacts = ""; 26 27 private $log_error_file = 'erro.log'; 28 29 function __construct() 30 { 31 32 $this->username = $_SESSION['phpgw_info']['instant_messenger']['user']; 33 $this->password = $_SESSION['phpgw_info']['instant_messenger']['passwd']; 34 $this->server = $_SESSION['phpgw_info']['instant_messenger']['name_jabber']; 35 $this->port = $_SESSION['phpgw_info']['instant_messenger']['port_jabber']; 36 $this->resource = $_SESSION['phpgw_info']['instant_messenger']['resource_jabber']; 37 $this->jid = $this->username."@".$this->server . "/" . $this->resource; 38 39 parent :: __construct($this->jid, $this->password, $this->port); 40 41 } 42 43 function __destruct() 44 { 45 parent :: __destruct(); 46 } 47 48 /* 49 * List Users 50 */ 51 52 function list_user() 53 { 54 $contacts = $this->UpdateContacts(); 55 $group_users = array(); 56 $group_nusers = array(); 57 58 for($i=0; $i < count($contacts); $i++){ 59 $group_users[] = strtolower(urldecode($contacts[$i]['group'])).";".urldecode($contacts[$i]['name']).";".$contacts[$i]['jid'].";".$contacts[$i]['subscription'].";".$contacts[$i]['online']; 60 } 61 62 // VCARD - PESSOAL 63 $VCARD_P = $this->getVcard($this->username."@".$this->server); 64 65 $group_nusers[0]['VCARD_FN'] = $VCARD_P[0]['FN']; 66 $group_nusers[0]['VCARD_NICKNAME'] = $VCARD_P[0]['NICKNAME']; 67 $group_nusers[0]['VCARD_ORGNAME'] = $VCARD_P[0]['ORGNAME']; 68 $group_nusers[0]['VCARD_ORGUNIT'] = $VCARD_P[0]['ORGUNIT']; 69 $group_nusers[0]['VCARD_ROLE'] = $VCARD_P[0]['ROLE']; 70 $group_nusers[0]['VCARD_BDAY'] = $VCARD_P[0]['BDAY']; 71 $group_nusers[0]['VCARD_DESC'] = $VCARD_P[0]['DESC']; 72 $group_nusers[0]['VCARD_JID'] = $VCARD_P[0]['JID']; 73 74 unset($VCARD_P); 75 natcasesort($group_users); 76 $i=1; 77 78 // VCARD / CONTATOS - USUARIOS 79 80 foreach($group_users as $tmp){ 81 $aux = explode(";",$tmp); 82 $group_nusers[$i]['group'] = $aux[0]; 83 $group_nusers[$i]['name'] = $aux[1]; 84 $group_nusers[$i]['jid'] = $aux[2]; 85 $group_nusers[$i]['subscription'] = trim($aux[3]); 86 $group_nusers[$i]['online'] = $aux[4]; 87 $aux_jid = explode("@",$aux[2]); 88 89 $VCARD_U = $this->getVcard($aux_jid[0]."@".$this->server); 90 91 $group_nusers[$i]['VCARD_FN'] = $VCARD_U[0]['FN']; 92 $group_nusers[$i]['VCARD_NICKNAME'] = $VCARD_U[0]['NICKNAME']; 93 $group_nusers[$i]['VCARD_ORGNAME'] = $VCARD_U[0]['ORGNAME']; 94 $group_nusers[$i]['VCARD_ORGUNIT'] = $VCARD_U[0]['ORGUNIT']; 95 $group_nusers[$i]['VCARD_ROLE'] = $VCARD_U[0]['ROLE']; 96 $group_nusers[$i]['VCARD_BDAY'] = $VCARD_U[0]['BDAY']; 97 $group_nusers[$i]['VCARD_DESC'] = $VCARD_U[0]['DESC']; 98 $group_nusers[$i]['VCARD_JID'] = $VCARD_U[0]['JID']; 99 100 unset($VCARD_U); 101 $i++; 102 } 103 104 return $group_nusers; 105 } 106 107 /* 108 * Contacts - Update - Add - Remove 109 */ 110 111 function UpdateContacts() 112 { 113 $array_contacts = array(); 114 $array_db = array(); 115 $array_return = array(); 116 117 $this->sendIq('get', 'update1', NULL, NULL, 'jabber:iq:roster'); 118 usleep(50000); 119 $result = $this->readSocketFromServer(); 120 121 if(count($result['iq'][1]['#']['query'][0]['#']['item']) > 0){ 122 $array_contacts = $result['iq'][1]['#']['query'][0]['#']['item']; 123 } 124 125 $j = 0; 126 127 // Consulta no Servidor Jabber; 128 if(count($array_contacts) > 0 ){ 129 for($i=0 ; $i < count($array_contacts); $i++) 130 { 131 $array_return[$j]['subscription'] = $array_contacts[$i]['@']['subscription']; 132 $array_return[$j]['name'] = $array_contacts[$i]['@']['name']; 133 $array_return[$j]['jid'] = $array_contacts[$i]['@']['jid']; 134 $array_return[$j]['group'] = $array_contacts[$i]['#']['group']['0']['#']; 135 $aux_jid = explode("@",$array_return[$j]['jid']); 136 137 $array_return[$j]['online'] = ($this->Last_access_User(trim($aux_jid[0]."@".$this->server))) ? 1:0; 138 $j++; 139 } 140 } 141 142 // Consulta no Bd Postgres; 143 $db_im = new db_im(); 144 $array_db = $db_im->get_contacts_im(NULL,$this->jid); 145 146 if(count($array_db) > 0 ) 147 { 148 for($i=0 ; $i < count($array_db); $i++) 149 { 150 $array_return[$j]['subscription'] = 'to'; 151 $array_return[$j]['name'] = $array_db[$i]['im_from']; 152 $array_return[$j]['jid'] = $array_db[$i]['im_from']; 153 $array_return[$j]['group'] = 'sem_grupo'; 154 $array_return[$j]['online'] = 0; 155 $j++; 156 } 157 } 158 return $array_return; 159 } 160 161 function AddNewContacts($pUser) 162 { 163 $jid = explode("@",$pUser['email']); 164 $pJid = $jid[0]."@".$this->server; 165 $pName = $pUser['name']; 166 $pGroup = $pUser['group']; 167 168 if(trim($jid[0]) != trim($this->username)){ 169 $addid = ( $addid ) ? $addid : "adduser_" . time(); 170 if ( $pJid ) 171 { 172 $newcontact = "<item jid='$pJid'"; 173 $newcontact .= ($pName) ? " name='" . urlencode($pName) . "'" : ''; 174 $newcontact .= (($pGroup) ? "><group>" . urlencode($pGroup) . "</group>\n</item" : "/") . ">"; 175 176 if($this->sendIq('set', $addid, NULL, NULL, "jabber:iq:roster", $newcontact)){ 177 // Bd; 178 $db_im = new db_im(); 179 if($db_im->delete_contacts($pJid,$this->jid)){ 180 $this->Subscribe($pJid); 181 } 182 $this->AcceptRequest($request = array("jid" => $pJid,"subscription" => $pUser['subscription'])); 183 return true; 184 }else{ 185 return false; 186 } 187 } 188 else 189 { 190 $this->writeLog("ERROR: RosterAddUser() #1"); 191 return false; 192 } 193 }else{ 194 return false; 195 } 196 } 197 198 function UpdateUser($pUser) 199 { 200 $pJid = $pUser['jid']; 201 $pName = $pUser['name']; 202 $pGroup = $pUser['group']; 203 204 $upid = ( $upid ) ? $upid : "updateuser_" . time(); 205 206 if ( $pJid ) 207 { 208 $updatecontact = "<item jid='$pJid'"; 209 $updatecontact .= ($pName) ? " name='" . urlencode($pName) . "'" : ''; 210 $updatecontact .= (($pGroup) ? "><group>" . urlencode($pGroup) . "</group>\n</item" : "/") . ">"; 211 212 if($this->sendIq('set', $upid, NULL, NULL, "jabber:iq:roster", $updatecontact)){ 213 return true; 214 }else{ 215 return false; 216 } 217 } 218 else 219 { 220 $this->writeLog("ERROR: RosterUpdateUser() #1"); 221 return false; 222 } 223 } 224 225 function RosterRemoveUser($pUser) 226 { 227 $pJid = $pUser['jid']; 228 $pId = 'deluser_' . time(); 229 230 if ($pJid && $pId) 231 { 232 $db_im = new db_im(); 233 $db_im->delete_contacts($pJid,$this->jid); 234 if(!$this->sendIq('set',$pId,NULL,NULL,"jabber:iq:roster","<item jid='$pJid' subscription='remove'/>")){ 235 return false; 236 } 237 return true; 238 }else{ 239 $this->writeLog("ERROR: RosterRemoveUser() #1"); 240 return false; 241 } 242 } 243 244 /* 245 * Vcard 246 */ 247 248 function getVcard($pJid) 249 { 250 $array_vcard = array(); 251 $id_n = explode("@",$pJid); 252 $id = $id_n[0]; 253 254 $this->sendIq('get',$id,$pJid,NULL,"vcard-temp","<vCard xmlns='vcard-temp'/>"); 255 usleep(50000); 256 $result = $this->readSocketFromServer(); 257 258 if( trim($result['iq'][0]['@']['type']) === trim("result") ){ 259 260 $arr = $result['iq'][0]['#']['vCard'][0]['#']; 261 262 // vCard 263 $array_vcard[0]['FN'] = urldecode($arr['FN']['0']['#']); 264 $array_vcard[0]['NICKNAME'] = urldecode($arr['NICKNAME']['0']['#']); 265 $array_vcard[0]['ORGNAME'] = urldecode($arr['ORG']['0']['#']['ORGNAME']['0']['#']); 266 $array_vcard[0]['ORGUNIT'] = urldecode($arr['ORG']['0']['#']['ORGUNIT']['0']['#']); 267 $array_vcard[0]['ROLE'] = urldecode($arr['ROLE']['0']['#']); 268 $array_vcard[0]['BDAY'] = urldecode($arr['BDAY']['0']['#']); 269 $array_vcard[0]['DESC'] = urldecode($arr['DESC']['0']['#']); 270 $array_vcard[0]['JID'] = $pJid; 271 272 }else{ 273 $array_vcard[0]['FN'] = $pJid; 274 $array_vcard[0]['NICKNAME'] = $id; 275 $array_vcard[0]['ORGNAME'] = ""; 276 $array_vcard[0]['ORGUNIT'] = ""; 277 $array_vcard[0]['ROLE'] = ""; 278 $array_vcard[0]['BDAY'] = ""; 279 $array_vcard[0]['DESC'] = ""; 280 $array_vcard[0]['JID'] = $pJid; 281 } 282 283 return $array_vcard; 284 } 285 286 function newVcard($pVcard_User) 287 { 288 $pVcard = explode(";",$pVcard_User['vcard']); 289 $nid = explode("@",$this->jid); 290 $id = $nid[0]; 291 $xmlVcard = ""; 292 293 // Vcard 294 $xmlVcard = "<iq id='$id' type='set'>"; 295 $xmlVcard .= "<vCard xmlns='vcard-temp'>"; 296 $xmlVcard .= "<FN>".urlencode($pVcard[0])."</FN>"; 297 $xmlVcard .= "<NICKNAME>".urlencode($pVcard[1])."</NICKNAME>"; 298 $xmlVcard .= "<ORG>"; 299 $xmlVcard .= "<ORGNAME>".urlencode($pVcard[2])."</ORGNAME>"; 300 $xmlVcard .= "<ORGUNIT>".urlencode($pVcard[3])."</ORGUNIT>"; 301 $xmlVcard .= "</ORG>"; 302 $xmlVcard .= "<ROLE>".urlencode($pVcard[4])."</ROLE>"; 303 $xmlVcard .= "<BDAY>".urlencode($pVcard[5])."</BDAY>"; 304 $xmlVcard .= "<DESC>".urlencode($pVcard[6])."</DESC>"; 305 $xmlVcard .= "</vCard></iq>"; 306 307 if(!$this->SendPacket($xmlVcard)) 308 return false; 309 return true; 310 311 } 312 313 /* 314 * getMessage 315 */ 316 317 function getMessages() 318 { 319 $this->presence(); 320 321 $this->sendIq('get','roster',NULL,NULL,"jabber:x:offline"); 322 $array_return1 = $this->readSocketFromServer(); 323 324 $array_message = array(); 325 $j = 0; 326 for($i=0; $i < count($array_return1['message']); $i++) 327 { 328 $array_message[$j]['from'] = $array_return1['message'][$i]['@']['from']; 329 $array_message[$j]['to'] = $array_return1['message'][$i]['@']['to']; 330 $array_message[$j]['body'] = urldecode(($array_return1['message'][$i]['#']['body'][0]['#'])); 331 $time = explode("T",$array_return1['message'][$i]['#']['x'][0]['@']['stamp']); 332 $h = substr($time[1],0,2); 333 $m = substr($time[1],3,2); 334 $s = substr($time[1],6,2); 335 // Carregando a hora; 336 $array_message[$j]['timestamp'] = ($h - 4 ).":".$m.":".$s; 337 $j++; 338 } 339 340 return $array_message; 341 } 342 343 function SendMessage($pSendMessage) 344 { 345 $to = $pSendMessage['to']; 346 $type = "normal"; 347 $id = ""; 348 $content = array( 349 "subject" => $pSendMessage['subject'] ? $pSendMessage['subject'] : "", 350 "thread" => $pSendMessage['thread'] ? $pSendMessage['thread'] : "", 351 "body" => $pSendMessage['body'] ? urlencode((trim(preg_replace('/^<br>|<br>$/', '', $pSendMessage['body'])))) : "" 352 ); 353 $payload = ""; 354 355 if ($to && is_array($content)) 356 { 357 if (!$id) 358 { 359 $id = $type . "_" . time(); 360 } 361 362 $xml = "<message to='$to' type='$type' id='$id'>\n"; 363 364 if ($content['subject']) 365 { 366 $xml .= "<subject>" . $content['subject'] . "</subject>\n"; 367 } 368 369 if ($content['thread']) 370 { 371 $xml .= "<thread>" . $content['thread'] . "</thread>\n"; 372 } 373 374 $xml .= "<body>" . $content['body'] . "</body>\n"; 375 $xml .= $payload; 376 $xml .= "</message>\n"; 377 unset($id); 378 379 if ($this->SendPacket($xml)) 380 { 381 return TRUE; 382 } 383 else 384 { 385 $this->writeLog("ERROR: SendMessage() #1"); 386 return FALSE; 387 } 388 } 389 else 390 { 391 $this->writeLog("ERROR: SendMessage() #2"); 392 return FALSE; 393 } 394 } 395 396 /* 397 * Log - 398 */ 399 400 401 /* 402 * Verifica os acessos de cada contato no servidor; 403 */ 404 405 function Last_access_User($pJid) 5 /* 6 * Listen 7 */ 8 9 final function listen() 10 { 11 $return = null; 12 13 $_SESSION['phpgw_info']['instant_messenger']['time'] = time(); 14 15 $_SESSION['phpgw_info']['instant_messenger']['socket']['block'] = true; 16 $xml = $_SESSION['phpgw_info']['instant_messenger']['socket']['in']; 17 18 unset($_SESSION['phpgw_info']['instant_messenger']['socket']['in']); 19 $_SESSION['phpgw_info']['instant_messenger']['socket']['block'] = false; 20 21 ### Arranjo Tecnico ### 22 $vkrd = $xml; 23 24 if(isset($_SESSION['phpgw_info']['instant_messenger']['contacts'])) 25 unset($_SESSION['phpgw_info']['instant_messenger']['contacts']); 26 27 ### - messages - ### 28 $_messages = "/<message[^>]+from='(\S+)'[^>]*>(?(?=.*?<composing |.*?<paused ).*?<(composing|paused) )(?(?=.*?<html).*?<html[^>]*><body[^>]*>(.*?)<\/body><\/html>).*?<\/message>/s"; 29 $_messages = preg_match_all($_messages, $xml, $messages); 30 if ( $_messages !== false && $_messages > 0 ) 31 { 32 $xml = preg_replace("/<message.*?<\/message>/", "", $xml); 33 $return .= $this->getMessages($messages); 34 } 35 ### - Fim messages - ### 36 37 ### - contacts - ### 38 $_contacts = "/<iq[^>]+id='contacts'[^>]*>.*?<\/iq>/"; 39 $_contacts = preg_match_all($_contacts, $xml, $_xml); 40 41 $_contacts = "/<item.*?(?(?=[^>]+name)[^>]+name='(.*?)')[^>]+subscription='(.*?)'[^>]+jid='(.*?)'"; 42 $_contacts .= "(?(?=[^>]*\/>)[^>]*\/>|[^>]*><group>(.*?)<\/group><\/item>)/"; 43 $_contacts = preg_match_all($_contacts, $_xml[0][0], $contacts); 44 if ( $_contacts !== false && $_contacts > 0 ) 45 { 46 $xml = preg_replace("/<iq[^>]+id='contacts'[^>]*>.*?<\/iq>/", "", $xml); 47 $return .= rawurldecode(urldecode($this->getContacts($contacts))); 48 } 49 ### - Fim contacts - ### 50 51 ### - presence - ### 52 $xml = $_SESSION['phpgw_info']['instant_messenger']['presences'] . $xml; 53 54 $_presence = "/<presence(?(?=[^>]+\/>)[^>]+\/>|[^>]+>.*?<\/presence>)/"; 55 $_presence = preg_match_all($_presence, $xml, $presence); 56 57 $patterns[0] = '/<priority>[^<]*<\/priority>|<(\S) (?(?=[^>]*\/>)[^>]*\/>|[^>]*>.*?<\/\1>)/'; 58 $patterns[1] = '/ xmlns=\'.*?\'| to=\'.*?\'/'; 59 $patterns[2] = '/> +</'; 60 $replacements[0] = ''; 61 $replacements[1] = ''; 62 $replacements[2] = '><'; 63 $_xml = preg_replace($patterns, $replacements, implode('', $presence[0])); 64 65 $_presence = "/<presence[^>]+from='(\S+)'[^>]*type='(unavailable)'(?(?=[^>]*\/>)[^>]*\/>|[^>]*>.*?<\/presence>)|"; 66 $_presence .= "<presence[^>]+from='(\S+)'(?(?=[^>]+type)[^>]+type='(\S+)')[^>]*"; 67 $_presence .= "(?(?=\/>)\/>|>"; 68 $_presence .= "(?(?=<s[^>]*?>)<s[^>]*?>(.*?)<\/s[^>]*?>(?(?=<s[^>]*?>)<s[^>]*?>(.*?)<\/s[^>]*?>))"; 69 $_presence .= "<\/presence>)/"; 70 $_presence = preg_match_all($_presence, $_xml, $presence); 71 if ( $_presence !== false && $_presence > 0 ) 72 { 73 foreach ( $presence[5] as $key => $val ) 74 { 75 if ( !empty($presence[1][$key]) && (strpos($presence[1][$key], '/') !== false) ) 76 $presence[1][$key] = substr($presence[1][$key], 0, strpos($presence[1][$key], '/')); 77 78 if ( !empty($presence[3][$key]) && strpos($presence[3][$key], '/') !== false ) 79 $presence[3][$key] = substr($presence[3][$key], 0, strpos($presence[3][$key], '/')); 80 81 if ( !empty($val) && !preg_match("/^(away|chat|dnd|xa)$/", $val) ) 82 if ( preg_match("/^(away|chat|dnd|xa)$/", $presence[6][$key]) ) 83 { 84 $aux = $presence[5][$key]; 85 $presence[5][$key] = $presence[6][$key]; 86 $presence[6][$key] = $aux; 87 } 88 else 89 { 90 if ( empty($presence[6][$key]) ) 91 $presence[6][$key] = $presence[5][$key]; 92 $presence[5][$key] = ''; 93 } 94 } 95 $xml = preg_replace("/<presence[^>]\/?>|<presence[^>]>.*?<\/presence>/", "", $xml); 96 97 $return .= $this->getPresence($presence); 98 } 99 ### - Fim presence - ### 100 101 102 ### - vcard - ### 103 ### - Arranjo Tecnico - ### 104 $_xml = $vkrd; 105 $_vcard = "/<iq.*? id='(.*?)' .*?(<vCard [^>]+\/>|<vCard.*?<\/vCard>)<\/iq>/"; 106 $_vcard = preg_match_all($_vcard, $_xml, $vcard); 107 if( $_vcard !== false && $_vcard > 0) 108 { 109 $xml = preg_replace("/<iq.*?<vCard.*?<\/iq>/", "", $xml); 110 $return .= urldecode($this->getVcard($vcard)); 111 } 112 ### - Fim vcard - ### 113 114 ## Final do Listen; 115 116 return $return; 117 } 118 119 /* 120 * Contacts 121 */ 122 123 function getContacts(array $pContacts) 124 { 125 $_group = array(); 126 $return = NULL; 127 $jid = array_unique($pContacts[3]); 128 129 foreach ( $jid as $key => $val ) 130 { 131 $_SESSION['phpgw_info']['instant_messenger']['contacts'][] = $val; 132 133 $item = NULL; 134 $item .= '<item name="' . (( !empty($pContacts[1][$key]) ) ? $pContacts[1][$key] : $val); 135 $item .= '" jid="' . $val; 136 $item .= '" subscription="' . $pContacts[2][$key]; 137 $item .= '" />'; 138 139 $_group[utf8_decode(strtolower(!empty($pContacts[4][$key]) ? $pContacts[4][$key] : 'default'))][] = $item; 140 } 141 142 ksort($_group); 143 144 foreach ( $_group as $key => $val ) 145 $return .= '<group name="' . $key . '">' . implode('', $val) . '</group>'; 146 147 return '<contacts>' . $return . '</contacts>'; 148 } 149 150 function requireContacts() 151 { 152 $_SESSION['phpgw_info']['instant_messenger']['socket']['out']['getContacts'] = NULL; 153 } 154 155 /* 156 * Presence 157 */ 158 159 function setPresence($pPresence) 160 { 161 $_SESSION['phpgw_info']['instant_messenger']['socket']['out']['setPresence'] = $pPresence; 162 foreach($pPresence as $key=>$presence) 163 if($key == 'show' || $key == 'type') 164 $_SESSION['phpgw_info']['instant_messenger']['MyPresence'] = $presence; 165 } 166 167 function MyPresence() 168 { 169 if(isset($_SESSION['phpgw_info']['instant_messenger']['MyPresence'])) 170 return $_SESSION['phpgw_info']['instant_messenger']['MyPresence']; 171 } 172 173 function getPresence(array $pPresence) 174 { 175 $offline = array(); 176 foreach ( $pPresence[1] as $key => $val ) 177 { 178 if ( empty($val) ) 179 continue; 180 181 $_offline = true; 182 for ( $i = $key; $i < sizeof($pPresence[1]); $i++ ) 183 if ( $pPresence[1][$key] == $pPresence[3][$i] || $pPresence[1][$key] == $pPresence[5][$i] ) 184 $_offline = false; 185 186 if ( $_offline ) 187 $offline[$key] = $val; 188 } 189 190 $online = array(); 191 foreach ( $pPresence[3] as $key => $val ) 192 { 193 if ( empty($val) ) 194 continue; 195 196 $_online = true; 197 for ( $i = ($key + 1); $i < sizeof($pPresence[3]); $i++ ) 198 if ( in_array($val, $offline) || $pPresence[3][$key] == $pPresence[3][$i] ) 199 $_online = false; 200 201 if ( $_online ) 202 $online[$key] = $val; 203 } 204 205 $return = NULL; 206 207 foreach ( $offline as $key => $val ) 208 { 209 $val = ( strpos($val, '/') ) ? substr($val, 0, strpos($val, '/')) : $val; 210 $return .= "<presence from='" . $val . "' type='unavailable' />"; 211 } 212 213 foreach ( $online as $key => $val ) 214 { 215 $val = ( strpos($val, '/') ) ? substr($val, 0, strpos($val, '/')) : $val; 216 217 if ( empty($pPresence[4][$key]) ) 218 $pPresence[4][$key] = ( empty($pPresence[5][$key]) ) ? 219 'available' : $pPresence[5][$key]; 220 221 $return .= "<presence from='" . $val . "' type='" . $pPresence[4][$key]; 222 if ( empty($pPresence[6][$key]) ) 223 $return .= "' />"; 224 else 225 $return .= "'>" . $pPresence[6][$key] . "</presence>"; 226 227 if ( strpos($pPresence[4][$key], 'subscribe') === false ) 228 { 229 $session .= "<presence from='" . $val . "'><show>" . $pPresence[4][$key] . "</show>"; 230 if ( !empty($pPresence[6][$key]) ) 231 $session .= "<status>" . $pPresence[6][$key] . "</status>"; 232 $session .= "</presence>"; 233 } 234 } 235 236 $_SESSION['phpgw_info']['instant_messenger']['presences'] = $session; 237 238 return $return; 239 } 240 241 /* 242 * GetMessage 243 */ 244 245 function getMessages(array $pMessages) 246 { 247 $_messages = array(); 248 $return = NULL; 249 250 foreach ( $pMessages[1] as $key => $val ) 251 { 252 trim($pMessages[3][$key]); 253 if ( !empty($pMessages[3][$key]) ) 254 $_messages[$val][] = $pMessages[3][$key]; 255 256 if ( !empty($pMessages[2][$key]) ) 257 { 258 $return .= '<' . $pMessages[2][$key] . ' from="'; 259 $return .= ( strpos($val, '/') ) ? substr($val, 0, strpos($val, '/')) : $val; 260 $return .= '" />'; 261 } 262 } 263 264 foreach ( $_messages as $key => $val ) 265 { 266 $return .= '<messages from="' . $key . '">'; 267 foreach ( $val as $msg ) 268 $return .= '<message>' . $msg . '</message>'; 269 $return .= '</messages>'; 270 } 271 272 return $return; 273 } 274 275 /* 276 * SendMessage 277 */ 278 279 function SendMessage($pSendMessage) 280 { 281 $pSendMessage['body'] = stripslashes($pSendMessage['body']); 282 $_emotions = '/<img emotion="(\S+)?"[^>]+>/'; 283 $_emotions = preg_match_all($_emotions, $pSendMessage['body'], $emotions); 284 285 foreach ( $emotions[0] as $key => $val ) 286 $emotions[0][$key] = '/' . addcslashes($val, './()[]{}^$*&?') . '/i'; 287 288 $pSendMessage['body'] = preg_replace($emotions[0], $emotions[1], $pSendMessage['body']); 289 290 $to = $pSendMessage['to']; 291 $type = "normal"; 292 $id = ""; 293 $content = array( 294 "subject" => $pSendMessage['subject'] ? $pSendMessage['subject'] : "", 295 "thread" => $pSendMessage['thread'] ? $pSendMessage['thread'] : "", 296 "body" => $pSendMessage['body'] ? $pSendMessage['body'] : "" 297 ); 298 299 $payload = ""; 300 301 if ($to && is_array($content)) 302 { 303 if (!$id) 304 { 305 $id = $type . "_" . time(); 306 } 307 308 $xml = "<message to='$to' type='$type' id='$id'>"; 309 310 if ($content['subject']) 311 { 312 $xml .= "<subject>" . $content['subject'] . "</subject>"; 313 } 314 315 if ($content['thread']) 316 { 317 $xml .= "<thread>" . $content['thread'] . "</thread>"; 318 } 319 320 $xml .= "<html><body>" . $content['body'] . "</body></html>"; 321 $xml .= $payload; 322 $xml .= "</message>"; 323 unset($id); 324 325 $_SESSION['phpgw_info']['instant_messenger']['socket']['out']['message'] .= $xml; 326 } 327 else 328 { 329 $this->writeLog("ERROR: SendMessage() #2"); 330 return FALSE; 331 } 332 } 333 334 /* 335 * UpdateContact 336 */ 337 338 function updateContact($pUser) 339 { 340 $jid = $pUser['jid']; 341 $name = $pUser['name']; 342 $group = $pUser['group']; 343 344 if ( $jid ) 345 { 346 $updatecontact = "<item jid='$jid'"; 347 $updatecontact .= " name='" . $name . "'"; 348 $updatecontact .= "><group>" . $group . "</group></item>"; 349 $_SESSION['phpgw_info']['instant_messenger']['socket']['out']['updateContact'] = $updatecontact; 350 } 351 $this->requireContacts(); 352 } 353 354 /* 355 * AddContact 356 */ 357 358 function addContacts($pUser) 359 { 360 $jid = explode("@",$pUser['email']); 361 $pJid = $jid[0]."@".$_SESSION['phpgw_info']['instant_messenger']['name_jabber']; 362 $pName = $pUser['name']; 363 $pGroup = $pUser['group']; 364 365 if(trim($jid[0]) != trim($this->username)) 366 { 367 if ( $pJid ) 368 { 369 $newcontact = "<item jid='$pJid'"; 370 $newcontact .= " name='" . $pName . "'"; 371 $newcontact .= "><group>" . $pGroup . "</group></item>"; 372 $_SESSION['phpgw_info']['instant_messenger']['socket']['out']['addContacts'] = $newcontact; 373 $this->subscribe($pJid); 374 $this->requireContacts(); 375 } 376 } 377 } 378 379 /* 380 * RemoveContact 381 */ 382 383 function removeContact($pUser) 406 384 { 407 $id = "last_" . time(); 408 $result = array(); 409 $this->sendIq('get',$id,$pJid,NULL,'jabber:iq:last'); 410 411 usleep(50000); 412 $result = $this->readSocketFromServer(); 413 414 $time_offline = $result['iq'][0]['#']['query'][0]['@']['seconds']; 415 return $this->time_off_line($time_offline); 416 385 $pJid = $pUser['jid']; 386 $_SESSION['phpgw_info']['instant_messenger']['socket']['out']['removeContact'] = $pJid; 387 $this->unsubscribed($pJid); 388 $this->requireContacts(); 417 389 } 418 390 419 function time_off_line($pTime) 420 { 421 $time_access = $pTime / 15; 422 if($time_access < 2) 423 return TRUE; 424 else 425 return FALSE; 426 } 427 428 /* 429 * Permissão - Autorizar / Negar ; 430 */ 431 432 function AcceptRequest($pRequest) 433 { 434 $jid = explode("@",$pRequest['jid']); 435 $pToJid = $jid[0]."@".$this->server; 436 437 if(trim($pRequest['subscription']) == 'none' || trim($pRequest['subscription']) == 'from'){ 438 $db_im = new db_im(); 439 if(count($db_im->get_contacts_im($this->jid, $pToJid)) == 0){ 440 if(!$db_im->insert_contacts($this->jid , $pToJid)) 441 return false; 442 else 443 return $this->SubscriptionAcceptRequest($pToJid); 444 }else{ 445 return false; 446 } 447 }else{ 448 if(trim($pRequest['subscription']) == 'to'){ 449 return $this->SubscriptionAcceptRequest($pToJid); 450 }else{ 451 return false; 452 } 453 } 454 } 455 456 function SubscriptionAcceptRequest($to = NULL) 457 { 458 return ($to) ? $this->presence("subscribed", $to) : FALSE; 459 } 460 461 function SubscriptionDenyRequest($to = NULL) 462 { 463 return ($to) ? $this->presence("unsubscribed", $to) : FALSE; 464 } 465 466 function Subscribe($to = NULL) 467 { 468 return ($to) ? $this->presence("subscribe", $to) : FALSE; 469 } 470 471 function Unsubscribe($to = NULL) 472 { 473 return ($to) ? $this->presence("unsubscribe", $to) : FALSE; 474 } 475 476 // TESTE 477 478 function encode(&$item, $val = 'encode') 479 { 480 switch( gettype($item) ) 481 { 482 case 'object' : 483 $item = get_object_vars($item); 484 encode($item); 485 break; 486 case 'array' : 487 array_walk_recursive($item, 'encode'); 488 break; 489 default : $item = utf8_encode($item); 490 } 391 /* 392 * Vcard 393 */ 394 395 function newVcard($pVcardUser) 396 { 397 $pVcard = explode("_vkrd_", $pVcardUser['vcard']); 398 399 $xmlVcard = "<FN>".$pVcard[0]."</FN>"; 400 $xmlVcard .= "<NICKNAME>".$pVcard[1]."</NICKNAME>"; 401 $xmlVcard .= "<ORG>"; 402 $xmlVcard .= "<ORGNAME>".$pVcard[2]."</ORGNAME>"; 403 $xmlVcard .= "<ORGUNIT>".$pVcard[3]."</ORGUNIT>"; 404 $xmlVcard .= "</ORG>"; 405 $xmlVcard .= "<ROLE>".$pVcard[4]."</ROLE>"; 406 $xmlVcard .= "<BDAY>".$pVcard[5]."</BDAY>"; 407 $xmlVcard .= "<DESC>".$pVcard[6]."</DESC>"; 408 409 $_SESSION['phpgw_info']['instant_messenger']['socket']['out']['newVcard'] = $xmlVcard; 410 411 } 412 413 function getVcard(array $Vcard) 414 { 415 $div = ""; 416 $_expr = "/<[^<vCard xmlns=\'vcard\-temp\'>].*[^<\/vCard>]>/"; 417 array_shift($Vcard); 418 $div = '<vcard>'; 419 $jid_user = $_SESSION['phpgw_info']['instant_messenger']['user']; 420 $jid_user .= "@" . $_SESSION['phpgw_info']['instant_messenger']['name_jabber']; 421 for($i = 0 ; $i < count($Vcard[0]) ; $i++) 422 { 423 preg_match($_expr,$Vcard[1][$i],$div_vcard); 424 $div_new[] = $div_vcard; 425 426 if ( $jid_user == $Vcard[0][$i] ) 427 $_SESSION['phpgw_info']['instant_messenger']['vcard'] = $div_new[$i][0]; 428 429 $div .= '<div id="vcard_'.$Vcard[0][$i].'">'.urldecode($div_new[$i][0]).'</div>'; 430 } 431 $div .= '</vcard>'; 432 433 return $div; 434 } 435 436 function requireVcard() 437 { 438 $contacts = array(); 439 $contacts = $_SESSION['phpgw_info']['instant_messenger']['contacts']; 440 $jid_user = $_SESSION['phpgw_info']['instant_messenger']['user']; 441 $jid_user .= "@" . $_SESSION['phpgw_info']['instant_messenger']['name_jabber']; 442 443 if( count($contacts) > 0 ) 444 { 445 array_unshift($contacts,$jid_user); 446 447 foreach($contacts as $user) 448 $_SESSION['phpgw_info']['instant_messenger']['socket']['out']['vcard'][] = $user; 449 return "true"; 450 }else{ 451 return "false"; 452 } 453 } 454 455 function getJid() 456 { 457 $jid = $_SESSION['phpgw_info']['instant_messenger']['user'] . "@" . $_SESSION['phpgw_info']['instant_messenger']['name_jabber']; 458 return $jid; 459 } 460 461 function subscribe($pJid) 462 { 463 $jid = (is_array($pJid)) ? $pJid['jid'] : $pJid ; 464 $_SESSION['phpgw_info']['instant_messenger']['socket']['out']['Subscribe'] = $jid; 465 } 466 467 function subscribed($pJid) 468 { 469 $jid = (is_array($pJid)) ? $pJid['jid'] : $pJid ; 470 $_SESSION['phpgw_info']['instant_messenger']['socket']['out']['SubscriptionAcceptRequest'] = $jid; 471 } 472 473 function unsubscribe($pJid) 474 { 475 $jid = (is_array($pJid)) ? $pJid['jid'] : $pJid ; 476 $_SESSION['phpgw_info']['instant_messenger']['socket']['out']['Unsubscribe'] = $jid; 477 } 478 479 function unsubscribed($pJid) 480 { 481 $jid = (is_array($pJid)) ? $pJid['jid'] : $pJid ; 482 $_SESSION['phpgw_info']['instant_messenger']['socket']['out']['SubscriptionDenyRequest'] = $jid; 491 483 } 492 484 } -
trunk/instant_messenger/inc/class.db_im.inc.php
r41 r55 14 14 var $db_pass; 15 15 var $db_type; 16 var $teste; 16 17 17 18 function db_im(){ … … 27 28 } 28 29 29 function get_contacts_im($pFrom = false, $pTo)30 {31 $result = array();32 $from = explode("/",$pFrom);33 $to = explode("/",$pTo);34 if($pFrom)35 $query = "select im_from, im_to from phpgw_im_auth_user where im_from = '".$from[0]."' and im_to = '".$to[0]."'";36 else37 $query = "select im_from, im_to from phpgw_im_auth_user where im_to = '".$to[0]."' order by im_from";38 39 if (!$this->db->query($query))40 return null;41 42 while($this->db->next_record())43 $result[] = $this->db->row();44 45 return $result;46 }47 48 function insert_contacts($pFrom, $pTo)49 {50 $from = explode("/",$pFrom);51 $to = explode("/",$pTo);52 $query = "insert into phpgw_im_auth_user values('".$from[0]."','".$to[0]."')";53 return $this->query_db($query);54 }55 56 function delete_contacts($pFrom, $pTo)57 {58 $from = explode("/",$pFrom);59 $to = explode("/",$pTo);60 $query = "delete from phpgw_im_auth_user where im_from = '".$from[0]."' and im_to = '".$to[0]."'";61 return $this->query_db($query);62 }63 64 30 function get_accounts_acl() 65 31 { … … 88 54 $preferences = $param['preferences']; 89 55 $user_id = $_SESSION['phpgw_info']['instant_messenger']['user_id']; 90 $app_name = "instant_messenger";56 $app_name = $this->name_app(); 91 57 92 58 $query = "insert into phpgw_preferences values('".$user_id."','".$app_name."','".serialize($preferences)."')"; 93 59 94 if($this->query_db($query)) {95 return 1;96 }else{60 if($this->query_db($query)) 61 return "true"; 62 else{ 97 63 $query = "update phpgw_preferences set preference_value = '".serialize($preferences)."' where preference_app='".$app_name."' and preference_owner='".$user_id."'"; 98 64 if($this->query_db($query)) 99 return 1;65 return "true"; 100 66 else 101 return 0;67 return "false"; 102 68 } 103 69 } … … 107 73 $result = array(); 108 74 $user_id = $_SESSION['phpgw_info']['instant_messenger']['user_id']; 109 $app_name = "instant_messenger";75 $app_name = $this->name_app(); 110 76 111 77 $query = "select * from phpgw_preferences where preference_owner = '".$user_id."' and preference_app = '".$app_name."'"; … … 120 86 return unserialize($result[0]['preference_value']); 121 87 }else{ 122 return "ch_ time:true;ch_offline:true;ch_contacts:false;rd_nm:true;rd_al:false;rd_ch:false";88 return "ch_offline:true;in_time:1;rd_nm:true;rd_ch:false"; 123 89 } 124 90 } 91 92 function name_app() 93 { 94 return "instant_messenger"; 125 95 } 126 96 } -
trunk/instant_messenger/inc/class.ldap_im.inc.php
r41 r55 35 35 function get_photo_ldap($user,$getPhoto) 36 36 { 37 $user = ( $user == "user" ) ? $_SESSION['phpgw_info']['instant_messenger']['user'] : $user ; 38 37 39 if ($this->conn) { 38 40 $filter="(&(uid=".$user.")(phpgwAccountType=u))"; … … 70 72 function photo_ldap($user) 71 73 { 72 return $this->get_photo_ldap($user['uid'],false); 74 $uid = ( $user['uid'] == "user" ) ? $_SESSION['phpgw_info']['instant_messenger']['user'] : $user['uid'] ; 75 return $this->get_photo_ldap($uid,false); 73 76 } 74 77 -
trunk/instant_messenger/inc/im_acl.inc.php
r20 r55 1 1 <?php 2 2 for ( $i = 0; $i < sizeof($GLOBALS['phpgw_info']['user']['acl']); $i++ ) 3 { 3 4 if ( $GLOBALS['phpgw_info']['user']['acl'][$i]['appname'] == 'instant_messenger') 4 5 { 6 require_once("im_sessions.inc.php"); 7 5 8 $webserver_url = $GLOBALS['phpgw_info']['server']['webserver_url']; 6 9 $webserver_url = ( !empty($webserver_url) ) ? $webserver_url : '/'; … … 9 12 $webserver_url .= '/'; 10 13 11 $ INSTANT_MESSENGER_PATH= $webserver_url . 'instant_messenger/';14 $webserver_url = $webserver_url . 'instant_messenger/'; 12 15 13 $_SESSION['phpgw_info']['instant_messenger']['path'] = $INSTANT_MESSENGER_PATH; 16 require_once("IMConfigure.php"); 17 18 $_transport = TRANSPORT_NON_SECURITY; 19 $_port = PORT_NON_SECURITY; 20 21 //$SERVER = $_SERVER['SERVER_NAME']; 22 $SERVER = "127.0.0.1"; 23 24 @$fp = stream_socket_client($_transport . "://" . $SERVER . ":" . $_port, $errno, $errstr, 10); 25 26 if ( $fp ) 27 { 28 fwrite($fp, "GET /" . CONNECT . ";" . session_id() . " HTTP/1.1\r\nHost: " . $SERVER . ":" . $_port . "\r\nAccept: */*\r\n\r\n"); 29 30 $js = array( 31 $webserver_url . 'js/XMLTools.js', 32 $webserver_url . 'js/json.js', 33 $webserver_url . 'js/im_functions.js', 34 $webserver_url . 'js/im_fcommon.js', 35 $webserver_url . 'js/im_var_globals.js', 36 $webserver_url . 'js/im_images.js', 37 $webserver_url . 'js/im_templates.js', 38 $webserver_url . 'js/im_win.js', 39 $webserver_url . 'js/im_menu_action.js', 40 $webserver_url . 'js/im_conf_font.js', 41 $webserver_url . 'js/im_preferences.js', 42 $webserver_url . 'js/im_init.js', 43 $webserver_url . 'js/im_subscription.js', 44 ); 45 46 require_once('load_lang.php'); 14 47 15 48 /* 16 * 17 * Os método PORTA (PROGRAMAÇÂO ORIENTADA A RECURSO TÉCNICO ALTERNATIVO) mais exatamente 18 * métodos POG (PROGRAMAÇÂO ORIENTADO A GAMBIARRA) usados a seguir é devido a integração 19 * dos diverso módulos do expresso com o mensageiro instantâneo e para manter a aplicação 20 * crossbrowser! 21 * 22 * [NUTS] Rodrigo Souza - 29/01/2007 23 * 49 Os método PORTA (PROGRAMAÇÂO ORIENTADA A RECURSO TÉCNICO ALTERNATIVO) mais exatamente 50 métodos POG (PROGRAMAÇÂO ORIENTADO A GAMBIARRA) usados a seguir é devido a integração 51 dos diverso módulos do expresso com o mensageiro instantâneo e para manter a aplicação 52 crossbrowser! 53 54 [NUTS] Rodrigo Souza - 29/01/2007 24 55 */ 56 25 57 print ' 58 <link rel="stylesheet" href="' . $webserver_url . 'templates/default/css.css" /> 59 <link rel="stylesheet" href="' . $webserver_url . 'templates/default/messenger.css" /> 26 60 <script> 27 ini_wzdd = false; 28 function IM_loadScript(pFile) 29 { 30 head = document.getElementsByTagName(\'head\').item(0); 31 eScript = document.createElement("script"); 32 eScript.setAttribute(\'src\', pFile); 33 head.appendChild(eScript); 34 } 61 var im_send_file="' . $_SESSION['phpgw_info']['instant_messenger']['send_file_jabber'] . '"; 62 var im_path="' . $webserver_url . '"; 63 var ini_wzdd = false; 35 64 if ( !window.dd ) 36 65 { 37 66 ini_wzdd = true; 38 document.write(\'\<script src="' . $INSTANT_MESSENGER_PATH . 'js/wz_dragdrop.js"\>\<\/script\>\'); 67 document.write(\'\<script src="' . $webserver_url . 'js/wz_dragdrop.js"\>\<\/script\>\'); 68 var im_path="' . $webserver_url . '"; 39 69 } 40 70 </script>'; 41 71 /* 42 * 43 * isso se faz necessário para que não seja carregado duas vezes o arquivo wz_dragdrop 44 * e que a função SET_DHTML seja executada uma única vez, caso contrário causa um erro 45 * que finaliza a execução de todos as chamadas javascript em execução e as futuras 46 * chamadas também não serão executadas 47 * 72 isso se faz necessário para que não seja carregado duas vezes o arquivo wz_dragdrop 73 e que a função SET_DHTML seja executada uma única vez, caso contrário causa um erro 74 que finaliza a execução de todos as chamadas javascript em execução e as futuras 75 chamadas também não serão executadas 48 76 */ 77 49 78 print ' 50 79 <script> 51 if ( ini_wzdd ) SET_DHTML("backFantom"+NO_DRAG);52 setTimeout(\'IM_loadScript("' . $INSTANT_MESSENGER_PATH . 'index2.php")\',5000);80 if ( ini_wzdd ) 81 SET_DHTML("backFantom"+NO_DRAG); 53 82 </script>'; 83 84 foreach ( $js as $key => $val ) 85 print '<script src="' . $val . '?' . filemtime($_SERVER['DOCUMENT_ROOT'] . '/' . $val) . '"></script>'; 86 54 87 /* 55 * 56 * instrução break utilizada decorrente ao fato que o usuário pode ter multiplas permissão de 57 * acesso ao modulo de mensagem instantanea ou seja pode possuir permissão tanto nos diversos 58 * grupos que faz parte assim como permissão individual de acesso (permissão de acesso dada 59 * especificamente ao usuaário) 60 * 88 instrução break utilizada decorrente ao fato que o usuário pode ter multiplas permissão de 89 acesso ao modulo de mensagem instantanea ou seja pode possuir permissão tanto nos diversos 90 grupos que faz parte assim como permissão individual de acesso (permissão de acesso dada 91 especificamente ao usuaário) 61 92 */ 93 94 }else{ 95 $user = "niltonneto"; 96 97 if(trim($_SESSION['phpgw_info']['instant_messenger']['user']) == $user) 98 { 99 ini_set ( "session.save_path", "/php_sessions/"); 100 $path = ini_get("session.save_path"); 101 102 $log = date('m/d/Y H:i:s'). " - Erro na conexao com: ". $SERVER . " - Erros : " . $errstr . " : " . $errno. "\n"; 103 104 $ff = fopen ($path."conexao_jabber.log", "a+"); 105 if ( $ff ) 106 { 107 fwrite($ff, $log); 108 fclose($ff); 109 } 110 } 111 } 62 112 break; 63 113 } 114 } 64 115 ?> -
trunk/instant_messenger/inc/load_lang.php
r20 r55 1 1 <? 2 // Load the lang of the module. 3 if(!$_SESSION['phpgw_info']['instant_messenger']['lang']) 4 { 5 $array_keys = array(); 6 $fn = '../setup/phpgw_pt-br.lang'; 7 if (file_exists($fn)){8 $fp = fopen($fn,'r');9 while ($data = fgets($fp,16000)) { 10 list($message_id,$app_name,$null,$content) = explode("\t",substr($data,0,-1)); 11 $_SESSION['phpgw_info']['instant_messenger']['lang'][$message_id] = $content;12 13 fclose($fp); 14 } 15 } 16 $script = "IM.array_lang_im[0] = new Array();"; 17 $script .= "IM.array_lang_im[1] = new Array();"; 18 $i = 0;19 foreach($_SESSION['phpgw_info']['instant_messenger']['lang'] as $key => $value) { 20 $script .= "IM.array_lang_im[0][".$i."] = '".str_replace("'","\'",strtolower($key))."';"; 21 $script .= "IM.array_lang_im[1][".$i."] = '".str_replace("'","\'",$value)."';";22 $i++; 23 } 24 25 2 if ( !isset($_SESSION['phpgw_info']['instant_messenger']['lang']) || !is_array($_SESSION['phpgw_info']['instant_messenger']['lang']) ) 3 if ( file_exists(($fn = dirname(__FILE__) . '/../setup/phpgw_pt-br.lang')) ) 4 if ( ($fp = fopen($fn,'r')) ) 5 { 6 while ($data = fgets($fp,16000)) 7 { 8 list($message_id, $app_name, $null, $content) = explode("\t",substr($data,0,-1)); 9 $_SESSION['phpgw_info']['instant_messenger']['lang'][$message_id] = $content; 10 } 11 fclose($fp); 12 } 13 14 $script = '<script>'; 15 $script .= 'var lang_im = [];'; 16 17 foreach ( $_SESSION['phpgw_info']['instant_messenger']['lang'] as $key => $value ) 18 $script .= "lang_im['" . strtolower(addslashes($key)) . "'] = '" . addslashes($value) . "';"; 19 20 #$_key = str_replace("'","\'",strtolower($key)); 21 #$_val = str_replace("'","\'",$value); 22 23 $script .= '</script>'; 24 25 echo $script; 26 26 ?> -
trunk/instant_messenger/index.php
r32 r55 22 22 // Session 23 23 $_SESSION['phpgw_info']['instant_messenger']['user'] = $GLOBALS['phpgw_info']['user']['account_lid']; 24 $_SESSION['phpgw_info']['instant_messenger']['user_id'] = $GLOBALS['phpgw_info']['user']['account_id'];25 24 $_SESSION['phpgw_info']['instant_messenger']['passwd'] = $GLOBALS['phpgw_info']['user']['passwd']; 26 $_SESSION['phpgw_info']['instant_messenger']['email'] = $GLOBALS['phpgw_info']['user']['email'];27 25 $_SESSION['phpgw_info']['instant_messenger']['name_jabber'] = $GLOBALS['phpgw_info']['server']['name_jabber']; 28 26 $_SESSION['phpgw_info']['instant_messenger']['port_jabber'] = $GLOBALS['phpgw_info']['server']['port_jabber']; -
trunk/instant_messenger/js/XMLTools.js
r27 r55 1 1 var XMLTools = { 2 2 "__DEBUG__" : false, 3 "__DEFAULT_URI__" : im_path + 'controller.php?action=', 3 "__DEFAULT_URI__" : im_path + 'controller.php?action=', 4 4 "__HTTP__" : null, 5 5 "__MODE__" : 'X', 6 "__RETURN_MODE_DEFAULT__" : 'JSON', 7 "__RETURN_MODE__" : false, 6 8 "__THREADS__" : [], 7 9 "http" : function() … … 66 68 __HTTP__.responseXML : 67 69 __HTTP__.responseText; 68 70 69 71 var handler = __this.__THREADS__[__pTarget]; 70 72 delete __this.__THREADS__[__pTarget]; … … 87 89 { 88 90 var target = this.__DEFAULT_URI__ + pTarget; 91 if ( this.__RETURN_MODE__ ) 92 { 93 target += '&returnMode=' + this.__RETURN_MODE__; 94 this.__RETURN_MODE__ = false; 95 } 96 else 97 target += '&returnMode=' + this.__RETURN_MODE_DEFAULT__; 89 98 90 99 if ( pMethod == 'POST' ) … … 96 105 __HTTP__.setRequestHeader('Pragma', 'no-cache'); 97 106 __HTTP__.onreadystatechange = __handler; 98 __HTTP__.send(pData);107 pData = ( pData ) ? pData : null ; 99 108 } 100 109 else … … 102 111 __HTTP__.open("GET", target, true); 103 112 __HTTP__.onreadystatechange = __handler; 104 __HTTP__.send(null);113 pData = null; 105 114 } 115 __HTTP__.send(pData); 106 116 } 107 117 catch(e) … … 113 123 "transform" : function(pXML, pXSL) 114 124 { 115 var fragment = null; 116 if ( window.XSLTProcessor ) 117 { 118 var xslProc = new XSLTProcessor(); 119 xslProc.importStylesheet(pXSL); 120 fragment = xslProc.transformToFragment(pXML, document); 121 122 // para retornar valor igual ao ie. 123 var aux = document.createElement("div"); 124 aux.appendChild(fragment); 125 fragment = aux.innerHTML; 126 } 127 else 128 { 129 var xslTemplate = new ActiveXObject("Msxml2.XSLTemplate"); 130 xslTemplate.stylesheet = pXSL; 131 132 var myXslProc = xslTemplate.createProcessor(); 133 myXslProc.input = pXML; 134 135 myXslProc.transform(); 136 fragment = myXslProc.output; 137 138 } 139 return fragment; 140 } 125 try 126 { 127 var fragment = null; 128 if ( window.XSLTProcessor ) 129 { 130 var xslProc = new XSLTProcessor(); 131 xslProc.importStylesheet(pXSL); 132 fragment = xslProc.transformToFragment(pXML, document); 133 134 // para retornar valor igual ao ie. 135 var aux = document.createElement("div"); 136 aux.appendChild(fragment); 137 fragment = aux.innerHTML; 138 } 139 else 140 { 141 var xslTemplate = new ActiveXObject("MSXML2.XSLTemplate"); 142 xslTemplate.stylesheet = pXSL; 143 144 var myXslProc = xslTemplate.createProcessor(); 145 myXslProc.input = pXML; 146 147 myXslProc.transform(); 148 fragment = myXslProc.output; 149 } 150 return fragment; 151 } 152 catch(e) 153 { 154 alert("transform\n\n" + e + "\n\n" + e.description); 155 } 156 }, 157 "create" : function() 158 { 159 try 160 { 161 var a = false; 162 if ( document.implementation.createDocument ) 163 a = document.implementation.createDocument("", "", null); 164 else if ( ActiveXObject ) 165 a = new ActiveXObject("Msxml2.DOMDocument"); 166 167 with ( a ) 168 appendChild(createProcessingInstruction("xml", "version='1.0'")); 169 170 return a; 171 } 172 catch(e) 173 { 174 alert("create\n\n" + e + "\n\n" + e.description); 175 } 176 } 141 177 } -
trunk/instant_messenger/js/im_fcommon.js
r27 r55 34 34 */ 35 35 var func = { 36 "json" : false, 36 37 "attachEvent" : function(obj, eventName, eventHandler) 37 38 { … … 211 212 }, 212 213 214 "interface" : function(_XmlDoc) 215 { 216 var data = _XmlDoc.getElementsByTagName('retorno').item(0); 217 if ( data.childNodes.length == 1 ) 218 data = data.firstChild.nodeValue; 219 220 if ( /^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(data) ) 221 { 222 eval('data = ' + data); 223 if ( this.json ){ 224 this.json = false; 225 }else{ 226 data = this.json2array(data); 227 } 228 } 229 230 return data; 231 232 }, 233 213 234 "insEl" : function() 214 235 { 236 try 237 { 215 238 if ( arguments.length == 1 ) 216 239 { … … 241 264 } /* else */ 242 265 return true; 266 } 267 catch(e) 268 {} 243 269 }, 244 270 245 271 "insElB" : function() 246 272 { 273 try 274 { 247 275 if ( arguments.length < 2 ) 248 276 { … … 270 298 } /* else */ 271 299 return true; 300 } 301 catch(e) 302 {} 272 303 }, 273 304 … … 305 336 { 306 337 return typeof a == 'undefined'; 338 }, 339 340 "json2array" : function(pObject) 341 { 342 var retorno = []; 343 for( var i in pObject ) 344 if( pObject[i].constructor == Object ) 345 { 346 retorno[i] = []; 347 retorno[i] = this.json2array(pObject[i]); 348 } 349 else 350 retorno[i] = pObject[i]; 351 return retorno; 307 352 }, 308 353 -
trunk/instant_messenger/js/im_functions.js
r44 r55 1 // Instant Messenger 2 // im_functions.js 3 4 function IM() 5 { 6 this.array_lang_im = new Array(); 7 this.array_users = new Array(); 8 this.vcard_user = new Array(); 9 this.array_prefe = new Array(); 10 this.array_prefe['ch_offline'] = true; 11 this.load_photo = false; 12 this.IM_Manutencao = false; 13 } 14 15 /* 16 * Load Contatos 17 */ 18 19 IM.prototype.load_im = function() 20 { 21 22 var force = ( arguments.length ) ? true : false; 23 var _this = this; 24 Sincro.count = 0; 25 26 if( _this.IM_Manutencao ) 27 { 28 _this.Manutencao(); 29 30 }else{ 31 var handler_contacts = function(data) 1 function IM() 2 { 3 this._listen = true; 4 this.vcards = false; 5 this.labelVcard = []; 6 this.statusvcard = false; 7 this.UsersNot = []; 8 this.userPrefe = false; 9 this.im_time_ = false; 10 } 11 12 IM.prototype.load_im = function() 13 { 14 IM.listen(); 15 IM.requireContacts(); 16 17 var handler_Status = function(XmlData) 18 { 19 var data = XmlData.getElementsByTagName('retorno').item(0); 20 data = data.firstChild.nodeValue; 21 if( data ) 22 setTimeout('IM.ImgStatus("'+data+'")',4000); 23 }; 24 XMLTools.request('$this.Ujabber.MyPresence', 'GET', handler_Status); 25 }; 26 27 IM.prototype.listen = function() 28 { 29 if ( !this._listen ) 30 return false; 31 32 var _this = this; 33 var handler = function(data) 34 { 35 try 32 36 { 33 if( (data.length) >= (_this.array_users.length) || (data.length - 1) > 0){ 34 _this.array_users.splice(0,_this.array_users.length); 35 _this.array_users = data; 36 _this.mount_list(data); 37 _this.conf_VcardUser(data[0]); 38 } 37 if( !_this.userPrefe ) 38 { 39 if(window.IM_Preferences) 40 IM_Preferences.GetYourPreferences(); 41 } 42 43 _this.getContacts(data); 44 _this.getPresence(data); 45 _this.getComposing(data); 46 _this.getMessages(data); 47 _this.getVcard(data); 48 49 if(!_this.vcards) 50 { 51 _this.requireVcard(); 52 _this.vcards = true; 53 } 39 54 } 40 41 if ( force || this.getWinContactsState() ) 42 cIM.cExecute("$this.Ujabber.list_user",handler_contacts); 43 } 44 } 45 46 /* 47 * Update Contatos 48 */ 49 50 IM.prototype.UpdateContacts = function() 51 { 52 var _this = this; 53 _this.load_im(); 54 } 55 56 IM.prototype.showContacts = function() 57 { 58 if ( this.getWinContactsState() ) 59 im_win.windowClose('contacts_im'); 60 else 61 { 62 im_win.windowMaximizeRestore('contacts_im'); 63 this.load_im(); 64 } 65 } 66 67 IM.prototype.getWinContactsState = function() 68 { 69 try 70 { 71 var win_state = false; 72 win_state = ( windowItems['contacts'].state == WINDOW_STATE_REGULAR ) ? true : false; 73 win_state = ( win_state ) ? win_state : ( windowItems['contacts'].state == WINDOW_STATE_MAXIMIZED ) ? true : false; 74 return win_state; 75 } 76 catch(e) 77 { 78 return false; 79 } 80 } 81 82 /* 83 * Manutenção 84 */ 85 86 IM.prototype.Manutencao = function() 87 { 88 // Manutencao 89 var div_manutencao = document.getElementById('contacts_im_window_body_inner'); 90 div_manutencao.innerHTML = '<p align="center"><img src='+img_manutencao_im.src+'></p>'; 91 return false; 92 } 93 94 /* 95 * Monta Lista de Contatos 55 catch(e) 56 { 57 //alert("listen\n\n" + e + "\n\n" + e.description) 58 } 59 _this._listen = true; 60 setTimeout('IM.listen()', 3000); 61 }; 62 this._listen = false; 63 XMLTools.__RETURN_MODE__ = 'XML'; 64 XMLTools.request('$this.Ujabber.listen', 'GET', handler); 65 }; 66 67 /* 68 * Contacts 96 69 */ 97 70 98 IM.prototype.mount_list = function(pList) 71 IM.prototype.requireContacts = function() 72 { 73 var handler = function(data) 74 { 75 }; 76 XMLTools.request('$this.Ujabber.requireContacts', 'GET', handler); 77 }; 78 79 IM.prototype.getContacts = function(data) 80 { 81 try 82 { 83 if ( data.getElementsByTagName('contacts').length > 0 ) 84 { 85 var node = data.documentElement.firstChild; 86 while ( node.nodeName != 'contacts' ) 87 node = node.nextSibling; 88 89 var div = document.getElementById("div_contacts"); 90 var xsl = XMLTools.load(im_path + 'xsl/contacts.xsl?' + Date.parse(new Date)); 91 var img = document.createElement('img'); 92 img.id = 'img_all_groups'; 93 img.src = img_group_open.src; 94 img.onclick = function(){IM.visible_group("all_groups")}; 95 96 var a = document.createElement('div'); 97 a.innerHTML = XMLTools.transform(node, xsl); 98 99 div.innerHTML = ''; 100 div.appendChild(img); 101 div.appendChild(document.createTextNode(this.get_lang('List of Contacts'))); 102 div.appendChild(a); 103 104 var group = func.byId("all_groups").firstChild; 105 while ( group ) 106 { 107 var contact = group.firstChild.nextSibling; 108 while ( contact = contact.nextSibling ) 109 { 110 var img = func.newEl('img'); 111 img.src = img_unavailable.src; 112 113 func.insElB(img, func.byId(contact.id).firstChild); 114 } 115 116 try 117 { 118 var img = document.createElement('img'); 119 img.src = img_group_open.src; 120 img.id = "img_" + group.id; 121 var el_parent = group; 122 123 el_parent.insertBefore(img,el_parent.firstChild); 124 125 } catch(e){} 126 group = group.nextSibling; 127 } 128 this.atalho(); 129 } 130 } 131 catch (e) 132 { 133 //alert('getContacts()' + e); 134 } 135 136 }; 137 138 /* 139 * Visible / Unvisible 140 */ 141 142 IM.prototype.visible_group = function(el) 99 143 { 100 144 var _this = this; 101 var group = ""; 102 var div = document.getElementById("div_contacts"); 103 div.innerHTML = ""; 104 105 div.innerHTML += '<img id="img_all_groups" src=' + img_group_open.src + 106 ' onclick=javascript:IM.visible_group("all_groups")>' + 107 '<b>'+_this.get_lang('list of contacts') + ' - ' + ( pList.length - 1 ) + '</b><br>' + 108 '<div id="all_groups"></div>'; 109 110 for(var i=1; i < pList.length; i++){ 111 112 var div_agroups = document.getElementById("all_groups"); 113 var div_group = document.createElement('DIV'); 114 group = decodeURI(pList[i].group); 115 group = group.rm_space(); 116 if(document.getElementById("img_" + group) == null ){ 117 118 div_agroups.innerHTML += '<img id="img_' + group + '" src="' + img_group_open.src + '" onclick="javascript:IM.visible_group(\'' + group + '\')" style="margin-left:16px;">'; 119 div_agroups.innerHTML += '<b>' + decodeURI(pList[i].group) + '</b></br>'; 120 121 if(group != 'sem_grupo'){ 122 div_group.id = group; 123 if(pList[i].subscription.rm_space() == "both") 124 div_group.innerHTML += '<div id="' + pList[i].jid + '" nuncontact="'+ i +'" onmouseover="this.className=\'contato_hover\'" onmouseout="this.className=\'\'" onmousedown="javascript:IM.action_button(event, \''+pList[i].online + '\', \'' + pList[i].jid + '\' ,false);" style="cursor:pointer;padding-left:32px;"><img src="' + ((pList[i].online) == parseInt(1) ? img_online.src : img_offline.src) + '">' + decodeURI(pList[i].name) + '</div><span id="_span_' + pList[i].jid + '" class="menu_im"></span>'; 125 else 126 div_group.innerHTML += '<div id="' + pList[i].jid + '" nuncontact="'+ i +'" onmouseover="this.className=\'contato_hover\'" onmouseout="this.className=\'\'" onmousedown="javascript:IM.action_button(event, \''+parseInt(0)+'\', \'' + pList[i].jid + '\' ,true);" style="cursor:pointer;padding-left:32px;"><img src="' + img_not_authorized.src + '">' + decodeURI(pList[i].name) + '</div><span id="_span_' + pList[i].jid + '" class="menu_im"></span>'; 127 div_agroups.appendChild(div_group); 128 }else{ 129 div_group.id = group; 130 div_group.innerHTML += '<div id="'+pList[i].jid+'" onclick=Preferences.updateLoad("'+pList[i].jid+'") style="cursor:pointer;padding-left:32px;">'+ 131 '<img src="'+img_not_authorized.src+'">'+pList[i].jid+'</div>'; 132 div_agroups.appendChild(div_group); 133 } 134 }else{ 135 136 if(group != 'sem_grupo'){ 137 var div_group = document.getElementById(group); 138 if(pList[i].subscription.rm_space() == "both") 139 div_group.innerHTML += '<div id="' + pList[i].jid + '" nuncontact="'+ i +'" onmouseover="this.className=\'contato_hover\'" onmouseout="this.className=\'\'" onmousedown="javascript:IM.action_button(event, \''+pList[i].online + '\', \'' + pList[i].jid + '\',false);" style="cursor:pointer;padding-left:32px;"><img src="' + ((pList[i].online) == parseInt(1) ? img_online.src : img_offline.src) + '">' + decodeURI(pList[i].name) + '</div><span id="_span_' + pList[i].jid + '" class="menu_im"></span>'; 140 else 141 div_group.innerHTML += '<div id="' + pList[i].jid + '" nuncontact="'+ i +'" onmouseover="this.className=\'contato_hover\'" onmouseout="this.className=\'\'" onmousedown="javascript:IM.action_button(event, \''+parseInt(0)+'\', \'' + pList[i].jid + '\',true);" style="cursor:pointer;padding-left:32px;"><img src="' + img_not_authorized.src + '">' + decodeURI(pList[i].name) + '</div><span id="_span_' + pList[i].jid + '" class="menu_im"></span>'; 142 div_agroups.appendChild(div_group); 143 }else{ 144 var div_group = document.getElementById(group); 145 div_group.innerHTML += '<div id="'+pList[i].jid+'" onclick=Preferences.updateLoad("'+pList[i].jid+'") style="cursor:pointer;padding-left:32px;">'+ 146 '<img src="'+img_not_authorized.src+'">'+pList[i].jid+'</div>'; 147 div_agroups.appendChild(div_group); 148 } 149 } 150 } 151 152 // Contatos Offline; 153 _this.ContactsOffline(); 154 155 // Usuários Não Autorizados; 156 setTimeout("Templates.Users_Not_Auth()",2500); 157 158 } 159 160 /* 161 * Deixar contatos Offline 162 */ 163 164 IM.prototype.ContactsOffline = function() 165 { 166 var _this = this; 167 var display = "block"; 168 169 if(!_this.array_prefe['ch_offline']){ 170 display = "none"; 171 } 172 173 for(var i = 1; i < _this.array_users.length; i++){ 174 var div_child = document.getElementById(_this.array_users[i].jid); 175 var img_src = div_child.firstChild.src 176 if(img_src === img_offline.src){ 177 div_child.style.display = display; 178 } 179 } 180 } 181 182 /* 183 * Requisitar autorização; 184 */ 185 186 IM.prototype.Authorization = function(pJid,pSubscription) 187 { 188 if(confirm("Enviar pedido?")){ 189 var handler_accept_request = function(data){ 190 if(!data) 191 alert("Pedido já foi enviado!"); 192 } 193 cIM.cExecute("$this.Ujabber.AcceptRequest",handler_accept_request,"jid="+pJid+"&subscription="+pSubscription); 194 } 195 } 196 197 /* 198 * Grupos dos Contatos; 199 */ 200 201 IM.prototype.visible_group = function(el) 202 { 203 var _this = this; 204 el = el.rm_space(); 205 var div = document.getElementById(el); 206 div.style.display = "none"; 145 var divParent = document.getElementById(el); 146 divParent.style.display = "none"; 207 147 var img = document.getElementById("img_" + el); 208 148 img.onclick = function(){_this.unvisible_group(el)}; 209 149 img.src = img_group_close.src; 210 211 150 } 212 151 … … 214 153 { 215 154 var _this = this; 216 el = el.rm_space();217 155 var div = document.getElementById(el); 218 156 div.style.display = ""; … … 220 158 img.onclick = function(){_this.visible_group(el)}; 221 159 img.src = img_group_open.src; 222 223 160 } 224 161 225 162 /* 226 * Conf. Vcard163 * Presence 227 164 */ 228 165 229 IM.prototype.conf_VcardUser = function(data) 230 { 231 var _this = this; 232 233 // Vcard pessoal; 234 if ( !_this.load_photo ){ 235 236 _this.vcard_user['VCARD_FN'] = decodeURI(data.VCARD_FN); 237 _this.vcard_user['VCARD_NICKNAME'] = decodeURI(data.VCARD_NICKNAME); 238 _this.vcard_user['VCARD_ORGNAME'] = decodeURI(data.VCARD_ORGNAME); 239 _this.vcard_user['VCARD_ORGUNIT'] = decodeURI(data.VCARD_ORGUNIT); 240 _this.vcard_user['VCARD_ROLE'] = decodeURI(data.VCARD_ROLE); 241 _this.vcard_user['VCARD_BDAY'] = decodeURI(data.VCARD_BDAY); 242 _this.vcard_user['VCARD_DESC'] = decodeURI(data.VCARD_DESC); 243 _this.vcard_user['VCARD_JID'] = decodeURI(data.VCARD_JID); 166 IM.prototype.getPresence = function(data) 167 { 168 try 169 { 170 var presence = data.documentElement.firstChild; 171 var _this = this; 172 while ( presence ) 173 { 174 if ( presence.nodeName != 'presence' ) 175 { 176 presence = presence.nextSibling; 177 continue; 178 } 179 180 var from = presence.getAttribute('from'); 181 var type = presence.getAttribute('type'); 182 if ( presence.hasChildNodes() ) 183 var status_message = presence.firstChild.nodeValue; 184 else 185 var status_message = false; 186 187 188 189 if( from ) 190 { 191 switch ( type ) 192 { 193 case 'subscribe' : 194 if ( !func.byId(from) ) 195 _this.UsersNot[_this.UsersNot.length] = from; 196 else 197 { 198 Subscription.subscribed(from); 199 this.setStatus(statusFlag); 200 } 201 break; 244 202 245 im_win.get_photo_ldap(decodeURI(data['VCARD_JID'])); 246 Preferences.GetPreferences(); 247 _this.load_photo = true; 248 } 249 250 // NickName; 251 if(_this.vcard_user['VCARD_NICKNAME'] != "") 252 document.getElementById('span_nickname').innerHTML = "<b> " + _this.vcard_user['VCARD_NICKNAME'].substring(0,30) + "</b>"; 253 else 254 document.getElementById('span_nickname').innerHTML = "<b> " + IM.get_lang('your nickname') + "</b>"; 255 256 // Custom Message; 257 if(_this.vcard_user['VCARD_DESC'] != "") 258 document.getElementById('span_message').innerHTML = "<b> " + _this.vcard_user['VCARD_DESC'].substring(0,30) + "</b>"; 259 else 260 document.getElementById('span_message').innerHTML = "<b> " + IM.get_lang('your message') + "</b>"; 261 262 } 263 264 /* 265 * Menu 266 */ 267 268 IM.prototype.visible_box = function() 269 { 270 var _this = this; 271 document.getElementById('list_users').style.display = ""; 272 var img = document.getElementById('box_menu'); 273 img.onclick = function(){_this.unvisible_box()}; 274 img.src = img_open_box.src; 275 } 276 277 IM.prototype.unvisible_box = function() 278 { 279 var _this = this; 280 document.getElementById('list_users').style.display = "none"; 281 var img = document.getElementById('box_menu'); 282 img.onclick = function(){_this.visible_box()}; 283 img.src = img_close_box.src; 284 } 285 286 /* 287 * Traduções 288 */ 289 290 // Translate words and phrases using user language from eGroupware. 291 IM.prototype.get_lang = function(_key,_arg1,_arg2,_arg3,_arg4) 292 { 293 var _this = this; 294 if(!_this.array_lang_im[0]){ 295 return _key+"*"; 296 } 297 _value = ""; 298 for(i = 0; i < _this.array_lang_im[0].length;i++){ 299 if(_this.array_lang_im[0][i] == _key.toLowerCase()) { 300 _value = _this.array_lang_im[1][i]; 301 break; 302 } 303 } 304 305 if(!_value) 306 return _key+"*"; 307 308 if(_arg1 || _arg2 ||_arg3 || _arg4) { 309 for(j = 1; j <= 4; j++){ 310 if(eval("_arg"+j)) { 311 var regExp = new RegExp("%"+j+""); 312 _value = _value.replace(regExp,eval("_arg"+j)); 203 case 'subscribed' : 204 // 205 break; 206 207 case 'unsubscribe' : 208 Subscription.unsubscribe(from); 209 type = 'unavailable'; 210 func.byId(from).firstChild.src = eval('img_' + type + '.src'); 211 break; 212 case 'unsubscribed' : 213 Subscription.unsubscribed(from); 214 type = 'unavailable'; 215 func.byId(from).firstChild.src = eval('img_' + type + '.src'); 216 break; 217 default : 218 if ( func.byId(from) ) 219 { 220 func.byId(from).firstChild.src = eval('img_' + type + '.src'); 221 var status; 222 223 if ( (status = func.byId(from + '_im_window')) ) 224 { 225 status.firstChild.style.background = 'url('+func.byId(from).firstChild.src+')'; 226 status = func.byId(from + '_im_window_message'); 227 if( status_message && status_message != "available" ) 228 status.innerHTML = from.substr(0, from.indexOf('@')) + ' : ' + status_message; 229 else 230 status.innerHTML = ''; 231 232 } 233 234 if( document.getElementById('status_message_' + from) == null) 235 { 236 var lbl = document.createElement('label'); 237 lbl.id = 'status_message_' + from; 238 if(!status_message) 239 lbl.innerHTML = ""; 240 else 241 if( status_message != "available" ) 242 lbl.innerHTML = "<span style='margin-left:10px'><br/> ( " + status_message + " )</span>"; 243 func.byId(from).appendChild(lbl); 244 }else{ 245 var lbl = document.getElementById('status_message_' + from); 246 if(!status_message) 247 lbl.innerHTML = ""; 248 else 249 if( status_message != "available" ) 250 lbl.innerHTML = "<span style='margin-left:10px'><br/> ( " + status_message + " )</span>"; 251 } 252 } 253 } 254 } 255 if( _this.UsersNot.length > 0 ) 256 Templates.Users_Not_Auth(_this.UsersNot); 257 presence = presence.nextSibling; 258 } 259 _this.Contacts_Offline(); 260 } 261 catch(e) 262 { 263 } 264 }; 265 266 /* 267 * Contatos - Offline 268 */ 269 270 IM.prototype.Contacts_Offline = function() 271 { 272 var offline = true; 273 if(IM.userPrefe) 274 offline = eval(IM_Preferences.LoadPreferences('ch_offline')); 275 else 276 offline = eval(IM_Preferences.LoadPreferences('ch_offline')); 277 var group = func.byId("all_groups").firstChild; 278 while ( group ) 279 { 280 var contact = group.firstChild.nextSibling; 281 while ( contact = contact.nextSibling ) 282 { 283 if(func.byId(contact.id)) 284 { 285 var childF = func.byId(contact.id).firstChild; 286 if( childF.src == img_unavailable.src && !offline ) 287 func.byId(contact.id).style.display = "none"; 288 else 289 func.byId(contact.id).style.display = "block"; 313 290 } 314 291 } 292 group = group.nextSibling; 293 } 294 } 295 296 /* 297 * Get / Send - Messages 298 */ 299 300 IM.prototype.getMessages = function(data) 301 { 302 try 303 { 304 data = data.documentElement; 305 if ( data.childNodes.length > 0 ) 306 { 307 var message = data.firstChild; 308 while ( message ) 309 { 310 if ( message.tagName == 'messages' ) 311 { 312 var from = message.getAttribute('from'); 313 with ( from ) 314 from = substr(0, indexOf('/')) 315 316 if( document.getElementById('vcard_' + from) != null) 317 { 318 var div_from = document.getElementById('vcard_' + from); 319 var el_child = div_from.firstChild; 320 while( el_child ) 321 { 322 if( el_child.tagName == "NICKNAME" && el_child.innerHTML != "" ) 323 var nickname = el_child.innerHTML; 324 el_child = el_child.nextSibling; 325 } 326 } 327 328 var win = document.getElementById(from + '_chatMessages'); 329 if ( !win ) 330 { 331 im_win.open_chat(from); 332 win = document.getElementById(from + '_chatMessages'); 333 } 334 335 var el = message.firstChild; 336 while ( el ) 337 { 338 var xsl = XMLTools.load(im_path + 'xsl/message.xsl?' + Date.parse(new Date)); 339 var next = el.nextSibling; 340 341 var label = document.createElement('strong'); 342 if(nickname) 343 label.appendChild(document.createTextNode(nickname)); 344 else 345 label.appendChild(document.createTextNode(from)); 346 win.appendChild(label); 347 win.appendChild(document.createElement('br')); 348 win.innerHTML += XMLTools.transform(el, xsl); 349 win.innerHTML = this.emotions_icons(win.innerHTML); 350 win.appendChild(document.createElement('br')); 351 win.appendChild(document.createElement('br')); 352 win.scrollTop = win.scrollHeight; 353 im_win.newMessageNotification(); 354 355 el = next; 356 } 357 } 358 359 if ( (composing = func.byId(from + '_composing')) ) 360 if ( composing.style.display = 'block' ) 361 composing.style.display = 'none'; 362 363 message = message.nextSibling; 364 } 365 } 366 } 367 catch (e) 368 { 369 //alert(e.description) 370 } 371 } 372 373 IM.prototype.sendMessage = function (pJID) 374 { 375 var _this = this; 376 var name_document = document.getElementById(pJID + '_edita'); 377 var envio = name_document.contentWindow.document.getElementsByTagName('body').item(0); 378 379 envio.innerHTML = func.trim(envio.innerHTML.replace(/^( |<br>| )*|( |<br>| )*$/g, '')); 380 381 if ( envio.innerHTML != "" ) 382 { 383 var message_text = "<div style='"; 384 message_text += (envio.style.fontFamily != "") ? "font-family:"+envio.style.fontFamily+";" : ""; 385 message_text += (envio.style.fontSize != "") ? "font-size:"+envio.style.fontSize+";" : "" ; 386 message_text += (envio.style.fontWeight != "") ? "font-weight:"+envio.style.fontWeight+";": ""; 387 message_text += (envio.style.fontStyle != "" ) ? "font-style:"+envio.style.fontStyle+";" : ""; 388 message_text += (envio.style.color != "") ? "color:"+envio.style.color+";" : "color:black"; 389 message_text += "'>"; 390 message_text += envio.innerHTML + "</div>"; 391 392 envio.innerHTML = ''; 393 394 var message_element = document.getElementById(pJID + '_chatMessages'); 395 message_element.innerHTML += '<strong>' + 'me '; 396 message_element.innerHTML += ' ' + _this.get_lang('speak') + ':</strong><br/>'; 397 message_element.innerHTML += message_text + '<br/>'; 398 message_element.scrollTop = message_element.scrollHeight; 399 400 var handler_sendMessage = function(data) 401 { 402 var data = func.interface(data); 403 if(!data) 404 alert(data); 405 } 406 XMLTools.request('$this.Ujabber.SendMessage','POST',handler_sendMessage,"to="+pJID+"&body="+escape(message_text)); 407 } 408 }; 409 410 IM.prototype.getComposing = function(data) 411 { 412 if ( data.hasChildNodes() ) 413 { 414 var node = data.documentElement.firstChild; 415 while ( node ) 416 { 417 var composing; 418 if ( node.nodeName == 'composing' ) 419 if ( (composing = func.byId(node.getAttribute('from') + '_composing')) ) 420 if ( composing.style.display = 'none' ) 421 composing.style.display = 'block'; 422 423 if ( node.nodeName == 'paused' ) 424 if ( (composing = func.byId(node.getAttribute('from') + '_composing')) ) 425 if ( composing.style.display = 'block' ) 426 composing.style.display = 'none'; 427 428 node = node.nextSibling; 429 } 315 430 } 316 317 return _value; 318 } 319 431 }; 432 320 433 /* 321 * Pega Mensagens434 * Get_lang 322 435 */ 323 324 IM.prototype.getMessage = function() 325 { 326 var _this = this; 327 328 if( _this.IM_Manutencao ) 329 { 330 _this.Manutencao(); 331 332 }else{ 333 var handler_message = function(data) 334 { 335 if( data.length > 0) 336 { 337 var TimeStamp = ""; 338 var jid = ""; 339 var nickname = ""; 340 var body_message = ""; 341 var window_message = ""; 342 343 for( var i=0; i < data.length; i++) 344 { 345 jid = data[i].from; 346 body_message = data[i].body; 347 TimeStamp = (_this.array_prefe['ch_time']) ? "[" + data[i].timestamp + "] " : " "; 348 349 jid = jid.substr(0,jid.indexOf('/')); 350 body_message = decodeURI(body_message.replace(/\\\'/g, '\'')); 351 352 window_message = document.getElementById(jid + "_chatMessages"); 353 nickname = jid; 354 355 for( var j=1; j < IM.array_users.length; j++ ) 356 { 357 if( jid == IM.array_users[j].jid ){ 358 nickname = decodeURI(IM.array_users[j].VCARD_NICKNAME); 359 } 360 } 361 362 if ( window_message ) 363 { 364 window_message.innerHTML += '<strong>' + TimeStamp + nickname + '</strong> ' + IM.get_lang('speak') + ':<br/> ' + _this.emotions_icons(body_message) + '<br/><br/>'; 365 if ( windowItems[jid].state != WINDOW_STATE_REGULAR && windowItems[jid].state != WINDOW_STATE_MAXIMIZED ) 366 im_win.showWindowItem(jid); 367 } 368 else 369 { 370 im_win.open_chat(jid); 371 window_message = document.getElementById(jid + '_chatMessages'); 372 window_message.innerHTML += '<strong>' + TimeStamp + nickname + '</strong> ' + IM.get_lang('speak') + ':<br/> ' + _this.emotions_icons(body_message) + '<br/><br/>'; 373 } 374 } 375 376 window_message.scrollTop = window_message.scrollHeight; 377 im_win.newMessageNotification(); 378 } 379 } 380 cIM.cExecute("$this.Ujabber.getMessages", handler_message); 381 } 382 } 383 436 437 IM.prototype.get_lang = function(_key, _arg1, _arg2, _arg3, _arg4) 438 { 439 var _value = ""; 440 441 if ( !lang_im[_key.toLowerCase()] ) 442 return _key + "*"; 443 444 _value = lang_im[_key.toLowerCase()]; 445 446 if ( _arg1 || _arg2 ||_arg3 || _arg4 ) 447 { 448 for (j = 1; j <= 4; j++ ) 449 if( eval("_arg"+j) ) 450 { 451 var regExp = new RegExp("%" + j + ""); 452 _value = _value.replace(regExp, eval("_arg"+j)); 453 } 454 } 455 456 return _value; 457 }; 458 459 IM.prototype.getWinContactsState = function() 460 { 461 try 462 { 463 var win_state = false; 464 win_state = ( windowItems['contacts'].state == WINDOW_STATE_REGULAR ) ? true : false; 465 win_state = ( win_state ) ? win_state : ( windowItems['contacts'].state == WINDOW_STATE_MAXIMIZED ) ? true : false; 466 return win_state; 467 468 }catch(e){} 469 }; 470 471 IM.prototype.showContacts = function() 472 { 473 if ( this.getWinContactsState() ) 474 im_win.windowClose('contacts_im'); 475 else 476 { 477 im_win.windowMaximizeRestore('contacts_im'); 478 //this.load_im(); 479 } 480 }; 481 384 482 /* 385 * Envia Mensagens 386 */ 387 388 IM.prototype.sendMessage = function (pJID) 389 { 390 var _this = this; 391 var name_document = document.getElementById(pJID + '_edita'); 392 var envio = name_document.contentWindow.document.getElementsByTagName('body').item(0); 393 394 envio.innerHTML = func.trim(envio.innerHTML.replace(/^( |<br>| )*|( |<br>| )*$/g, '')); 395 396 if ( envio.innerHTML != "" ) 397 { 398 var message_text = "<div style='"; 399 message_text += (envio.style.fontFamily != "") ? "font-family:"+envio.style.fontFamily+";" : ""; 400 message_text += (envio.style.fontSize != "") ? "font-size:"+envio.style.fontSize+";" : "" ; 401 message_text += (envio.style.fontWeight != "") ? "font-weight:"+envio.style.fontWeight+";": ""; 402 message_text += (envio.style.fontStyle != "" ) ? "font-style:"+envio.style.fontStyle+";" : ""; 403 message_text += (envio.style.color != "") ? "color:"+envio.style.color+";" : "color:black"; 404 message_text += "'>"; 405 message_text += envio.innerHTML + "</div>"; 406 407 envio.innerHTML = ''; 408 409 var message_element = document.getElementById(pJID + '_chatMessages'); 410 message_element.innerHTML += '<strong>' + ((_this.vcard_user['VCARD_NICKNAME'] != "") ? _this.vcard_user['VCARD_NICKNAME'] : _this.vcard_user['VCARD_JID'] ); 411 message_element.innerHTML += ' ' + _this.get_lang('speak') + ':</strong><br/>'; 412 message_element.innerHTML += _this.emotions_icons(message_text.replace(/^( |<br>| )*|( |<br>| )*$/g, '')) + '<br/>'; 413 414 message_element.scrollTop = message_element.scrollHeight; 415 416 var handler_sendMessage = function(data) 417 { 418 if(!data) 419 alert(data); 420 } 421 cIM.cExecute("$this.Ujabber.SendMessage",handler_sendMessage,"to="+pJID+"&body="+url_encode(encodeURI(message_text))); 422 } 423 } 424 425 /* 426 * Smiles 427 */ 428 429 IM.prototype.emotions_icons = function(pMessage) 430 { 431 for ( i = 1; i < cod_emotions.length; i++ ) 432 { 433 var image = eval('smile_' + i + '.src.substr(smile_' + i + '.src.indexOf(im_path))') 434 pMessage = pMessage.replace(cod_emotions[i], '<img src="' + image + '">'); 435 } 436 return pMessage; 437 } 438 439 IM.prototype.atalho = function() 440 { 441 if ( local = func.byId('user_info') ) 442 { 483 * Smiles 484 */ 485 486 IM.prototype.emotions_icons = function(pEmotion) 487 { 488 for ( i = 1; i < cod_emotions.length; i++ ) 489 { 490 var image = eval('smile_' + i + '.src.substr(smile_' + i + '.src.indexOf(im_path))') 491 pEmotion = pEmotion.replace(cod_emotions[i], '<img emotion="' + pEmotion + '" src="' + image + '">'); 492 } 493 494 return pEmotion; 495 } 496 497 IM.prototype.atalho = function() 498 { 499 if ( (local = func.byId('user_info')) && !(func.byId('myStatus')) ) 500 { 443 501 var aux = new Array(); 444 502 var _mix = func.newEl('a', 'a', 'img', 'img', 'dl'); … … 465 523 aux['contacts_image'] = new Array(); 466 524 aux['contacts_image']['element'] = contacts_image; 467 aux['contacts_image']['id'] = ' chat_bubble';468 aux['contacts_image']['src'] = im_path + 'templates/default/images/navbar.png';525 aux['contacts_image']['id'] = 'myStatus'; 526 aux['contacts_image']['src'] = eval('img_' + statusFlag + '.src'); 469 527 aux['contacts_image']['style'] = 'width:15px;height:15px'; 470 528 func.confEl(aux); … … 473 531 func.insEl(contacts_image, contacts_link); 474 532 func.insElB(fast_menu_link, contacts_link, im_fast_menu, document.createTextNode(' '), local.firstChild); 475 } 476 else 477 setTimeout('IM.atalho()', 5000); 478 } 533 } 534 else 535 setTimeout('IM.atalho()', 5000); 536 }; 537 538 /* 539 * Vcard 540 */ 541 542 IM.prototype.requireVcard = function() 543 { 544 var _this = this; 545 var handler_getVcard = function(_XMLdata) 546 { 547 var data = _XMLdata.getElementsByTagName('retorno').item(0); 548 data = eval(data.firstChild.nodeValue); 549 if(!data) 550 setTimeout("IM.requireVcard()",2000); 551 }; 552 XMLTools.request('$this.Ujabber.requireVcard','GET',handler_getVcard); 553 } 554 555 IM.prototype.getVcard = function(data) 556 { 557 var _this = this; 558 try 559 { 560 if ( data.getElementsByTagName('vcard').length > 0 && !_this.statusvcard ) 561 { 562 var div = document.getElementById("im_vcard_contacts"); 563 var xsl = XMLTools.load(im_path + 'xsl/vcard_contacts.xsl?' + Date.parse(new Date)); 564 _this.statusvcard = true; 565 566 div.innerHTML = ""; 567 div.innerHTML += XMLTools.transform(data, xsl); 568 IM_Preferences.vCardInit(); 569 } 570 571 }catch(e){} 572 573 574 }; 575 576 IM.prototype.open_chat = function(pJID) 577 { 578 im_win.open_chat(pJID); 579 }; 580 581 IM.prototype.action_button = function(pEv, pJid) 582 { 583 try 584 { 585 if ( pEv.button > 1 ) 586 { 587 var posx = 0; 588 var posy = 0; 589 if (pEv.pageX || pEv.pageY) 590 { 591 posx = pEv.pageX; 592 posy = pEv.pageY; 593 } 594 else if (pEv.clientX || pEv.clientY) 595 { 596 posx = pEv.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; 597 posy = pEv.clientY + document.body.scrollTop + document.documentElement.scrollTop; 598 } 599 this.menu_button_right(pJid, posx, posy); 600 document.oncontextmenu = new Function("return false"); 601 } 602 else 603 if ( func.byId(pJid).firstChild.src != img_unavailable.src ) 604 this.open_chat(pJid); 605 } 606 catch(e) 607 { 608 //alert("action_button\n\n" + e) 609 } 610 }; 611 612 IM.prototype.menu_button_right = function(pElement, pX, pY) 613 { 614 var form_menu_button_right = '<dl style="z-index:99999">'+ 615 '<dt><a href="javascript:void(0);" onclick="javascript:IM_Preferences.Update_NickName(\''+pElement+'\');"><img src="'+img_group_close.src+'">' + IM.get_lang('Nick') + '</a>'+ 616 '<dt><a href="javascript:void(0);" onclick="javascript:IM_Preferences.SendFile(\''+pElement+'\');"><img src="'+img_group_close.src+'">' + IM.get_lang('Send File') + '</a>'+ 617 '<dt><a href="javascript:void(0);" onclick="javascript:IM_Preferences.Update_Group(\''+pElement+'\');"><img src="'+img_group_close.src+'">' + IM.get_lang('Group') + '</a>'+ 618 '<dt><a href="javascript:void(0);" onclick="javascript:IM_Preferences.RemoveContact(\''+pElement+'\');"><img src="'+img_group_close.src+'">' + IM.get_lang('Delete') + '</a>'+ 619 '<dt><a href="javascript:void(0);" onclick="javascript:Subscription.RequestAutorization(\''+pElement+'\');"><img src="'+img_group_close.src+'">' + IM.get_lang('(Re)-requisitar Autorização') + '</a>' + 620 '<dt><a href="javascript:void(0);" onclick="javascript:IM_Preferences.vCardLoad_Contact(\''+pElement+'\');"><img src="'+img_group_close.src+'">' + IM.get_lang('See Info') + '</a>'+ 621 '</dl>'; 622 im_menu_action.menu('menu_contato', form_menu_button_right); 623 func.byId('menu_contato').style.top = pY-10; 624 func.byId('menu_contato').style.left = pX-10; 625 func.byId('menu_contato').style.zIndex = zValue + 10; 626 }; 627 628 /* 629 * Menu 630 */ 631 632 IM.prototype.menu_preferences = function() 633 { 634 var posx = 0; 635 var posy = 0; 636 var pEv = arguments[0]; 637 638 if (pEv.pageX || pEv.pageY) 639 { 640 posx = pEv.pageX; 641 posy = pEv.pageY; 642 } 643 else if (pEv.clientX || pEv.clientY) 644 { 645 posx = pEv.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; 646 posy = pEv.clientY + document.body.scrollTop + document.documentElement.scrollTop; 647 } 648 649 var p_element = document.getElementById(arguments[1]); 650 var _xmlDoc = ""; 651 var _this = this; 652 653 _xmlDoc = '<menu>' + 654 '<item function="IM_Preferences.Add_userLoad()" lang="'+IM.get_lang('Add Contact')+'"/>' + 655 '<item function="IM_Preferences.Remove_userLoad()" lang="'+IM.get_lang('Remove Contact')+'"/>' + 656 '<item function="IM_Preferences.vCard()" lang="'+IM.get_lang('Information')+'"/>' + 657 '<item function="IM_Preferences.yourPreferences()" lang="'+IM.get_lang('preferences')+'"/>' + 658 '</menu>'; 659 660 im_menu_action.menu(p_element.id,parse_XmlXsl(_xmlDoc,'menu_preferences.xsl')); 661 func.byId(p_element).style.top = posy; 662 func.byId(p_element).style.left = posx; 663 func.byId(p_element).style.zIndex = zValue + 10; 664 665 _this.Load_Images_menu(); 666 } 667 668 IM.prototype.Load_Images_menu = function(Element) 669 { 670 try 671 { 672 var group = document.getElementById("dl_im_menu_preferences"); 673 var Child = group.childNodes; 674 675 for(var i = 0; i < Child.length; i++) 676 { 677 var img = document.createElement('img'); 678 img.src = img_menu.src; 679 Child[i].firstChild.insertBefore(img, Child[i].firstChild.firstChild); 680 } 681 }catch (e){} 682 683 } 684 685 /* 686 * Função Provisória - By AlC 687 */ 688 689 function parse_XmlXsl(_xmlDoc, form_xsl) 690 { 691 var xslWin = false; 692 693 if ( !xslWin ) xslWin = XMLTools.load(im_path + 'xsl/' + form_xsl + '?' + Date.parse(new Date)); 694 695 a = document.createElement('div'); 696 if (window.ActiveXObject) 697 { 698 var xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); 699 xmlDoc.async = "false"; 700 xmlDoc.loadXML(_xmlDoc); 701 } 702 else 703 { 704 var parser = new DOMParser(); 705 var xmlDoc = parser.parseFromString(_xmlDoc, "text/xml"); 706 } 707 a.innerHTML = XMLTools.transform(xmlDoc, xslWin); 708 709 return a; 710 711 } 479 712 480 713 IM.prototype.showFastMenu = function() 481 714 { 482 if ( !messages_timeout ) 715 var _dt = func.newEl('dt', 'dt', 'dt', 'dt', 'dt'); 716 var _a = func.newEl('a', 'a', 'a', 'a', 'a'); 717 718 for ( var i in _dt ) 719 { 720 if ( typeof _dt[i] == 'function' ) 721 continue; 722 eval('var option' + (parseInt(i)+1) + ' = _dt[' + i + '];'); 723 eval('var option' + (parseInt(i)+1) + '_link = _a[' + i + '];'); 724 } 725 726 var _img = func.newEl('img', 'img', 'img', 'img','img'); 727 728 for ( var i in _img ) 729 { 730 if ( typeof _dt[i] == 'function' ) 731 continue; 732 eval('var option' + (parseInt(i)+1) + '_image = _img[' + i + '];'); 733 } 734 735 option1_link.onclick = function(){statusFlag = 'available'; IM.setStatus('available');}; 736 option2_link.onclick = function(){statusFlag = 'xa'; IM.setStatus('xa');}; 737 option3_link.onclick = function(){statusFlag = 'dnd'; IM.setStatus('dnd');}; 738 option4_link.onclick = function(){statusFlag = 'unavailable'; IM.setStatus('unavailable');}; 739 option5_link.onclick = function(){IM.setStatus('custom')}; 740 741 func.confEl(option1_image, 'src', img_available.src); 742 func.confEl(option1_image, 'style', 'width:16px;height:16px;'); 743 func.confEl(option2_image, 'src', img_xa.src); 744 func.confEl(option2_image, 'style', 'width:16px;height:16px;'); 745 func.confEl(option3_image, 'src', img_dnd.src); 746 func.confEl(option3_image, 'style', 'width:16px;height:16px;'); 747 func.confEl(option4_image, 'src', img_unavailable.src); 748 func.confEl(option4_image, 'style', 'width:16px;height:16px;'); 749 func.confEl(option5_image, 'src', img_edit.src); 750 func.confEl(option5_image, 'style', 'width:16px;height:16px;'); 751 752 func.insEl(option1_image, IM.get_lang('online'), option1_link); 753 func.insEl(option1_link, option1); 754 func.insEl(option2_image, IM.get_lang('away'), option2_link); 755 func.insEl(option2_link, option2); 756 func.insEl(option3_image, IM.get_lang('busy'), option3_link); 757 func.insEl(option3_link, option3); 758 func.insEl(option4_image, IM.get_lang('offline'), option4_link); 759 func.insEl(option4_link, option4); 760 func.insEl(option5_image, IM.get_lang('Custom message...'), option5_link); 761 func.insEl(option5_link, option5); 762 763 im_menu_action.menu('fast_menu_im', option1, option2, option3, option4, option5); 764 }; 765 766 IM.prototype.setStatus = function(pStatus) 767 { 768 try 483 769 { 484 var option = func.newEl('dt'); 485 var option_link = func.newEl('a'); 486 var option_image = func.newEl('img'); 487 488 option_link.onclick = function(){IM.login();}; 489 490 func.confEl(option_image, 'src', img_online.src); 491 func.confEl(option_image, 'style', 'width:16px;height:16px;'); 492 493 func.insEl(option_image, IM.get_lang('login'), option_link); 494 func.insEl(option_link, option); 495 496 im_menu_action.menu('fast_menu_im', option); 770 var handler = function() 771 { 772 }; 773 im_menu_action.menu('fast_menu_im', null); 774 775 if ( pStatus == 'custom' ) 776 { 777 pStatus = prompt('Personalize seu Status : '); 778 pStatus = 'status=' + pStatus; 779 } 780 else 781 { 782 if ( pStatus == 'unavailable' ) 783 { 784 this.ImgStatus(pStatus); 785 pStatus = 'type=' + pStatus; 786 } 787 else 788 { 789 try 790 { 791 this.ImgStatus(pStatus); 792 pStatus = 'show=' + pStatus; 793 } 794 catch(e){} 795 } 796 } 797 XMLTools.request('$this.Ujabber.setPresence', 'POST', handler, pStatus); 798 } 799 catch(e){} 800 }; 801 802 IM.prototype.ImgStatus = function(pStatus) 803 { 804 var myStatus; 805 if ( (myStatus = func.byId('myStatus')) ) 806 myStatus.src = eval('img_' + pStatus + '.src'); 807 }; 808 809 IM.prototype.setAway = function() 810 { 811 if ( statusFlag != 'available' ) 812 return false; 813 814 if ( awayFlag ) 815 { 816 this.setStatus('available'); 817 awayFlag = false; 497 818 } 498 819 else 499 820 { 500 var _dt = func.newEl('dt', 'dt', 'dt', 'dt', 'dt'); 501 var _a = func.newEl('a', 'a', 'a', 'a', 'a'); 502 503 for ( var i in _dt ) 821 this.setStatus('xa'); 822 awayFlag = true; 823 } 824 }; 825 826 IM.prototype.infoContact = function(pUid) 827 { 828 var info = false; 829 var div_allg = document.getElementById('all_groups'); 830 var elements = div_allg.firstChild; 831 while ( elements ) 832 { 833 var childs = elements.firstChild; 834 while( childs ) 504 835 { 505 if ( typeof _dt[i] == 'function' ) 506 continue; 507 eval('var option' + (parseInt(i)+1) + ' = _dt[' + i + '];'); 508 eval('var option' + (parseInt(i)+1) + '_link = _a[' + i + '];'); 836 if(childs.tagName == "DIV" && childs.id.indexOf(pUid) === 0 ) 837 { 838 info = {'jid':childs.id, 'src':childs.firstChild.src}; 839 break; 840 } 841 childs = childs.nextSibling; 509 842 } 510 511 var _img = func.newEl('img', 'img', 'img', 'img'); 512 513 for ( var i in _img ) 514 { 515 if ( typeof _dt[i] == 'function' ) 516 continue; 517 eval('var option' + (parseInt(i)+1) + '_image = _img[' + i + '];'); 518 } 519 520 option1_link.onclick = function(){IM.setStatus('online');}; 521 option2_link.onclick = function(){IM.setStatus('idle');}; 522 option3_link.onclick = function(){IM.setStatus('busy');}; 523 option4_link.onclick = function(){IM.logout();}; 524 option5_link.onclick = function(){IM.setStatus('custom')}; 525 526 func.confEl(option1_image, 'src', img_online.src); 527 func.confEl(option1_image, 'style', 'width:16px;height:16px;'); 528 func.confEl(option2_image, 'src', img_idle.src); 529 func.confEl(option2_image, 'style', 'width:16px;height:16px;'); 530 func.confEl(option3_image, 'src', img_busy.src); 531 func.confEl(option3_image, 'style', 'width:16px;height:16px;'); 532 func.confEl(option4_image, 'src', img_offline.src); 533 func.confEl(option4_image, 'style', 'width:16px;height:16px;'); 534 535 func.insEl(option1_image, IM.get_lang('online'), option1_link); 536 func.insEl(option1_link, option1); 537 func.insEl(option2_image, IM.get_lang('????'), option2_link); 538 func.insEl(option2_link, option2); 539 func.insEl(option3_image, IM.get_lang('busy'), option3_link); 540 func.insEl(option3_link, option3); 541 func.insEl(option4_image, IM.get_lang('offline'), option4_link); 542 func.insEl(option4_link, option4); 543 func.insEl(IM.get_lang('Custom message...'), option5_link); 544 func.insEl(option5_link, option5); 545 546 im_menu_action.menu('fast_menu_im', option1, option2, option3, option4, option5); 843 if ( !info ) 844 elements = elements.nextSibling; 845 else 846 break; 547 847 } 548 } 549 550 IM.prototype.setStatus = function(pStatus) 551 { 552 im_menu_action.menu('fast_menu_im', null); 553 } 554 555 IM.prototype.getStatus = function() 556 { 557 } 558 559 IM.prototype.login = function() 560 { 561 try 562 { 563 im_menu_action.menu('fast_menu_im', null); 564 Sincro.get_list(); 565 Sincro.get_Message(); 566 var contacts_image = func.byId('chat_bubble'); 567 contacts_image.parentNode.onclick = function(){IM.showContacts()}; 568 func.confEl(contacts_image, 'src', im_path + 'templates/default/images/navbar.png'); 569 } 570 catch (e) 571 { 572 } 573 } 574 575 IM.prototype.logout = function() 576 { 577 im_menu_action.menu('fast_menu_im', null); 578 clearTimeout(messages_timeout); 579 clearTimeout(contacts_timeout); 580 messages_timeout = false; 581 contacts_timeout = false; 582 var contacts_image = func.byId('chat_bubble'); 583 contacts_image.parentNode.onclick = function(){IM.showFastMenu()}; 584 func.confEl(contacts_image, 'src', img_chat_bubble.src); 585 } 586 587 IM.prototype.menu_preferences = function(pElement) 588 { 589 if ( document.getElementById(pElement).innerHTML == "" ) 590 { 591 var form_pref = "<dl>"; 592 form_pref += "<dt><a href='javascript:void(0)' onclick='javascript:Preferences.Add_userLoad()'>"; 593 form_pref += "<img src="+img_menu.src+"> "+IM.get_lang('Add Contact')+"</a></dt>"; 594 form_pref += "<dt><a href='javascript:void(0)' onclick='javascript:Preferences.Remove_userLoad()'>"; 595 form_pref += "<img src="+img_menu.src+"> "+IM.get_lang('Remove Contact')+"</a></dt>"; 596 form_pref += "<dt><a href='javascript:void(0)' onclick='javascript:Preferences.vCardLoad()'>"; 597 form_pref += "<img src="+img_menu.src+"> "+IM.get_lang('Information')+"</a></dt>"; 598 form_pref += "<dt><a href='javascript:void(0)' onclick='javascript:Preferences.yourPreferences()'>"; 599 form_pref += "<img src="+img_menu.src+"> "+IM.get_lang('preferences')+"</a></dt>"; 600 form_pref += "</dl>"; 601 im_menu_action.menu(pElement, form_pref); 602 } 603 } 604 605 IM.prototype.menu_button_right = function(pElement,pReq) 606 { 607 var form_menu_button_right = '<dl>'; 608 if(pReq) 609 { 610 form_menu_button_right += '<dt><a href="javascript:void(0);" onclick="javascript:IM.Authorization(\''+pElement+'\',\'from\');"><img src="'+img_group_close.src+'">' + IM.get_lang('Authorization') + '</a>'; 611 } 612 form_menu_button_right += '<dt><a href="javascript:void(0);" onclick="javascript:Preferences.Update_NickName(\''+pElement+'\');"><img src="'+img_group_close.src+'">' + IM.get_lang('Nick') + '</a>'+ 613 '<dt><a href="javascript:void(0);" onclick="javascript:Preferences.SendFile(\''+pElement+'\');"><img src="'+img_group_close.src+'">' + IM.get_lang('Send File') + '</a>'+ 614 '<dt><a href="javascript:void(0);" onclick="javascript:Preferences.Update_Group(\''+pElement+'\');"><img src="'+img_group_close.src+'">' + IM.get_lang('Group') + '</a>'+ 615 '<dt><a href="javascript:void(0);" onclick="javascript:Preferences.Remove_Contact(\''+pElement+'\');"><img src="'+img_group_close.src+'">' + IM.get_lang('Delete') + '</a>'+ 616 '<dt><a href="javascript:void(0);" onclick="javascript:Preferences.vCardLoad_Contact(\''+pElement+'\');"><img src="'+img_group_close.src+'">' + IM.get_lang('See Info') + '</a>'+ 617 '</dl>'; 618 im_menu_action.menu("_span_" + pElement, form_menu_button_right); 619 } 620 621 /* 622 * Integração com o Expresso, verifica se o usuário tem permissão no Módulo IM 623 */ 624 625 IM.prototype.UserPermission = function(uid, handler) 626 { 627 cIM.cExecute("$this.contacts_im.UserPermission",handler,"uid="+uid); 628 } 629 630 /* 631 * Ação do botão onclick da lista de contatos; 632 */ 633 634 IM.prototype.action_button = function(pEv,pStatus,pJid,pReq) 635 { 636 var _this = this; 637 if(pEv.button > 1){ 638 _this.menu_button_right(pJid,pReq); 639 document.oncontextmenu = new Function("return false"); 640 }else{ 641 if(pStatus == parseInt(1)) 642 _this.open_chat(pJid); 643 } 644 } 645 646 /* 647 * Abre Conversa 648 */ 649 650 IM.prototype.open_chat = function(pJID) 651 { 652 func.byId(pJID).firstChild.src = img_chat_bubble.src; 653 im_win.open_chat(pJID); 654 } 655 656 /* 657 * url_encode 658 */ 659 660 function url_encode(str) 661 { 662 var hex_chars = "0123456789ABCDEF"; 663 var noEncode = /^([a-zA-Z0-9\_\-\.])$/; 664 var n, strCode, hex1, hex2, strEncode = ""; 665 666 for( n = 0; n < str.length; n++ ) 667 { 668 if ( noEncode.test(str.charAt(n)) ) 669 { 670 strEncode += str.charAt(n); 671 } 672 else 673 { 674 strCode = str.charCodeAt(n); 675 hex1 = hex_chars.charAt(Math.floor(strCode / 16)); 676 hex2 = hex_chars.charAt(strCode % 16); 677 strEncode += "%" + (hex1 + hex2); 678 } 679 } 680 return strEncode; 681 } 682 683 String.prototype.rm_space = function() 684 { 685 return this.replace(/( *)/g,""); 686 } 687 688 // Build Object 689 var IM = new IM(); 848 return info; 849 }; 850 851 var IM = new IM(); -
trunk/instant_messenger/js/im_images.js
r27 r55 2 2 // Images.js 3 3 4 var img_group_close = new Image(); 5 img_group_close.src = im_path + "templates/default/images/group_close.gif"; 6 var img_group_open = new Image(); 7 img_group_open.src = im_path + "templates/default/images/group_open.gif"; 8 var blank = new Image(); 9 blank.src = im_path + "templates/default/images/blank.gif"; 10 var img_down = new Image(); 11 img_down.src = im_path + "templates/default/images/down.gif"; 12 var img_up = new Image(); 13 img_up.src = im_path + "templates/default/images/up.gif"; 14 var img_online = new Image(); 15 img_online.src = im_path + "templates/default/images/online.gif"; 16 var img_offline = new Image(); 17 img_offline.src = im_path + "templates/default/images/offline.gif"; 18 var img_idle = new Image(); 19 img_idle.src = im_path + "templates/default/images/idle.gif"; 20 var img_busy = new Image(); 21 img_busy.src = im_path + "templates/default/images/busy.gif"; 22 var img_not_authorized = new Image(); 23 img_not_authorized.src = im_path + "templates/default/images/not_authorized.gif"; 24 var img_chat = new Image(); 25 img_chat.src = im_path + "templates/default/images/chat.gif"; 26 var img_open_box = new Image(); 27 img_open_box.src = im_path + "templates/default/images/open_box.gif"; 28 var img_close_box = new Image(); 29 img_close_box.src = im_path + "templates/default/images/close_box.gif"; 30 var img_photo = new Image(); 31 img_photo.src = im_path + "templates/default/images/photo.png"; 32 var img_menu = new Image(); 33 img_menu.src = im_path + "templates/default/images/menu.gif"; 34 var img_wait = new Image(); 35 img_wait.src = im_path + "templates/default/images/wait.gif"; 36 var img_wait_auth = new Image(); 37 img_wait_auth.src = im_path + "templates/default/images/wait_auth.gif"; 38 var img_chat_bubble = new Image(); 39 img_chat_bubble.src = im_path + "templates/default/images/chat_bubble.gif"; 40 var img_manutencao_im = new Image(); 41 img_manutencao_im.src = im_path + "templates/default/images/manutencao_im.png"; 4 var navbar = new Image(); 5 navbar.src = im_path + 'templates/default/images/navbar.png'; 6 var img_group_close = new Image(); 7 img_group_close.src = im_path + "templates/default/images/group_close.gif"; 8 var img_group_open = new Image(); 9 img_group_open.src = im_path + "templates/default/images/group_open.gif"; 10 var img_down = new Image(); 11 img_down.src = im_path + "templates/default/images/down.gif"; 12 var img_up = new Image(); 13 img_up.src = im_path + "templates/default/images/up.gif"; 14 var img_available = new Image(); 15 img_available.src = im_path + "templates/default/images/available.gif"; 16 var img_unavailable = new Image(); 17 img_unavailable.src = im_path + "templates/default/images/unavailable.gif"; 18 var img_busy = new Image(); 19 img_busy.src = im_path + "templates/default/images/busy.gif"; 20 var img_not_authorized = new Image(); 21 img_not_authorized.src = im_path + "templates/default/images/not_authorized.gif"; 22 var img_chat = new Image(); 23 img_chat.src = im_path + "templates/default/images/chat.gif"; 24 var img_open_box = new Image(); 25 img_open_box.src = im_path + "templates/default/images/open_box.gif"; 26 var img_close_box = new Image(); 27 img_close_box.src = im_path + "templates/default/images/close_box.gif"; 28 var img_photo = new Image(); 29 img_photo.src = im_path + "templates/default/images/photo.png"; 30 var img_menu = new Image(); 31 img_menu.src = im_path + "templates/default/images/menu.gif"; 32 var img_wait = new Image(); 33 img_wait.src = im_path + "templates/default/images/wait.gif"; 34 var img_chat_bubble = new Image(); 35 img_chat_bubble.src = im_path + "templates/default/images/chat_bubble.gif"; 36 var img_typing = new Image(); 37 img_typing.src = im_path + "templates/default/images/typing.gif"; 38 var img_edit = new Image(); 39 img_edit.src = im_path + "templates/default/images/img/icon_edit.gif"; 40 41 var img_xa = new Image(); 42 img_xa.src = im_path + "templates/default/images/xa.gif"; 43 var img_away = new Image(); 44 img_away.src = im_path + "templates/default/images/away.gif"; 45 var img_dnd = new Image(); 46 img_dnd.src = im_path + "templates/default/images/dnd.gif"; 42 47 43 // Smiles 44 var smile_1 = new Image();45 smile_1.src = im_path + "templates/default/images/img/smiles/1.gif"46 var smile_2 = new Image();47 smile_2.src = im_path + "templates/default/images/img/smiles/2.gif"48 var smile_3 = new Image();49 smile_3.src = im_path + "templates/default/images/img/smiles/3.gif"50 var smile_4 = new Image();51 smile_4.src = im_path + "templates/default/images/img/smiles/4.gif"52 var smile_5 = new Image();53 smile_5.src = im_path + "templates/default/images/img/smiles/5.gif"54 var smile_6 = new Image();55 smile_6.src = im_path + "templates/default/images/img/smiles/6.gif"56 var smile_7 = new Image();57 smile_7.src = im_path + "templates/default/images/img/smiles/7.gif"58 var smile_8 = new Image();59 smile_8.src = im_path + "templates/default/images/img/smiles/8.gif"60 var smile_9 = new Image();61 smile_9.src = im_path + "templates/default/images/img/smiles/9.gif"62 var smile_10 = new Image();63 smile_10.src = im_path + "templates/default/images/img/smiles/10.gif"64 var smile_11 = new Image();65 smile_11.src = im_path + "templates/default/images/img/smiles/11.gif"66 var smile_12 = new Image();67 smile_12.src = im_path + "templates/default/images/img/smiles/12.gif"68 var smile_13 = new Image();69 smile_13.src = im_path + "templates/default/images/img/smiles/13.gif"70 var smile_14 = new Image();71 smile_14.src = im_path + "templates/default/images/img/smiles/14.gif"72 var smile_15 = new Image();73 smile_15.src = im_path + "templates/default/images/img/smiles/15.gif"74 var smile_16 = new Image();75 smile_16.src = im_path + "templates/default/images/img/smiles/16.gif"76 var smile_17 = new Image();77 smile_17.src = im_path + "templates/default/images/img/smiles/17.gif"78 var smile_18 = new Image();79 smile_18.src = im_path + "templates/default/images/img/smiles/18.gif"80 var smile_19 = new Image();81 smile_19.src = im_path + "templates/default/images/img/smiles/19.gif"82 var smile_20 = new Image();83 smile_20.src = im_path + "templates/default/images/img/smiles/20.gif"84 var smile_21 = new Image();85 smile_21.src = im_path + "templates/default/images/img/smiles/21.gif"86 var smile_22 = new Image();87 smile_22.src = im_path + "templates/default/images/img/smiles/22.gif"88 var smile_23 = new Image();89 smile_23.src = im_path + "templates/default/images/img/smiles/23.gif"90 var smile_24 = new Image();91 smile_24.src = im_path + "templates/default/images/img/smiles/24.gif"92 var smile_25 = new Image();93 smile_25.src = im_path + "templates/default/images/img/smiles/25.gif"94 var smile_26 = new Image();95 smile_26.src = im_path + "templates/default/images/img/smiles/26.gif"96 var smile_27 = new Image();97 smile_27.src = im_path + "templates/default/images/img/smiles/27.gif"98 var smile_28 = new Image();99 smile_28.src = im_path + "templates/default/images/img/smiles/28.gif"100 var smile_29 = new Image();101 smile_29.src = im_path + "templates/default/images/img/smiles/29.gif"102 var smile_30 = new Image();103 smile_30.src = im_path + "templates/default/images/img/smiles/30.gif"104 var smile_31 = new Image();105 smile_31.src = im_path + "templates/default/images/img/smiles/31.gif"106 var smile_32 = new Image();107 smile_32.src = im_path + "templates/default/images/img/smiles/32.gif"108 var smile_33 = new Image();109 smile_33.src = im_path + "templates/default/images/img/smiles/33.gif"110 var smile_34 = new Image();111 smile_34.src = im_path + "templates/default/images/img/smiles/34.gif"112 var smile_35 = new Image();113 smile_35.src = im_path + "templates/default/images/img/smiles/35.gif"114 var smile_36 = new Image();115 smile_36.src = im_path + "templates/default/images/img/smiles/36.gif"116 var smile_37 = new Image();117 smile_37.src = im_path + "templates/default/images/img/smiles/37.gif"118 var smile_38 = new Image();119 smile_38.src = im_path + "templates/default/images/img/smiles/38.gif"120 var smile_39 = new Image();121 smile_39.src = im_path + "templates/default/images/img/smiles/39.gif"122 var smile_40 = new Image();123 smile_40.src = im_path + "templates/default/images/img/smiles/40.gif"124 var smile_41 = new Image();125 smile_41.src = im_path + "templates/default/images/img/smiles/41.gif"126 var smile_42 = new Image();127 smile_42.src = im_path + "templates/default/images/img/smiles/42.gif"128 var smile_43 = new Image();129 smile_43.src = im_path + "templates/default/images/img/smiles/43.gif"130 var smile_44 = new Image();131 smile_44.src = im_path + "templates/default/images/img/smiles/44.gif"132 var smile_45 = new Image();133 smile_45.src = im_path + "templates/default/images/img/smiles/45.gif"134 var smile_46 = new Image();135 smile_46.src = im_path + "templates/default/images/img/smiles/46.gif"136 var smile_47 = new Image();137 smile_47.src = im_path + "templates/default/images/img/smiles/47.gif"138 var smile_48 = new Image();139 smile_48.src = im_path + "templates/default/images/img/smiles/48.gif"140 var smile_49 = new Image();141 smile_49.src = im_path + "templates/default/images/img/smiles/49.gif"142 var smile_50 = new Image();143 smile_50.src = im_path + "templates/default/images/img/smiles/50.gif"144 var smile_51 = new Image();145 smile_51.src = im_path + "templates/default/images/img/smiles/51.gif"146 var smile_52 = new Image();147 smile_52.src = im_path + "templates/default/images/img/smiles/52.gif"148 var smile_53 = new Image();149 smile_53.src = im_path + "templates/default/images/img/smiles/53.gif"150 var smile_54 = new Image();151 smile_54.src = im_path + "templates/default/images/img/smiles/54.gif"48 49 var smile_1 = new Image(); 50 smile_1.src = im_path + "templates/default/images/img/smiles/1.gif" 51 var smile_2 = new Image(); 52 smile_2.src = im_path + "templates/default/images/img/smiles/2.gif" 53 var smile_3 = new Image(); 54 smile_3.src = im_path + "templates/default/images/img/smiles/3.gif" 55 var smile_4 = new Image(); 56 smile_4.src = im_path + "templates/default/images/img/smiles/4.gif" 57 var smile_5 = new Image(); 58 smile_5.src = im_path + "templates/default/images/img/smiles/5.gif" 59 var smile_6 = new Image(); 60 smile_6.src = im_path + "templates/default/images/img/smiles/6.gif" 61 var smile_7 = new Image(); 62 smile_7.src = im_path + "templates/default/images/img/smiles/7.gif" 63 var smile_8 = new Image(); 64 smile_8.src = im_path + "templates/default/images/img/smiles/8.gif" 65 var smile_9 = new Image(); 66 smile_9.src = im_path + "templates/default/images/img/smiles/9.gif" 67 var smile_10 = new Image(); 68 smile_10.src = im_path + "templates/default/images/img/smiles/10.gif" 69 var smile_11 = new Image(); 70 smile_11.src = im_path + "templates/default/images/img/smiles/11.gif" 71 var smile_12 = new Image(); 72 smile_12.src = im_path + "templates/default/images/img/smiles/12.gif" 73 var smile_13 = new Image(); 74 smile_13.src = im_path + "templates/default/images/img/smiles/13.gif" 75 var smile_14 = new Image(); 76 smile_14.src = im_path + "templates/default/images/img/smiles/14.gif" 77 var smile_15 = new Image(); 78 smile_15.src = im_path + "templates/default/images/img/smiles/15.gif" 79 var smile_16 = new Image(); 80 smile_16.src = im_path + "templates/default/images/img/smiles/16.gif" 81 var smile_17 = new Image(); 82 smile_17.src = im_path + "templates/default/images/img/smiles/17.gif" 83 var smile_18 = new Image(); 84 smile_18.src = im_path + "templates/default/images/img/smiles/18.gif" 85 var smile_19 = new Image(); 86 smile_19.src = im_path + "templates/default/images/img/smiles/19.gif" 87 var smile_20 = new Image(); 88 smile_20.src = im_path + "templates/default/images/img/smiles/20.gif" 89 var smile_21 = new Image(); 90 smile_21.src = im_path + "templates/default/images/img/smiles/21.gif" 91 var smile_22 = new Image(); 92 smile_22.src = im_path + "templates/default/images/img/smiles/22.gif" 93 var smile_23 = new Image(); 94 smile_23.src = im_path + "templates/default/images/img/smiles/23.gif" 95 var smile_24 = new Image(); 96 smile_24.src = im_path + "templates/default/images/img/smiles/24.gif" 97 var smile_25 = new Image(); 98 smile_25.src = im_path + "templates/default/images/img/smiles/25.gif" 99 var smile_26 = new Image(); 100 smile_26.src = im_path + "templates/default/images/img/smiles/26.gif" 101 var smile_27 = new Image(); 102 smile_27.src = im_path + "templates/default/images/img/smiles/27.gif" 103 var smile_28 = new Image(); 104 smile_28.src = im_path + "templates/default/images/img/smiles/28.gif" 105 var smile_29 = new Image(); 106 smile_29.src = im_path + "templates/default/images/img/smiles/29.gif" 107 var smile_30 = new Image(); 108 smile_30.src = im_path + "templates/default/images/img/smiles/30.gif" 109 var smile_31 = new Image(); 110 smile_31.src = im_path + "templates/default/images/img/smiles/31.gif" 111 var smile_32 = new Image(); 112 smile_32.src = im_path + "templates/default/images/img/smiles/32.gif" 113 var smile_33 = new Image(); 114 smile_33.src = im_path + "templates/default/images/img/smiles/33.gif" 115 var smile_34 = new Image(); 116 smile_34.src = im_path + "templates/default/images/img/smiles/34.gif" 117 var smile_35 = new Image(); 118 smile_35.src = im_path + "templates/default/images/img/smiles/35.gif" 119 var smile_36 = new Image(); 120 smile_36.src = im_path + "templates/default/images/img/smiles/36.gif" 121 var smile_37 = new Image(); 122 smile_37.src = im_path + "templates/default/images/img/smiles/37.gif" 123 var smile_38 = new Image(); 124 smile_38.src = im_path + "templates/default/images/img/smiles/38.gif" 125 var smile_39 = new Image(); 126 smile_39.src = im_path + "templates/default/images/img/smiles/39.gif" 127 var smile_40 = new Image(); 128 smile_40.src = im_path + "templates/default/images/img/smiles/40.gif" 129 var smile_41 = new Image(); 130 smile_41.src = im_path + "templates/default/images/img/smiles/41.gif" 131 var smile_42 = new Image(); 132 smile_42.src = im_path + "templates/default/images/img/smiles/42.gif" 133 var smile_43 = new Image(); 134 smile_43.src = im_path + "templates/default/images/img/smiles/43.gif" 135 var smile_44 = new Image(); 136 smile_44.src = im_path + "templates/default/images/img/smiles/44.gif" 137 var smile_45 = new Image(); 138 smile_45.src = im_path + "templates/default/images/img/smiles/45.gif" 139 var smile_46 = new Image(); 140 smile_46.src = im_path + "templates/default/images/img/smiles/46.gif" 141 var smile_47 = new Image(); 142 smile_47.src = im_path + "templates/default/images/img/smiles/47.gif" 143 var smile_48 = new Image(); 144 smile_48.src = im_path + "templates/default/images/img/smiles/48.gif" 145 var smile_49 = new Image(); 146 smile_49.src = im_path + "templates/default/images/img/smiles/49.gif" 147 var smile_50 = new Image(); 148 smile_50.src = im_path + "templates/default/images/img/smiles/50.gif" 149 var smile_51 = new Image(); 150 smile_51.src = im_path + "templates/default/images/img/smiles/51.gif" 151 var smile_52 = new Image(); 152 smile_52.src = im_path + "templates/default/images/img/smiles/52.gif" 153 var smile_53 = new Image(); 154 smile_53.src = im_path + "templates/default/images/img/smiles/53.gif" 155 var smile_54 = new Image(); 156 smile_54.src = im_path + "templates/default/images/img/smiles/54.gif" -
trunk/instant_messenger/js/im_init.js
r20 r55 1 // Instant Messenger 2 // im_init.js 3 4 function _init_jabber() 1 function init_jabber() 2 { 3 try 5 4 { 6 try 7 { 8 if ( window.IM ) 9 { 10 setTimeout('IM.atalho()', 6000); 11 setTimeout('IM.load_im(true)', 6200); 12 } 13 else 14 setTimeout('_init_jabber()', 2000); 15 } 16 catch(e) 17 { 18 setTimeout('_init_jabber()', 2000); 19 } 5 if ( window.IM ) 6 IM.load_im(); 7 else 8 setTimeout('init_jabber()', 2000); 20 9 } 21 22 var _date = new Date(); 23 var _time = '?' + _date.getTime(); 24 var js_path = im_path + "js/"; 25 var css_path = im_path + "templates/default/"; 26 // conn = new cConnector(); 27 28 function init_jabber() 10 catch(e) 29 11 { 30 //alert('inicio - im_path: ' + im_path); 31 32 /* CSS's */ 33 new_css = new Array(); 34 new_css[0] = css_path + 'css.css' + _time; 35 new_css[1] = css_path + 'messenger.css'; 36 /* JS's 37 * 38 * escritos pelo arquivo index2.php para que 39 * seja sobrescrito o cache apenas quando há 40 * alteração no conteúdo dos scripts 41 * 42 */ 43 44 for ( i = 0; i < new_css.length; i++ ) IM_loadCss(new_css[i]); 45 for ( i = 0; i < new_js.length; i++ ) setTimeout('IM_loadScript(\'' + (new_js[i] + _time) + '\')', (650 * (i+1))); 46 47 _init_jabber(); 12 setTimeout('init_jabber()', 2000); 48 13 } 49 50 function add_head(pElement) 51 { 52 _head = document.getElementsByTagName('head').item(0); 53 _head.appendChild(pElement); 54 } 55 56 function IM_loadCss(pName) 57 { 58 _css = document.createElement('link'); 59 _css.setAttribute('rel', 'stylesheet'); 60 //_css.setAttribute('type', 'text/css'): 61 _css.setAttribute('href', pName + _time); 62 add_head(_css); 63 } 64 65 function load_script(pName) 66 { 67 _script = document.createElement('script'); 68 _script.setAttribute('src', pName); 69 _script.setAttribute('type', 'text/javascript'); 70 add_head(_script);/**/ 71 } 72 //im_win.load(); 73 setTimeout('init_jabber()', 5000) 14 } 15 init_jabber(); -
trunk/instant_messenger/js/im_menu_action.js
r20 r55 10 10 try 11 11 { 12 pElement = arguments[0];12 var pElement = arguments[0]; 13 13 delete arguments[0]; 14 pMenu = ( func.isString(arguments[1]) ) ? arguments[1] : arguments;14 var pMenu = ( func.isString(arguments[1]) ) ? arguments[1] : arguments; 15 15 if ( document.getElementById(pElement).innerHTML == "" ) 16 16 { 17 17 func.confEl(pElement, 'style', 'display:block;'); 18 var _this = this; 19 _this.layout(pMenu, pElement); 18 this.layout(pMenu, pElement); 20 19 } 21 20 else … … 36 35 var el_dest_ = ( func.isString(pElement) ) ? func.byId(pElement) : pElement; 37 36 var div_menu = func.newEl("div"); 38 func.confEl(div_menu, 'id', 'div_pref'); 39 func.confEl(div_menu, 'style', 'padding:0px;position:absolute;padding:0px;'); 40 div_menu.style.Zindex = "150"; 37 func.confEl(div_menu, 'style', 'padding:0px;border:1px solid #809aa9'); 41 38 div_menu.onmouseover = function(){_this.clear_delayhide();}; 42 39 div_menu.onmouseout = function(){_this.resetit(pElement);}; 43 40 if ( func.isString(pHtml) ) 44 45 41 div_menu.innerHTML = pHtml; 42 else 46 43 for ( i = 1; i < pHtml.length; i++ ) 47 44 func.insEl(pHtml[i], div_menu); 48 45 49 46 func.insEl(div_menu, el_dest_); 50 47 this.delayhide = setTimeout("im_menu_action.del_innerHTML('"+pElement+"')", 2000); … … 62 59 this.delayhide = setTimeout("im_menu_action.del_innerHTML('"+pElement+"')",this.delay_hide); 63 60 }, 64 61 65 62 "clear_delayhide" : function() 66 63 { -
trunk/instant_messenger/js/im_preferences.js
r41 r55 2 2 // im_preferences.js 3 3 4 function Preferences()4 function IM_Preferences() 5 5 { 6 6 this.save_vcard = ""; 7 this.jid = false; 7 8 } 8 9 … … 11 12 */ 12 13 13 Preferences.prototype.Add_userLoad = function()14 IM_Preferences.prototype.Add_userLoad = function() 14 15 { 15 16 Templates.add_user(); … … 19 20 } 20 21 21 Preferences.prototype.SearchOrganizationsLdap = function() 22 { 23 var handler_organizations = function(data){ 22 IM_Preferences.prototype.SearchOrganizationsLdap = function() 23 { 24 var handler_organizations = function(data) 25 { 26 var data = func.interface(data); 24 27 var select_org = document.getElementById('ImSelOrg'); 25 28 if(select_org.options.length > 0) … … 34 37 select_org[0].selected = true; 35 38 } 36 cIM.cExecute("$this.ldap_im.list_organizations_ldap",handler_organizations);37 } 38 39 Preferences.prototype.SearchContacts = function()39 XMLTools.request('$this.ldap_im.list_organizations_ldap','POST',handler_organizations); 40 } 41 42 IM_Preferences.prototype.SearchContacts = function() 40 43 { 41 44 var select_org = document.getElementById('ImSelOrg'); 42 var select_contact = document.getElementById('ImSelAddContact');43 45 var organization = ""; 44 46 var span_load = document.getElementById('_span_load_im'); 45 span_load.style. visibility = "visible";46 47 span_load.style.display = "block"; 48 47 49 for(var i=0; i < select_org.options.length; i++){ 48 50 if(select_org.options[i].selected == true){ … … 50 52 } 51 53 } 52 var handler_contacts = function(data){ 54 var handler_contacts = function(data) 55 { 56 var data = func.interface(data); 53 57 var select_contact = document.getElementById('ImSelAddContact'); 54 58 var text0 = document.getElementById('text0'); … … 58 62 text0.value = ""; 59 63 text1.value = ""; 60 61 if( data.length > 0 ){ 62 for(var i in data){ 63 if(data[i].cn != ""){ 64 var options = new Option(data[i].cn + " ( "+ data[i].mail + " )", data[i].mail + ";" + data[i].uid, false, false); 65 select_contact[select_contact.length] = options; 66 } 64 if(data){ 65 for(var i in data) 66 { 67 var options = new Option(data[i].cn + " ( "+ data[i].mail + " )", data[i].mail + ";" + data[i].uid, false, false); 68 select_contact[select_contact.length] = options; 67 69 } 68 70 } 69 70 span_load.style.visibility = "hidden"; 71 } 72 cIM.cExecute("$this.contacts_im.list_contacts", handler_contacts,"ou="+organization); 73 74 } 75 76 Preferences.prototype.preenche = function() 71 span_load.style.display = "none"; 72 } 73 XMLTools.request('$this.contacts_im.list_contacts','POST',handler_contacts, 'ou='+organization); 74 } 75 76 IM_Preferences.prototype.preenche = function() 77 77 { 78 78 var select = document.getElementById('ImSelAddContact'); … … 83 83 var uid = select.options[i].value.substr((select.options[i].value.indexOf(';')+1),select.options[i].value.length); 84 84 document.getElementById('text0').value = email; 85 document.getElementById('text1').value = email.substr(0,email.indexOf('@'));86 document.getElementById('text2').focus(); 87 document.getElementById('text3').value = uid; 85 document.getElementById('text1').value = select.options[i].value.substr(0,select.options[i].value.indexOf('@')); 86 document.getElementById('text2').focus(); 87 document.getElementById('text3').value = uid; 88 88 } 89 89 } … … 91 91 } 92 92 93 Preferences.prototype.Add_user = function(pFunc)93 IM_Preferences.prototype.Add_user = function(pFunc) 94 94 { 95 95 var text0 = document.getElementById('text0'); 96 96 var text1 = document.getElementById('text1'); 97 97 var text2 = document.getElementById('text2'); 98 var text3 = ( document.getElementById('text3') != null) ? document.getElementById('text3') : false;99 98 var text3 = ( document.getElementById('text3') != null ) ? document.getElementById('text3') : false; 99 100 100 var _this = this; 101 101 var jid = text0.value; 102 102 var subscription = ""; 103 103 104 if(func.trim(text0.value) != "" && func.trim(text1.value) != "" && func.trim(text2.value) != ""){ 105 var handler_add_contact = function(data){ 106 if(data){ 107 text0.value = ""; 108 text1.value = ""; 109 text2.value = ""; 110 if(pFunc != 'divAddUser_im') 104 if(func.trim(text0.value) != "" && func.trim(text1.value) != "" && func.trim(text2.value) != "") 105 { 106 var handler_add_contact = function(data) 107 { 108 IM.vcards = false; 109 IM.requireVcard(); 110 111 text0.value = ""; 112 text1.value = ""; 113 text2.value = ""; 114 if(pFunc != 'divAddUser_im') 115 { 116 if(document.getElementById('im_cell_' + jid)) 117 { 118 var div_jid = document.getElementById('im_cell_' + jid); 119 div_jid.parentNode.removeChild(div_jid); 120 121 for(var i in IM.UsersNot) 122 if( IM.UsersNot[i] === jid ) 123 IM.UsersNot.splice(i,1); 124 111 125 im_win.windowClose(pFunc); 112 IM.UpdateContacts(); 113 _this.Refresh_Screen(jid); 126 Subscription.subscribed(jid); 127 IM.setStatus(statusFlag); 128 setTimeout('Subscription.subscribe("'+jid+'")',2000); 129 } 114 130 } 115 } 116 var name = url_encode(encodeURI(text1.value)); 117 var group = url_encode(encodeURI(text2.value)); 118 if(pFunc == 'divAddUser_im') 119 subscription = "none"; 120 else 121 subscription = "to"; 131 132 if( IM.UsersNot.length == 0 ) 133 im_win.windowClose('divFormAuthUser_im'); 134 } 135 var name = text1.value; 136 var group = text2.value; 122 137 if(text3){ 123 138 var email = text3.value + "@" + text0.value.substr((text0.value.indexOf('@')+1),text0.value.length); … … 125 140 var email = text0.value; 126 141 } 127 cIM.cExecute("$this.Ujabber.AddNewContacts",handler_add_contact,"email="+email+"&name="+name+"&group="+group+"&subscription="+subscription);142 XMLTools.request('$this.Ujabber.addContacts','POST',handler_add_contact,"email="+email+"&name="+name+"&group="+group); 128 143 }else{ 129 144 alert("Informe todos os campos!"); 130 145 } 131 146 } 147 148 IM_Preferences.prototype.AcceptRequestUser = function(pJid) 149 { 150 Templates.AcceptRequestUser(); 151 document.getElementById('text0').value = pJid; 152 document.getElementById('text1').value = pJid.substr(0,pJid.indexOf('@')); 153 document.getElementById('text1').focus(); 154 document.getElementById('text1').select(); 155 document.getElementById('span0').innerHTML = pJid.substr(0,pJid.indexOf('@')); 156 } 132 157 133 158 /* 134 159 * Remove 135 160 */ 136 137 Preferences.prototype.Remove_userLoad = function() 161 162 IM_Preferences.prototype.RemoveContact = function(pJid) 163 { 164 var _this = this; 165 if(!pJid) 166 { 167 var sel_box = document.getElementById('sel_contact'); 168 for(var i=0; i < sel_box.options.length; i++) 169 { 170 if(sel_box[i].selected && sel_box.options[i].value != 0) 171 pJid = sel_box.options[i].value; 172 } 173 } 174 if( pJid ) 175 { 176 if( confirm('Deseja remover o contato : ' + pJid) ) 177 { 178 IM.vcards = false; 179 IM.requireVcard(); 180 var div_child = document.getElementById(pJid); 181 div_child.parentNode.removeChild(div_child); 182 _this.ComboRemoveUser(_this.LoadJids()); 183 var handler_remove_contact = function(data) 184 { 185 }; 186 XMLTools.request('$this.Ujabber.removeContact','POST',handler_remove_contact,"jid="+pJid); 187 } 188 }else 189 alert('Opção inválida !!'); 190 } 191 192 IM_Preferences.prototype.Remove_userLoad = function() 138 193 { 139 194 Templates.remove_user(); 140 var sel_contact = document.getElementById('sel_contact'); 141 if(sel_contact.options.length > 0) 142 sel_contact.options.splice(0,sel_contact.options.length); 143 var opt = new Option("-- "+IM.get_lang('Choice Contact')+" -- ","0",true,true); 144 sel_contact.options[sel_contact.length] = opt; 145 146 for(var i=1; i < IM.array_users.length; i++){ 147 if(decodeURI(IM.array_users[i].name) != ""){ 148 opt = new Option(decodeURI(IM.array_users[i].name),IM.array_users[i].jid, false, false); 149 sel_contact.options[sel_contact.length] = opt; 150 }else{ 151 name = IM.array_users[i].jid.substr(0,IM.array_users[i].jid.indexOf('@')); 152 opt = new Option(name,IM.array_users[i].jid, false, false); 153 sel_contact.options[sel_contact.length] = opt; 154 } 155 } 156 } 157 158 Preferences.prototype.Remove_user = function() 159 { 195 var div_allg = document.getElementById('all_groups'); 160 196 var _this = this; 161 var sel_contact = document.getElementById('sel_contact'); 162 for(var i=0; i < sel_contact.options.length; i++){ 163 if(sel_contact[i].selected && sel_contact.options[i].value != 0){ 164 if(confirm("Excluir o contato " + sel_contact.options[i].innerHTML + "?")){ 165 var in_el = sel_contact.options[i].innerHTML; 166 for(var j=1 ; j < IM.array_users.length; j++){ 167 var name = IM.array_users[j].jid.substr(0,IM.array_users[j].jid.indexOf('@')); 168 if(decodeURI(IM.array_users[j].name) == in_el || name == in_el){ 169 var handler_remove_contact = function(data){ 170 if(!data){ 171 alert(data); 172 return false; 173 } 174 setTimeout("IM.UpdateContacts()",1000); 175 } 176 cIM.cExecute("$this.Ujabber.RosterRemoveUser",handler_remove_contact,"jid="+sel_contact.options[i].value); 177 IM.array_users.splice(j,1); 178 _this.ComboRemove(); 179 j--; 180 } 181 } 197 _this.ComboRemoveUser(_this.LoadJids()); 198 } 199 200 IM_Preferences.prototype.ComboRemoveUser = function(pJids) 201 { 202 var sel_box = document.getElementById('sel_contact'); 203 204 if( document.getElementById('sel_contact') != null ) 205 { 206 if( sel_box.options.length > 0 ) 207 { 208 for(var i=0; i < sel_box.options.length; i++) 209 { 210 sel_box.options[i] = null; 211 i--; 182 212 } 183 213 } 184 } 185 } 186 187 Preferences.prototype.ComboRemove = function() 188 { 189 var sel_contact = document.getElementById('sel_contact'); 190 if(sel_contact.length > 0 ){ 191 for(var i=0; i < sel_contact.options.length; i++){ 192 sel_contact.options[i] = null; 193 i--; 194 } 195 } 196 197 var opt = new Option("-- "+IM.get_lang('Choice Contact')+" -- ","0",true,true); 198 sel_contact.options[sel_contact.length] = opt; 199 for(var i=1; i < IM.array_users.length; i++){ 200 opt = new Option(decodeURI(IM.array_users[i].name),IM.array_users[i].jid, false, false); 201 sel_contact.options[sel_contact.length] = opt; 202 } 203 } 204 205 Preferences.prototype.Remove_Contact = function(pJid) 206 { 207 var _this = this; 208 for(var i=0; i < IM.array_users.length; i++){ 209 if(IM.array_users[i].jid == pJid){ 210 if(confirm("Excluir o contato " + decodeURI(IM.array_users[i].name) + "?")){ 211 var handler_remove_contact = function(data){ 212 if(!data){ 213 alert(data); 214 return; 215 }else{ 216 _this.Refresh_Screen(pJid); 217 IM.UpdateContacts(); 218 } 219 } 220 cIM.cExecute("$this.Ujabber.RosterRemoveUser",handler_remove_contact,"jid="+pJid); 221 } 222 return; 223 } 224 } 225 } 226 214 215 var opt = new Option('--- Selecione ---',0,false,true); 216 sel_box[sel_box.length] = opt; 217 for(var i in pJids) 218 { 219 var opt = new Option(pJids[i], pJids[i], false, true); 220 sel_box[sel_box.length] = opt; 221 } 222 sel_box[0].selected = true; 223 } 224 } 225 226 IM_Preferences.prototype.DenyRequestUser = function(pJid) 227 { 228 if(confirm('Deseja excluir ' + pJid + '?')) 229 { 230 var div_jid = document.getElementById('im_cell_' + pJid); 231 div_jid.parentNode.removeChild(div_jid); 232 233 for(var i in IM.UsersNot) 234 if(IM.UsersNot[i] === pJid) 235 IM.UsersNot.splice(i,1); 236 237 if( IM.UsersNot.length == 0 ) 238 im_win.windowClose('divFormAuthUser_im'); 239 240 var handler_denyrequest = function(data) 241 { 242 }; 243 XMLTools.request('$this.Ujabber.unsubscribe','POST',handler_denyrequest,'jid='+pJid); 244 } 245 } 246 247 /* 248 * LoadJids 249 */ 250 251 IM_Preferences.prototype.LoadJids = function() 252 { 253 var div_allg = document.getElementById('all_groups'); 254 var elements = div_allg.firstChild; 255 var jids = []; 256 while ( elements ) 257 { 258 var childs = elements.firstChild; 259 while( childs ) 260 { 261 if(childs.tagName == "DIV") 262 jids[jids.length] = childs.id; 263 childs = childs.nextSibling; 264 } 265 elements = elements.nextSibling; 266 } 267 jids.sort(); 268 269 return jids; 270 } 271 227 272 /* 228 273 * Update 229 274 */ 230 275 231 Preferences.prototype.updateLoad = function(pJid)276 IM_Preferences.prototype.Update_ = function(pJid,pType) 232 277 { 233 Jid = pJid; 234 Templates.update_user(); 235 document.getElementById('text0').value = Jid; 236 document.getElementById('span0').innerHTML = Jid.substr(0,Jid.indexOf('@')); 278 var div_child = document.getElementById(pJid); 279 var name = div_child.innerHTML.substr((div_child.innerHTML.indexOf('>') + 1 ),div_child.innerHTML.length); 280 var group = div_child.parentNode.id; 281 282 if(pType) 283 { 284 var action = prompt('Digite um novo apelido para : ' + pJid ); 285 name = action; 286 }else{ 287 var action = prompt('Digite um novo grupo para : ' + pJid ); 288 group = action; 289 } 290 291 if( action != "" && action != null) 292 { 293 var handler_update_contact = function(XMLdata) 294 { 295 }; 296 XMLTools.request('$this.Ujabber.updateContact','POST',handler_update_contact,"jid="+pJid+"&name="+name+"&group="+group); 297 } 298 237 299 } 238 239 Preferences.prototype.Update_ = function(pJid,pType) 240 { 241 var name = ""; 242 var group = ""; 243 var jid = pJid; 244 245 for(var i=1; i < IM.array_users.length; i++){ 246 if(IM.array_users[i].jid == pJid){ 247 name = decodeURI(IM.array_users[i].name); 248 group = decodeURI(IM.array_users[i].group); 249 } 250 } 251 252 if((name != "") && (group != "")){ 253 if(pType){ 254 var act = prompt("Digite um apelido para :" + pJid , name); 255 name = url_encode(encodeURI(act)); 256 group = url_encode(encodeURI(group)); 257 }else{ 258 var act = prompt("Digite um novo grupo para : " + name, group); 259 group = url_encode(encodeURI(act)); 260 name = url_encode(encodeURI(name)); 261 } 262 if((act != null) && (act != "")){ 263 var handler_update_contacts = function(data){ 264 if(data) 265 IM.UpdateContacts(); 266 else 267 alert("erro"); 268 } 269 cIM.cExecute("$this.Ujabber.UpdateUser",handler_update_contacts,"jid="+jid+"&name="+name+"&group="+group); 270 } 271 } 272 } 273 274 Preferences.prototype.Update_Group = function(pJid) 300 301 IM_Preferences.prototype.Update_Group = function(pJid) 275 302 { 276 303 this.Update_(pJid,false); 277 304 } 278 305 279 Preferences.prototype.Update_NickName = function(pJid)306 IM_Preferences.prototype.Update_NickName = function(pJid) 280 307 { 281 308 this.Update_(pJid,true); … … 285 312 * Vcard 286 313 */ 287 288 Preferences.prototype.vCardLoad = function() 289 { 290 Templates.information_user(); 291 document.getElementById('FN').value = IM.vcard_user['VCARD_FN']; 292 document.getElementById('NICKNAME').value = IM.vcard_user['VCARD_NICKNAME']; 293 document.getElementById('ORGNAME').value = IM.vcard_user['VCARD_ORGNAME']; 294 document.getElementById('ORGUNIT').value = IM.vcard_user['VCARD_ORGUNIT']; 295 document.getElementById('ROLE').value = IM.vcard_user['VCARD_ROLE']; 296 document.getElementById('BDAY').value = IM.vcard_user['VCARD_BDAY']; 297 document.getElementById('DESC').value = IM.vcard_user['VCARD_DESC']; 298 } 299 300 Preferences.prototype.vCardAdd = function() 314 315 IM_Preferences.prototype.vCardInit = function() 301 316 { 302 317 var _this = this; 303 IM.vcard_user['VCARD_FN'] = document.getElementById('FN').value; 304 _this.save_vcard = url_encode(encodeURI(document.getElementById('FN').value)) + ";"; 305 IM.vcard_user['VCARD_NICKNAME'] = document.getElementById('NICKNAME').value; 306 _this.save_vcard += url_encode(encodeURI(document.getElementById('NICKNAME').value)) + ";"; 307 var nickname = document.getElementById('span_nickname').innerHTML; 308 document.getElementById('span_nickname').innerHTML = (IM.vcard_user['VCARD_NICKNAME']) ? "<b> " + IM.vcard_user['VCARD_NICKNAME'].substring(0,30) + "</b>" : nickname; 309 IM.vcard_user['VCARD_ORGNAME'] = document.getElementById('ORGNAME').value; 310 _this.save_vcard += url_encode(encodeURI(document.getElementById('ORGNAME').value)) + ";"; 311 IM.vcard_user['VCARD_ORGUNIT'] = document.getElementById('ORGUNIT').value; 312 _this.save_vcard += url_encode(encodeURI(document.getElementById('ORGUNIT').value)) + ";"; 313 IM.vcard_user['VCARD_ROLE'] = document.getElementById('ROLE').value; 314 _this.save_vcard += url_encode(encodeURI(document.getElementById('ROLE').value)) + ";"; 315 IM.vcard_user['VCARD_BDAY'] = document.getElementById('BDAY').value; 316 _this.save_vcard += url_encode(encodeURI(document.getElementById('BDAY').value)) + ";"; 317 IM.vcard_user['VCARD_DESC'] = document.getElementById('DESC').value; 318 _this.save_vcard += url_encode(encodeURI(document.getElementById('DESC').value)); 319 var message_desc = document.getElementById('span_message').innerHTML; 320 document.getElementById('span_message').innerHTML = (IM.vcard_user['VCARD_DESC']) ? "<b> " + IM.vcard_user['VCARD_DESC'].substring(0,30) + "</b>" : message_desc ; 321 322 var handler_vcardAdd = function(data){ 323 if(!data) 324 alert(data); 318 var handler_getId = function(_XMLdata) 319 { 320 var jid = _XMLdata.getElementsByTagName("retorno").item(0); 321 jid = jid.firstChild.nodeValue; 322 323 _this.jid = jid; 324 325 var NickName = document.getElementById('span_nickname'); 326 var Message = document.getElementById('span_message'); 327 var vcards = _this.vCardLoad(jid); 328 329 NickName.innerHTML = "<b> " + IM.get_lang('your nickname') + "</b>"; 330 Message.innerHTML = "<b> " + IM.get_lang('your message') + "</b>"; 331 332 for(var i in vcards) 333 { 334 var tag_name = vcards[i].substr(0,vcards[i].indexOf('|')); 335 var tag_value = vcards[i].substr((vcards[i].indexOf('|')+1),vcards[i].length); 336 337 if( tag_name === "NICKNAME") 338 NickName.innerHTML = "<b> " + decodeURI(tag_value.substring(0,15)) + "</b>"; 339 340 if( tag_name === "DESC" ) 341 Message.innerHTML = "<b> " + decodeURI(tag_value.substring(0,20)) + "...</b>"; 342 } 343 } 344 XMLTools.request('$this.Ujabber.getJid','GET',handler_getId); 345 346 } 347 348 IM_Preferences.prototype.vCardLoad = function(Jid) 349 { 350 var div_jid = document.getElementById("vcard_" + Jid); 351 var array_el = []; 352 var elements = div_jid.firstChild; 353 while ( elements ) 354 { 355 if(elements.tagName != undefined && elements.tagName.substr(0,1) != "/" ) 356 { 357 array_el[array_el.length] = elements.tagName + "|" + elements.innerHTML; 358 } 359 elements = elements.nextSibling; 360 } 361 return array_el; 362 } 363 364 IM_Preferences.prototype.vCard = function() 365 { 366 if(!this.jid){ 367 alert('Carregando !!'); 368 }else{ 369 370 Templates.information_user(); 371 var vcards = new Array(); 372 vcards = this.vCardLoad(this.jid); 373 374 for(var i in vcards) 375 { 376 var tag_name = vcards[i].substr(0,vcards[i].indexOf('|')); 377 var tag_value = vcards[i].substr((vcards[i].indexOf('|')+1),vcards[i].length); 378 if(tag_name) 379 document.getElementById(tag_name).value = decodeURI(tag_value); 380 } 381 } 382 } 383 384 IM_Preferences.prototype.vCardLoad_Contact = function(pJid) 385 { 386 if(!this.jid){ 387 alert('Carregando !!'); 388 }else{ 389 Templates.information_Contact(); 390 var vcards = new Array(); 391 vcards = this.vCardLoad(pJid); 392 393 for(var i in vcards) 394 { 395 var tag_name = vcards[i].substr(0,vcards[i].indexOf('|')); 396 var tag_value = vcards[i].substr((vcards[i].indexOf('|')+1),vcards[i].length); 397 if(document.getElementById('_lbl_' + tag_name) != null) 398 document.getElementById('_lbl_' + tag_name).innerHTML = tag_value; 399 } 400 } 401 } 402 403 IM_Preferences.prototype.vCardAdd = function() 404 { 405 var el_vcard = new Array('FN','NICKNAME','ROLE','ORGNAME','ORGUNIT','BDAY','DESC'); 406 var vcard = ""; 407 var value = ""; 408 var div_jid = document.getElementById("vcard_" + this.jid); 409 var elements = div_jid.firstChild; 410 411 for(var i in el_vcard) 412 { 413 value = ( document.getElementById(el_vcard[i]).value ) ? document.getElementById(el_vcard[i]).value : ""; 414 if( elements.tagName == el_vcard[i] && value != "") 415 { 416 if( el_vcard[i] === 'NICKNAME' ) 417 document.getElementById('span_nickname').innerHTML = "<b> " + value.substring(0,15) + "</b>"; 418 if( el_vcard[i] === 'DESC' ) 419 document.getElementById('span_message').innerHTML = "<b> " + value.substring(0,20) + "...</b>"; 420 elements.innerHTML = value; 421 } 422 elements = elements.nextSibling; 423 vcard += value + "_vkrd_"; 424 } 425 426 vcard = vcard.substr(0,vcard.length - 6 ); 427 428 var handler_vcard_add = function(XMLdata) 429 { 430 }; 431 XMLTools.request('$this.Ujabber.newVcard','POST',handler_vcard_add,"vcard="+escape(vcard)); 432 alert('Informações Cadastradas / Adicionads !!!'); 433 } 434 435 /* 436 * IM_Preferences 437 */ 438 439 IM_Preferences.prototype.yourPreferences = function() 440 { 441 Templates.yourPreferences(); 442 } 443 444 IM_Preferences.prototype.SetYourPreferences = function() 445 { 446 var preferences = ""; 447 preferences = ( func.byId('ch_offline').checked ) ? 'ch_offline:true;' : 'ch_offline:false;'; 448 if( func.byId('in_time').value ) 449 { 450 var numbers = /^\d+$/; 451 if(numbers.test(func.byId('in_time').value)) 452 var minutes = func.byId('in_time').value; 325 453 else 326 alert("Informações Cadastradas / Atualizadas !"); 327 } 328 cIM.cExecute("$this.Ujabber.newVcard",handler_vcardAdd,"vcard="+_this.save_vcard); 329 } 330 331 Preferences.prototype.vCardLoad_Contact = function(pJid) 332 { 333 Templates.information_Contact(); 334 for(var i=0; i < IM.array_users.length; i++){ 335 if(IM.array_users[i].jid == pJid){ 336 document.getElementById('_lbl_FN').innerHTML = decodeURI(IM.array_users[i].VCARD_FN); 337 document.getElementById('_lbl_Nickname').innerHTML = decodeURI(IM.array_users[i].VCARD_NICKNAME); 338 document.getElementById('_lbl_Orgunit').innerHTML = decodeURI(IM.array_users[i].VCARD_ORGUNIT); 339 document.getElementById('_lbl_Role').innerHTML = decodeURI(IM.array_users[i].VCARD_ROLE); 340 document.getElementById('_lbl_Birthday').innerHTML = decodeURI(IM.array_users[i].VCARD_BDAY); 341 return; 342 } 454 { 455 alert('Informe valores numéricos'); 456 func.byId('in_time').focus(); 457 return false; 458 } 459 } 460 IM.im_time_ = func.byId('in_time').value; 461 preferences += ( func.trim(func.byId('in_time').value )) ? 'in_time:' + func.byId('in_time').value + ";" : 'in_time:0;'; 462 preferences += ( func.byId('rd_nm').checked ) ? 'rd_nm:true;' : 'rd_nm:false;'; 463 preferences += ( func.byId('rd_ch').checked ) ? 'rd_ch:true' : 'rd_ch:false'; 464 IM.userPrefe = preferences; 465 466 var handler_preferences = function(XMLdata) 467 { 468 var data = XMLdata.getElementsByTagName('retorno').item(0); 469 data = eval(data.firstChild.nodeValue); 470 if(data) 471 { 472 IM.Contacts_Offline(); 473 alert('Preferências salvas !'); 474 } 475 }; 476 XMLTools.request('$this.db_im.set_preferences','POST',handler_preferences,'preferences='+preferences); 477 } 478 479 IM_Preferences.prototype.GetYourPreferences = function() 480 { 481 if(!IM.userPrefe) 482 { 483 var handler_getPreferences = function(XMLdata) 484 { 485 var data = XMLdata.getElementsByTagName('retorno').item(0); 486 data = data.firstChild.nodeValue; 487 IM.userPrefe = data; 488 IM.im_time_ = this.LoadPreferences('ch_offline'); 489 } 490 XMLTools.request('$this.db_im.get_preferences','POST',handler_getPreferences); 491 } 492 } 493 494 IM_Preferences.prototype.LoadPreferences = function(pElement) 495 { 496 var preferences_im = IM.userPrefe; 497 498 while( preferences_im !== "") 499 { 500 var values = ""; 501 var value = ""; 502 if(value = preferences_im.substr(0,preferences_im.indexOf(';'))) 503 { 504 values = value + '\n'; 505 preferences_im = preferences_im.replace(value,''); 506 } 507 if(preferences_im.substr(0,1) == ";"){ 508 preferences_im = preferences_im.substr(1,preferences_im.length); 509 }else{ 510 values = preferences_im + '\n'; 511 preferences_im = ''; 512 } 513 514 var ele = values.substr(0,values.indexOf(':')); 515 var val = values.substr((values.indexOf(':')+1),values.length); 516 517 if(ele == pElement) 518 return val; 519 520 if((document.getElementById(ele)!= null) && (document.getElementById(ele).type == 'text')) 521 document.getElementById(ele).value = val; 522 else 523 if(document.getElementById(ele) != null) 524 document.getElementById(ele).checked = eval(val); 343 525 } 344 526 } … … 348 530 */ 349 531 350 Preferences.prototype.Info_Contact = function(pJid)532 IM_Preferences.prototype.Info_Contact = function(pJid) 351 533 { 352 534 var element = "_span_not_" + pJid; 353 var pElement = "teste";354 535 var uid = pJid.substr(0,pJid.indexOf('@')); 355 356 var handler_ldap = function(data){ 357 358 if(data){ 359 var form_details = '<table cellpadding="0" cellspacing="0" style="background-color:#cbdae4;width:80%;border:1px solid #809aa9">' + 360 '<tr><td style="vertical-align:top;width:80%">' + 361 '<div style="padding-bottom">' + 362 '<span><label>'+IM.get_lang('Name')+'</label></br>'+ data[0].cn + '</span></br></br>' + 363 '<span><label>'+IM.get_lang('E-mail')+'</label></br>'+ data[0].mail + '</span></br>' + 364 '</div></td>' + 365 '<td style="vertical-align:top"><img id="' + pJid + '_avatar" src="' + img_photo.src + '" style="height:65px;width:60px;align:right">' + 366 '</td></tr>'+ 367 '</table>'; 368 369 im_menu_action.menu(element, form_details); 370 536 var handler_ldap = function(data) 537 { 538 var data = func.interface(data); 539 var XMLinfoLdap = ""; 540 if(data) 541 { 542 XMLinfoLdap = '<info_user>'; 543 for(var i in data) 544 XMLinfoLdap += '<item lang_name="'+IM.get_lang('Name')+'" name="'+ data[i].cn +'" lang_email="'+IM.get_lang('E-mail')+'" email="'+ data[i].mail +'" />'; 545 XMLinfoLdap += '</info_user>'; 546 } 547 im_menu_action.menu(element, parse_XmlXsl(XMLinfoLdap,'info_contact_ldap.xsl')); 548 if(document.getElementById('im_span_avatar') != null) 549 { 550 var span = document.getElementById('im_span_avatar'); 551 var img = func.newEl('img'); 552 func.confEl(img, 'id', pJid + '_avatar'); 553 func.confEl(img, 'src', img_photo.src); 554 func.confEl(img, 'style', 'height:65px;width:60px;align:right;'); 555 span.appendChild(img); 371 556 // Foto Ldap; 372 557 im_win.get_photo_ldap(pJid); 373 558 } 374 559 } 375 cIM.cExecute("$this.ldap_im.info_user",handler_ldap,"uid="+uid); 376 377 560 XMLTools.request('$this.ldap_im.info_user','POST',handler_ldap,'uid='+uid); 378 561 } 379 562 … … 382 565 */ 383 566 384 Preferences.prototype.SendFile = function(pJid)567 IM_Preferences.prototype.SendFile = function(pJid) 385 568 { 386 569 if(im_send_file == 'true'){ 387 570 Templates.Send_file(pJid); 388 571 }else{ 389 alert('Funç ão Indisponível!');572 alert('Funçao Indisponível!'); 390 573 } 391 574 } 392 575 393 Preferences.prototype.SizeFile = function()576 IM_Preferences.prototype.SizeFile = function() 394 577 { 395 var h_SizeFile = function(data){ 578 var h_SizeFile = function(data) 579 { 396 580 alert(data); 397 581 } 398 582 cIM.cExecute("$this.upload.size_file",h_SizeFile); 399 583 } 400 401 /*402 * Preferências do Usuário403 */404 405 Preferences.prototype.yourPreferences = function()406 {407 Templates.yourPreferences();408 if( IM.array_prefe['sizeof'] > 0 ){409 document.getElementById('ch_time').checked = eval(IM.array_prefe['ch_time']);410 document.getElementById('ch_offline').checked = eval(IM.array_prefe['ch_offline']);411 document.getElementById('ch_contacts').checked = eval(IM.array_prefe['ch_contacts']);412 document.getElementById('rd_nm').checked = eval(IM.array_prefe['rd_nm']);413 document.getElementById('rd_al').checked = eval(IM.array_prefe['rd_al']);414 document.getElementById('rd_ch').checked = eval(IM.array_prefe['rd_ch']);415 }else{416 this.GetPreferences();417 }418 419 }420 421 Preferences.prototype.SetPreferences = function()422 {423 var EcheckBox = new Array();424 EcheckBox[0] = 'ch_time';425 EcheckBox[1] = 'ch_offline';426 EcheckBox[2] = 'ch_contacts';427 var Eradio = new Array()428 Eradio[0] = 'rd_nm';429 Eradio[1] = 'rd_al';430 Eradio[2] = 'rd_ch';431 var preferences = '';432 var _this = this;433 434 for(var i in EcheckBox){435 if(document.getElementById(EcheckBox[i]).checked){436 preferences += EcheckBox[i] + ':' + true + ';';437 IM.array_prefe[EcheckBox[i]] = true;438 }else{439 preferences += EcheckBox[i] + ':' + false + ';';440 IM.array_prefe[EcheckBox[i]] = false;441 }442 IM.array_prefe['sizeof'] = i;443 }444 445 for(var i in Eradio){446 if(document.getElementById(Eradio[i]).checked){447 preferences += Eradio[i] + ':' + true + ';';448 IM.array_prefe[Eradio[i]] = true;449 }else{450 preferences += Eradio[i] + ':' + false + ';';451 IM.array_prefe[Eradio[i]] = false;452 }453 IM.array_prefe['sizeof'] = IM.array_prefe['sizeof'] = i + 1;454 }455 456 var handler_set_preferences = function(data)457 {458 if(data)459 alert('Preferências cadastradas com sucesso!');460 IM.ContactsOffline();461 }462 cIM.cExecute("$this.db_im.set_preferences",handler_set_preferences,"preferences="+preferences);463 464 }465 466 Preferences.prototype.GetPreferences = function()467 {468 var handler_get_preferences = function(data){469 var opt = data.split(";");470 for(var i in opt){471 if(opt[i] != ""){472 var el = opt[i].split(":");473 if(document.getElementById(el[0]) != null){474 var id_el = document.getElementById(el[0]);475 id_el.checked = eval(el[1]);476 }477 IM.array_prefe[el[0]] = eval(el[1]);478 IM.array_prefe['sizeof'] = i;479 }480 }481 }482 cIM.cExecute("$this.db_im.get_preferences",handler_get_preferences);483 484 }485 486 /*487 * Tela de permissão para novos contatos488 */489 490 Preferences.prototype.Refresh_Screen = function(pJid)491 {492 var el_tbl = document.getElementById("_cell_" + pJid);493 if(el_tbl != null)494 el_tbl.parentNode.removeChild(el_tbl);495 }496 584 497 // Build Object 498 var Preferences = new Preferences(); 585 // Build Object 586 587 var IM_Preferences = new IM_Preferences(); -
trunk/instant_messenger/js/im_templates.js
r41 r55 15 15 this.arquivo = ""; 16 16 } 17 17 18 18 /* 19 19 * Conf forms … … 39 39 Templates.prototype.add_user = function() 40 40 { 41 42 var _this = this; 43 var _td = ""; 44 45 var form_add_user = "<span style='display:block'><b>Selecione uma Organização .: </b><select id='ImSelOrg' name='ImSelOrg' onchange='Preferences.SearchContacts();'></select>" + 46 "<span id='_span_load_im' style='background-color:#cc4444;color:white;visibility:hidden;position:absolute;right:0px'>Carregando .....</span>"+ 47 "</span>"+ 48 "<select size='10' id='ImSelAddContact' name='ImSelAddContact' class='add_user' onclick='Preferences.preenche();'></select><table border='0' cellpadding='1' cellspacing='2' align='center' width='100%' >"+ 49 "<tr><td><b>"+IM.get_lang('Jid Contact')+".:</b></td><td><input id='text0' type='text' size='40' maxlength='40'></td></tr>"+ 50 "<tr><td><b>"+IM.get_lang('Nickname')+".:</b></td><td><input id='text1' type='text' size='20' maxlength='20'></td></tr>"+ 51 "<tr><td><b>"+IM.get_lang('Group')+".:</b></td><td><input id='text2' type='text' size='20' maxlength='20'></td></tr>"+ 52 "<tr><td><input id='text3' type='hidden' size='30' maxlength='30'></td></tr>"+ 53 "<tr><td colspan='2'><input type='button' value='"+IM.get_lang('Add')+"' onclick='Preferences.Add_user(\"divAddUser_im\")'></td></tr>"+ 54 "</table>" 55 _this.conf_form("divAddUser",520,270,form_add_user,":: " + IM.get_lang('Add New Contact') + " - Expresso ::"); 41 var _this = this; 42 var _XmlAddUser = '<adduser>' + 43 '<top lang1="'+IM.get_lang('Selecione uma Organização')+'" />' + 44 '<bottom lang1="'+IM.get_lang('Jid Contact')+'" lang2="'+IM.get_lang('Nickname')+'" lang3="'+IM.get_lang('Group')+'" lang4="'+IM.get_lang('Add')+'"/>' + 45 '</adduser>'; 46 47 _this.conf_form("divAddUser",515,285,parse_XmlXsl(_XmlAddUser,'add_user.xsl'),":: " + IM.get_lang('Add New Contact') + " - Expresso ::"); 48 } 49 50 Templates.prototype.AcceptRequestUser = function() 51 { 52 var _this = this; 53 var _XmlupdUser = '<updUser>' + 54 '<body lang1="'+IM.get_lang('Nickname')+'" lang2="'+IM.get_lang('Group')+'" lang3="'+IM.get_lang('Update')+'" />' + 55 '</updUser>'; 56 57 _this.conf_form("divUpdateUser",300,110,parse_XmlXsl(_XmlupdUser,'upd_user.xsl'),":: " + IM.get_lang('Add New Contact') + " - Expresso ::"); 56 58 } 57 59 … … 63 65 { 64 66 var _this = this; 65 var form_del_user = "<div style='margin-left:20px;margin-top:20px'>"+ 66 "<span>"+IM.get_lang('Contact')+" .: </span>"+ 67 "<span style='margin-left:20px'><select id='sel_contact'></select></span><br>"+ 68 "<p><span><input type='button' value='"+IM.get_lang('Remove')+"' onclick='javascript:Preferences.Remove_user()'></span>"+ 69 "</div>"; 70 71 _this.conf_form("divDelUser",400,110,form_del_user,":: " + IM.get_lang('Remove Contact') + " - Expresso ::"); 67 var _XmlDelUser = '<deluser>' + 68 '<body lang1="'+IM.get_lang('Contact')+'" lang2="'+IM.get_lang('Remove')+'" />' + 69 '</deluser>'; 70 71 _this.conf_form("divDelUser",300,110,parse_XmlXsl(_XmlDelUser,'del_user.xsl'),":: " + IM.get_lang('Remove Contact') + " - Expresso ::"); 72 72 } 73 73 … … 76 76 */ 77 77 78 Templates.prototype.update_user = function() 79 { 80 var _this = this; 81 var form_update_user = "<table border='0' cellpadding='1' cellspacing='2' align='center' width='90%'>"+ 82 "<tr><td><input id='text0' type='hidden' size='40' maxlength='40'></td></tr>"+ 83 "<tr><td><b>Contato .:</b></td><td><span id='span0'></span></td></tr>"+ 84 "<tr><td><b>"+IM.get_lang('Nickname')+".:</b></td><td><input id='text1' type='text' size='20' maxlength='20'></td></tr>"+ 85 "<tr><td><b>"+IM.get_lang('Group')+".:</b></td><td><input id='text2' type='text' size='20' maxlength='20'></td></tr>"+ 86 "<tr><td colspan='2'><input type='button' value='"+IM.get_lang('Update')+"' onclick='Preferences.Add_user(\"divUpdateUser_im\")'></td></tr>"+ 87 "</table>"; 88 _this.conf_form("divUpdateUser",300,110,form_update_user,":: Adicionar Contato - Expresso ::"); 89 } 90 91 Templates.prototype.Users_Not_Auth = function () 92 { 93 var count = 0; 94 var _this = this; 95 var auth_user = ""; 96 97 if(!IM.array_prefe['ch_contacts']) 98 { 99 auth_user = '<table border="0" cellpadding="0" cellspacing="0" width="99%">' + 100 '<tr style="background-color:#cccccc;font-weight:bold;height:20px"><td> Contato</td><td align="center">Detalhes</td><td align="center">Aceitar S/N</td></tr>'; 78 Templates.prototype.Users_Not_Auth = function (jids) 79 { 80 var _this = this; 81 var _XmlUserNAuth = '<jids>'; 82 for(var i in jids) 83 { 84 _XmlUserNAuth += '<item id="im_cell_'+jids[i]+'" jid="'+jids[i]+'" />'; 85 } 86 _XmlUserNAuth += '</jids>'; 87 if(document.getElementById('divFormAuthUser_im') == null){ 88 _this.conf_form("divFormAuthUser",360,250,parse_XmlXsl(_XmlUserNAuth,'user_not_auth.xsl'), ":: Contatos sem Cadastro - Expresso ::"); 89 }else{ 90 document.getElementById('divFormAuthUser_im').innerHTML = ''; 91 document.getElementById('divFormAuthUser_im').innerHTML = parse_XmlXsl(_XmlUserNAuth,'user_not_auth.xsl'); 92 } 93 } 94 95 /* 96 * Vcard Usuario 97 */ 98 99 Templates.prototype.information_user = function() 100 { 101 var _this = this; 102 var _XmlInfoUser = '<info_user>' + 103 '<body lang1="'+IM.get_lang('Full Name')+'" lang2="'+IM.get_lang('NickName')+'" lang3="'+IM.get_lang('Orgname')+'" lang4="'+IM.get_lang('Orgunit')+'" lang5="'+IM.get_lang('Role')+'" lang6="'+IM.get_lang('Birthday')+'" lang7="'+IM.get_lang('your message')+'" />' + 104 '<bottom lang1="'+IM.get_lang('save')+'" />'+ 105 '</info_user>'; 106 _this.conf_form("divInfoUser",400,220,parse_XmlXsl(_XmlInfoUser,'information_user.xsl'), ":: " + IM.get_lang('Information User') + " - Expresso ::"); 107 } 108 109 Templates.prototype.information_Contact = function() 110 { 111 var _this = this; 112 var _XmlInfoContact = '<info_contact>'+ 113 '<body lang="'+IM.get_lang('Full Name')+'" label="_lbl_FN" />' + 114 '<body lang="'+IM.get_lang('NickName')+'" label="_lbl_NICKNAME" />' + 115 '<body lang="'+IM.get_lang('Orgunit')+'" label="_lbl_ORGUNIT" />' + 116 '<body lang="'+IM.get_lang('Role')+'" label="_lbl_ROLE" />' + 117 '<body lang="'+IM.get_lang('Birthday')+'" label="_lbl_BDAY" />' + 118 '</info_contact>'; 119 _this.conf_form("divInfoContact",430,110,parse_XmlXsl(_XmlInfoContact,'info_contact.xsl'),":: Informações do Contato - Expresso ::"); 120 121 } 122 123 Templates.prototype.emotions = function() 124 { 125 var grid = ''; 126 grid += '<table cellpadding="0" cellspacing="0" border="0">'; 127 grid += ' <tr>'; 128 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\':)\')" id="sendMessageMenuId"><img alt=":)" width="19" height="19" src="' + smile_1.src + '" /></div></td>'; 129 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\':d\')" id="sendMessageMenuId"><img alt=":d" width="19" height="19" src="' + smile_2.src + '" /></div></td>'; 130 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\';)\')" id="sendMessageMenuId"><img alt=";)" width="19" height="19" src="' + smile_3.src + '" /></div></td>'; 131 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\':o\')" id="sendMessageMenuId"><img alt=":o" width="19" height="19" src="' + smile_4.src + '" /></div></td>'; 132 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\':p\')" id="sendMessageMenuId"><img alt=":p" width="19" height="19" src="' + smile_5.src + '" /></div></td>'; 133 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(h)\')" id="sendMessageMenuId"><img alt="(h)" width="19" height="19" src="' + smile_6.src + '" /></div></td>'; 134 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\':@\')" id="sendMessageMenuId"><img alt=":@" width="19" height="19" src="' + smile_7.src + '" /></div></td>'; 135 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\':$\')" id="sendMessageMenuId"><img alt=":$" width="19" height="19" src="' + smile_8.src + '" /></div></td>'; 136 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\':s\')" id="sendMessageMenuId"><img alt=":s" width="19" height="19" src="' + smile_9.src + '" /></div></td>'; 137 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\':(\')" id="sendMessageMenuId"><img alt=":(" width="19" height="19" src="' + smile_10.src + '" /></div></td>'; 138 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\':\\\'\(\')" id="sendMessageMenuId"><img alt=":\'(" width="19" height="19" src="' + smile_11.src + '" /></div></td>'; 139 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\':|\')" id="sendMessageMenuId"><img alt=":|" width="19" height="19" src="' + smile_12.src + '" /></div></td>'; 140 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(6)\')" id="sendMessageMenuId"><img alt="(6)" width="19" height="19" src="' + smile_13.src + '" /></div></td>'; 141 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(a)\')" id="sendMessageMenuId"><img alt="(a)" width="19" height="19" src="' + smile_14.src + '" /></div></td>'; 142 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(l)\')" id="sendMessageMenuId"><img alt="(l)" width="19" height="19" src="' + smile_15.src + '" /></div></td>'; 143 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(u)\')" id="sendMessageMenuId"><img alt="(u)" width="19" height="19" src="' + smile_16.src + '" /></div></td>'; 144 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(m)\')" id="sendMessageMenuId"><img alt="(m)" width="19" height="19" src="' + smile_17.src + '" /></div></td>'; 145 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(@)\')" id="sendMessageMenuId"><img alt="(@)" width="19" height="19" src="' + smile_18.src + '" /></div></td>'; 146 grid += ' </tr>'; 147 grid += ' <tr>'; 148 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(&)\')" id="sendMessageMenuId"><img alt="(&)" width="19" height="19" src="' + smile_19.src + '" /></div></td>'; 149 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(S)\')" id="sendMessageMenuId"><img alt="(S)" width="19" height="19" src="' + smile_20.src + '" /></div></td>'; 150 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(*)\')" id="sendMessageMenuId"><img alt="(*)" width="19" height="19" src="' + smile_21.src + '" /></div></td>'; 151 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(~)\')" id="sendMessageMenuId"><img alt="(~)" width="19" height="19" src="' + smile_22.src + '" /></div></td>'; 152 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(8)\')" id="sendMessageMenuId"><img alt="(8)" width="19" height="19" src="' + smile_23.src + '" /></div></td>'; 153 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(e)\')" id="sendMessageMenuId"><img alt="(e)" width="19" height="19" src="' + smile_24.src + '" /></div></td>'; 154 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(f)\')" id="sendMessageMenuId"><img alt="(f)" width="19" height="19" src="' + smile_25.src + '" /></div></td>'; 155 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(w)\')" id="sendMessageMenuId"><img alt="(w)" width="19" height="19" src="' + smile_26.src + '" /></div></td>'; 156 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(o)\')" id="sendMessageMenuId"><img alt="(o)" width="19" height="19" src="' + smile_27.src + '" /></div></td>'; 157 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(k)\')" id="sendMessageMenuId"><img alt="(k)" width="19" height="19" src="' + smile_28.src + '" /></div></td>'; 158 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(g)\')" id="sendMessageMenuId"><img alt="(g)" width="19" height="19" src="' + smile_29.src + '" /></div></td>'; 159 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(^)\')" id="sendMessageMenuId"><img alt="(^)" width="19" height="19" src="' + smile_30.src + '" /></div></td>'; 160 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(p)\')" id="sendMessageMenuId"><img alt="(p)" width="19" height="19" src="' + smile_31.src + '" /></div></td>'; 161 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(i)\')" id="sendMessageMenuId"><img alt="(i)" width="19" height="19" src="' + smile_32.src + '" /></div></td>'; 162 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(c)\')" id="sendMessageMenuId"><img alt="(c)" width="19" height="19" src="' + smile_33.src + '" /></div></td>'; 163 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(t)\')" id="sendMessageMenuId"><img alt="(t)" width="19" height="19" src="' + smile_34.src + '" /></div></td>'; 164 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'({)\')" id="sendMessageMenuId"><img alt="({)" width="19" height="19" src="' + smile_35.src + '" /></div></td>'; 165 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(})\')" id="sendMessageMenuId"><img alt="(})" width="19" height="19" src="' + smile_36.src + '" /></div></td>'; 166 grid += ' </tr>'; 167 grid += ' <tr>'; 168 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(b)\')" id="sendMessageMenuId"><img alt="(b)" width="19" height="19" src="' + smile_37.src + '" /></div></td>'; 169 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(d)\')" id="sendMessageMenuId"><img alt="(d)" width="19" height="19" src="' + smile_38.src + '" /></div></td>'; 170 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(z)\')" id="sendMessageMenuId"><img alt="(z)" width="19" height="19" src="' + smile_39.src + '" /></div></td>'; 171 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(x)\')" id="sendMessageMenuId"><img alt="(x)" width="19" height="19" src="' + smile_40.src + '" /></div></td>'; 172 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(y)\')" id="sendMessageMenuId"><img alt="(y)" width="19" height="19" src="' + smile_41.src + '" /></div></td>'; 173 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(n)\')" id="sendMessageMenuId"><img alt="(n)" width="19" height="19" src="' + smile_42.src + '" /></div></td>'; 174 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\':[\')" id="sendMessageMenuId"><img alt=":[" width="19" height="19" src="' + smile_43.src + '" /></div></td>'; 175 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(?)\')" id="sendMessageMenuId"><img alt="(?)" width="19" height="19" src="' + smile_44.src + '" /></div></td>'; 176 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(%)\')" id="sendMessageMenuId"><img alt="(%)" width="19" height="19" src="' + smile_45.src + '" /></div></td>'; 177 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(#)\')" id="sendMessageMenuId"><img alt="(#)" width="19" height="19" src="' + smile_46.src + '" /></div></td>'; 178 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(r)\')" id="sendMessageMenuId"><img alt="(r)" width="19" height="19" src="' + smile_47.src + '" /></div></td>'; 179 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\':-#\')" id="sendMessageMenuId"><img alt=":-#" width="19" height="19" src="' + smile_48.src + '" /></div></td>'; 180 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'8o|\')" id="sendMessageMenuId"><img alt="8o|" width="19" height="19" src="' + smile_49.src + '" /></div></td>'; 181 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'8-|\')" id="sendMessageMenuId"><img alt="8-|" width="19" height="19" src="' + smile_50.src + '" /></div></td>'; 182 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'^o)\')" id="sendMessageMenuId"><img alt="^o)" width="19" height="19" src="' + smile_51.src + '" /></div></td>'; 183 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\':-*\')" id="sendMessageMenuId"><img alt=":-*" width="19" height="19" src="' + smile_52.src + '" /></div></td>'; 184 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'+o(\')" id="sendMessageMenuId"><img alt="+o(" width="19" height="19" src="' + smile_53.src + '" /></div></td>'; 185 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(sn)\')" id="sendMessageMenuId"><img alt="(sn)" width="19" height="19" src="' + smile_54.src + '" /></div></td>'; 186 grid += ' </tr>'; 187 grid += ' <tr>'; 188 grid += ' <td colspan="18"><hr style="background:#cccccc;margin:1px:size:1px;"/></td>'; 189 grid += ' </tr>'; 190 grid += ' <tr>'; 191 grid += ' </tr>'; 192 grid += ' <td colspan="18"><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.hideEmotionSelection()" id="closeEmotionSelectionDiv">Close This Menu</div></td>'; 193 grid += ' </tr>'; 194 grid += '</table>'; 101 195 102 for(var i=0 ; i < IM.array_users.length; i++){ 103 if(IM.array_users[i].group == 'sem_grupo'){ 104 auth_user += '<tr id="_cell_'+IM.array_users[i].jid+'">'+ 105 '<td><img src="' + img_not_authorized.src + '">' + decodeURI(IM.array_users[i].name).substr(0,decodeURI(IM.array_users[i].name).indexOf('@')) + '<span id="_span_not_' + IM.array_users[i].jid + '"></span></td>'+ 106 '<td align="center"><a href="javascript:void(0);" onclick=Preferences.Info_Contact("'+IM.array_users[i].jid+'")> ? </a></td>'+ 107 '<td align="center"><a href="javascript:void(0);" onclick=Preferences.updateLoad("'+IM.array_users[i].jid+'")> Sim </a>/<a href="javascript:void(0);" onclick=Preferences.Remove_Contact("'+IM.array_users[i].jid+'")> Não </a></td>'+ 108 '</tr>'; 109 count++; 110 } 111 } 112 113 auth_user += '</table>'; 114 115 if( count > 0 ){ 116 var form_auth_user = '<div style="margin-left:5px;margin-top:2px">' + 117 '</br>'+ 118 '<b>O(s) contato(s) abaixo aguarda(m) sua autorização.' + 119 '</br>Para adicionar este(s) novo(s) contato(s), basta dar um ' + 120 'clique em cima do contato.' + 121 '<p>Contato(s) :' + 122 '</b></br>' + 123 '<div id="divChildrenFormAuthUser">'; 124 form_auth_user += auth_user + '</div></div>'; 125 _this.conf_form("divFormAuthUser",360,250,form_auth_user, ":: Contatos sem Cadastro - Expresso ::"); 126 127 } 128 } 129 } 130 131 /* 132 * Vcard Usuario 133 */ 134 135 Templates.prototype.information_user = function() 136 { 137 var _this = this; 138 var form_info_user = "<table border='0' cellpadding='1' cellspacing='2' width='90%' style='margin-top:10px'>"+ 139 "<tr><td width='30%' align='right'>"+IM.get_lang("Full Name")+" .: </td><td><input id='FN' type='text name='text0' size='40' maxlength='40'></td></tr>"+ 140 "<tr><td width='30%' align='right'>"+IM.get_lang("NickName")+" .: </td><td><input id='NICKNAME' type='text name='text1' size='20' maxlength='20'></td></tr>"+ 141 "<tr><td width='30%' align='right'>"+IM.get_lang("Orgname")+" .: </td><td><input id='ORGNAME' type='text name='text4' size='17' maxlength='17'></td></tr>"+ 142 "<tr><td width='30%' align='right'>"+IM.get_lang("Orgunit")+" .: </td><td><input id='ORGUNIT' type='text name='text5' size='10' maxlength='10'></td></tr>"+ 143 "<tr><td width='30%' align='right'>"+IM.get_lang("Role")+" .: </td><td><input id='ROLE' type='text name='text6' size='25' maxlength='25'></td></tr>"+ 144 "<tr><td width='30%' align='right'>"+IM.get_lang("Birthday")+" .: </td><td><input id='BDAY' type='text name='text7' size='10' maxlength='10'></td></tr>"+ 145 "<tr><td width='30%' align='right'>"+IM.get_lang("your message")+" .: </td><td><input id='DESC' type='text name='text8' size='40' maxlength='40'></td></tr>"+ 146 "</table>"+ 147 "<table border='0' cellpading='1' cellspacing='2' width='100%'>"+ 148 "<tr><input type='button' value='"+IM.get_lang('save')+"' onclick='javascript:Preferences.vCardAdd();'></tr>"+ 149 "</table>"; 150 _this.conf_form("divInfoUser",400,220,form_info_user, ":: " + IM.get_lang('Information User') + " - Expresso ::"); 151 } 152 153 Templates.prototype.information_Contact = function() 154 { 155 var _this = this; 156 var form_info_contact = '<table border="0" cellpading="1" cellspacing="2" width="90%" style="margin-top:10px">'+ 157 '<tr><td width="30%" align="right">'+IM.get_lang('Full Name')+' .: </td><td width="70%" align="left"><label id="_lbl_FN"></label></td></tr>'+ 158 '<tr><td width="30%" align="right">'+IM.get_lang('NickName')+' .: </td><td width="70%" align="left"><label id="_lbl_Nickname"></label></td></tr>'+ 159 '<tr><td width="30%" align="right">'+IM.get_lang('Orgunit')+' .: </td><td width="70%" align="left"><label id="_lbl_Orgunit"></label></td></tr>'+ 160 '<tr><td width="30%" align="right">'+IM.get_lang('Role')+' .: </td><td width="70%" align="left"><label id="_lbl_Role"></label></td></tr>'+ 161 '<tr><td width="30%" align="right">'+IM.get_lang('Birthday')+' .: </td><td width="70%" align="left"><label id="_lbl_Birthday"></label></td></tr>'+ 162 '<table>'; 163 _this.conf_form("divInfoContact",430,130,form_info_contact,":: Informações do Contato - Expresso ::"); 164 165 } 166 167 Templates.prototype.emotions = function() 168 { 169 grid = ''; 170 grid += '<table cellpadding="0" cellspacing="0" border="0">'; 171 grid += ' <tr>'; 172 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\':)\')" id="sendMessageMenuId"><img alt=":)" width="19" height="19" src="' + smile_1.src + '" /></div></td>'; 173 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\':d\')" id="sendMessageMenuId"><img alt=":d" width="19" height="19" src="' + smile_2.src + '" /></div></td>'; 174 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\';)\')" id="sendMessageMenuId"><img alt=";)" width="19" height="19" src="' + smile_3.src + '" /></div></td>'; 175 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\':o\')" id="sendMessageMenuId"><img alt=":o" width="19" height="19" src="' + smile_4.src + '" /></div></td>'; 176 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\':p\')" id="sendMessageMenuId"><img alt=":p" width="19" height="19" src="' + smile_5.src + '" /></div></td>'; 177 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(h)\')" id="sendMessageMenuId"><img alt="(h)" width="19" height="19" src="' + smile_6.src + '" /></div></td>'; 178 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\':@\')" id="sendMessageMenuId"><img alt=":@" width="19" height="19" src="' + smile_7.src + '" /></div></td>'; 179 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\':$\')" id="sendMessageMenuId"><img alt=":$" width="19" height="19" src="' + smile_8.src + '" /></div></td>'; 180 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\':s\')" id="sendMessageMenuId"><img alt=":s" width="19" height="19" src="' + smile_9.src + '" /></div></td>'; 181 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\':(\')" id="sendMessageMenuId"><img alt=":(" width="19" height="19" src="' + smile_10.src + '" /></div></td>'; 182 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\':\\\'\(\')" id="sendMessageMenuId"><img alt=":\'(" width="19" height="19" src="' + smile_11.src + '" /></div></td>'; 183 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\':|\')" id="sendMessageMenuId"><img alt=":|" width="19" height="19" src="' + smile_12.src + '" /></div></td>'; 184 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(6)\')" id="sendMessageMenuId"><img alt="(6)" width="19" height="19" src="' + smile_13.src + '" /></div></td>'; 185 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(a)\')" id="sendMessageMenuId"><img alt="(a)" width="19" height="19" src="' + smile_14.src + '" /></div></td>'; 186 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(l)\')" id="sendMessageMenuId"><img alt="(l)" width="19" height="19" src="' + smile_15.src + '" /></div></td>'; 187 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(u)\')" id="sendMessageMenuId"><img alt="(u)" width="19" height="19" src="' + smile_16.src + '" /></div></td>'; 188 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(m)\')" id="sendMessageMenuId"><img alt="(m)" width="19" height="19" src="' + smile_17.src + '" /></div></td>'; 189 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(@)\')" id="sendMessageMenuId"><img alt="(@)" width="19" height="19" src="' + smile_18.src + '" /></div></td>'; 190 grid += ' </tr>'; 191 grid += ' <tr>'; 192 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(&)\')" id="sendMessageMenuId"><img alt="(&)" width="19" height="19" src="' + smile_19.src + '" /></div></td>'; 193 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(S)\')" id="sendMessageMenuId"><img alt="(S)" width="19" height="19" src="' + smile_20.src + '" /></div></td>'; 194 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(*)\')" id="sendMessageMenuId"><img alt="(*)" width="19" height="19" src="' + smile_21.src + '" /></div></td>'; 195 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(~)\')" id="sendMessageMenuId"><img alt="(~)" width="19" height="19" src="' + smile_22.src + '" /></div></td>'; 196 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(8)\')" id="sendMessageMenuId"><img alt="(8)" width="19" height="19" src="' + smile_23.src + '" /></div></td>'; 197 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(e)\')" id="sendMessageMenuId"><img alt="(e)" width="19" height="19" src="' + smile_24.src + '" /></div></td>'; 198 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(f)\')" id="sendMessageMenuId"><img alt="(f)" width="19" height="19" src="' + smile_25.src + '" /></div></td>'; 199 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(w)\')" id="sendMessageMenuId"><img alt="(w)" width="19" height="19" src="' + smile_26.src + '" /></div></td>'; 200 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(o)\')" id="sendMessageMenuId"><img alt="(o)" width="19" height="19" src="' + smile_27.src + '" /></div></td>'; 201 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(k)\')" id="sendMessageMenuId"><img alt="(k)" width="19" height="19" src="' + smile_28.src + '" /></div></td>'; 202 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(g)\')" id="sendMessageMenuId"><img alt="(g)" width="19" height="19" src="' + smile_29.src + '" /></div></td>'; 203 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(^)\')" id="sendMessageMenuId"><img alt="(^)" width="19" height="19" src="' + smile_30.src + '" /></div></td>'; 204 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(p)\')" id="sendMessageMenuId"><img alt="(p)" width="19" height="19" src="' + smile_31.src + '" /></div></td>'; 205 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(i)\')" id="sendMessageMenuId"><img alt="(i)" width="19" height="19" src="' + smile_32.src + '" /></div></td>'; 206 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(c)\')" id="sendMessageMenuId"><img alt="(c)" width="19" height="19" src="' + smile_33.src + '" /></div></td>'; 207 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(t)\')" id="sendMessageMenuId"><img alt="(t)" width="19" height="19" src="' + smile_34.src + '" /></div></td>'; 208 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'({)\')" id="sendMessageMenuId"><img alt="({)" width="19" height="19" src="' + smile_35.src + '" /></div></td>'; 209 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(})\')" id="sendMessageMenuId"><img alt="(})" width="19" height="19" src="' + smile_36.src + '" /></div></td>'; 210 grid += ' </tr>'; 211 grid += ' <tr>'; 212 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(b)\')" id="sendMessageMenuId"><img alt="(b)" width="19" height="19" src="' + smile_37.src + '" /></div></td>'; 213 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(d)\')" id="sendMessageMenuId"><img alt="(d)" width="19" height="19" src="' + smile_38.src + '" /></div></td>'; 214 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(z)\')" id="sendMessageMenuId"><img alt="(z)" width="19" height="19" src="' + smile_39.src + '" /></div></td>'; 215 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(x)\')" id="sendMessageMenuId"><img alt="(x)" width="19" height="19" src="' + smile_40.src + '" /></div></td>'; 216 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(y)\')" id="sendMessageMenuId"><img alt="(y)" width="19" height="19" src="' + smile_41.src + '" /></div></td>'; 217 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(n)\')" id="sendMessageMenuId"><img alt="(n)" width="19" height="19" src="' + smile_42.src + '" /></div></td>'; 218 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\':[\')" id="sendMessageMenuId"><img alt=":[" width="19" height="19" src="' + smile_43.src + '" /></div></td>'; 219 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(?)\')" id="sendMessageMenuId"><img alt="(?)" width="19" height="19" src="' + smile_44.src + '" /></div></td>'; 220 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(%)\')" id="sendMessageMenuId"><img alt="(%)" width="19" height="19" src="' + smile_45.src + '" /></div></td>'; 221 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(#)\')" id="sendMessageMenuId"><img alt="(#)" width="19" height="19" src="' + smile_46.src + '" /></div></td>'; 222 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(r)\')" id="sendMessageMenuId"><img alt="(r)" width="19" height="19" src="' + smile_47.src + '" /></div></td>'; 223 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\':-#\')" id="sendMessageMenuId"><img alt=":-#" width="19" height="19" src="' + smile_48.src + '" /></div></td>'; 224 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'8o|\')" id="sendMessageMenuId"><img alt="8o|" width="19" height="19" src="' + smile_49.src + '" /></div></td>'; 225 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'8-|\')" id="sendMessageMenuId"><img alt="8-|" width="19" height="19" src="' + smile_50.src + '" /></div></td>'; 226 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'^o)\')" id="sendMessageMenuId"><img alt="^o)" width="19" height="19" src="' + smile_51.src + '" /></div></td>'; 227 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\':-*\')" id="sendMessageMenuId"><img alt=":-*" width="19" height="19" src="' + smile_52.src + '" /></div></td>'; 228 grid += ' <td><div class="emotionItem" onMouseover="im_win.hAuthorizationighlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'+o(\')" id="sendMessageMenuId"><img alt="+o(" width="19" height="19" src="' + smile_53.src + '" /></div></td>'; 229 grid += ' <td><div class="emotionItem" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.addEmotion(\'(sn)\')" id="sendMessageMenuId"><img alt=(sn)"" width="19" height="19" src="' + smile_54.src + '" /></div></td>'; 230 grid += ' </tr>'; 231 grid += ' <tr>'; 232 grid += ' <td colspan="18"><div style="background:#cccccc;margin:1px"><img src="templates/default/images/img/blank.gif" height="1" width="1" border="0"/></div></td>'; 233 grid += ' </tr>'; 234 grid += ' <tr>'; 235 grid += ' </tr>'; 236 grid += ' <td colspan="18"><div class="emotionItem" !style="width:100%" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.hideEmotionSelection()" id="closeEmotionSelectionDiv">Close This Menu</div></td>'; 237 grid += ' </tr>'; 238 grid += '</table>'; 239 196 return grid; 197 } 198 199 Templates.prototype.font_name = function() 200 { 201 var grid = ''; 202 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFont(\'Arial\')" id="fontStyle1" style="width:120px;font-family:arial">Arial</div>'; 203 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFont(\'Courier\')" id="fontStyle1" style="width:120px;font-family:Courier">Courier</div>'; 204 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFont(\'Times\')" id="fontStyle1" style="width:120px;font-family:Times New Roman">Times New Roman</div>'; 205 grid += '<hr style="background:#cccccc;margin:1px:size:1px;width:120px;"/>'; 206 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.hideFontNameSelection()" id="fontStyle1" style="width:120px">Close This Menu</div>'; 240 207 return grid; 241 208 } 242 209 243 Templates.prototype.font_name = function() 244 { 245 grid = ''; 246 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFont(\'Arial\')" id="fontStyle1" style="width:120px;font-family:arial">Arial</div>'; 247 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFont(\'Courier\')" id="fontStyle1" style="width:120px;font-family:Courier">Courier</div>'; 248 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFont(\'Times\')" id="fontStyle1" style="width:120px;font-family:Times New Roman">Times New Roman</div>'; 249 grid += '<div style="background:#cccccc;margin:1px"><img src="../images/blank.gif" height="1" width="1" border="0"/></div>'; 250 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.hideFontNameSelection()" id="fontStyle1" style="width:120px">Close This Menu</div>'; 251 210 Templates.prototype.font_size = function() 211 { 212 var grid = ''; 213 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeSizeFont(\'9pt\');" id="fontStyle1" style="width:100px">9</div>'; 214 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeSizeFont(\'10pt\');" id="fontStyle1" style="width:100px">10</div>'; 215 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeSizeFont(\'11pt\');" id="fontStyle1" style="width:100px">11</div>'; 216 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeSizeFont(\'12pt\');" id="fontStyle1" style="width:100px">12</div>'; 217 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeSizeFont(\'14pt\');" id="fontStyle1" style="width:1!00px">14</div>'; 218 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeSizeFont(\'16pt\');" id="fontStyle1" style="width:100px">16</div>'; 219 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeSizeFont(\'18pt\');" id="fontStyle1" style="width:100px">18</div>'; 220 grid += '<hr style="background:#cccccc;margin:1px:size:1px;width:120px;"/>'; 221 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.hideFontSizeSelection()" id="fontStyle1" style="width:100px">Close This Menu</div>'; 252 222 return grid; 253 223 } 254 224 255 Templates.prototype.font_ size= function()256 { 257 grid = '';258 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeSizeFont(\'9pt\');" id="fontStyle1" style="width:100px">9</div>';259 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeSizeFont(\'10pt\');" id="fontStyle1" style="width:100px">10</div>';260 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeSizeFont(\'11pt\');" id="fontStyle1" style="width:100px">11</div>';261 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeSizeFont(\'12pt\');" id="fontStyle1" style="width:100px">12</div>';262 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeSizeFont(\'14pt\');" id="fontStyle1" style="width:1!00px">14</div>';263 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeSizeFont(\'16pt\');" id="fontStyle1" style="width:100px">16</div>';264 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeSizeFont(\'18pt\');" id="fontStyle1" style="width:100px">18</div>';265 grid += '<div style="background:#cccccc;margin:1px"><img src="../images/blank.gif" height="1" width="1" border="0"/></div>';266 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.hideFontSizeSelection()" id="fontStyle1" style="width:100px">Close This Menu</div>';267 225 Templates.prototype.font_color = function() 226 { 227 var grid = ''; 228 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFontColor(\'#000000\')" id="fontStyle1" style="width:100px">Black</div>'; 229 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFontColor(\'#c0c0c0\')" id="fontStyle1" style="width:100px">Silver</div>'; 230 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFontColor(\'#ffff00\')" id="fontStyle1" style="width:100px">Yellow</div>'; 231 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFontColor(\'#ff0000\')" id="fontStyle1" style="width:100px">Red</div>'; 232 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFontColor(\'#ff00ff\')" id="fontStyle1" style="width:100px">Pink</div>'; 233 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFontColor(\'#00ff00\')" id="fontStyle1" style="width:100px">Green</div>'; 234 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFontColor(\'#1111ff\')" id="fontStyle1" style="width:100px">Blue</div>'; 235 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFontColor(\'#800080\')" id="fontStyle1" style="width:100px">Magenta</div>'; 236 grid += '<hr style="background:#cccccc;margin:1px:size:1px;width:120px;"/>'; 237 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.hideFontColorSelection()" id="fontStyle1" style="width:100px">Close This Menu</div>'; 268 238 return grid; 269 239 } 270 240 271 Templates.prototype.font_color = function() 272 { 273 grid = ''; 274 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFontColor(\'#000000\')" id="fontStyle1" style="width:100px">Black</div>'; 275 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFontColor(\'#c0c0c0\')" id="fontStyle1" style="width:100px">Silver</div>'; 276 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFontColor(\'#ffff00\')" id="fontStyle1" style="width:100px">Yellow</div>'; 277 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFontColor(\'#ff0000\')" id="fontStyle1" style="width:100px">Red</div>'; 278 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFontColor(\'#ff00ff\')" id="fontStyle1" style="width:100px">Pink</div>'; 279 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFontColor(\'#00ff00\')" id="fontStyle1" style="width:100px">Green</div>'; 280 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFontColor(\'#1111ff\')" id="fontStyle1" style="width:100px">Blue</div>'; 281 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFontColor(\'#800080\')" id="fontStyle1" style="width:100px">Magenta</div>'; 282 grid += '<div style="background:#cccccc;margin:1px"><img src="../images/blank.gif" height="1" width="1" border="0"/></div>'; 283 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.hideFontColorSelection()" id="fontStyle1" style="width:100px">Close This Menu</div>'; 241 Templates.prototype.font_style = function() 242 { 243 var grid = ''; 244 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFontStyle(\'normal\')" id="fontStyle1" style="width:100px">Regular</div>'; 245 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFontStyle(\'italic\')" id="fontStyle1" style="width:100px"><i>Italic</i></div>'; 246 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFontStyle(\'bold\')" id="fontStyle1" style="width:100px"><b>Bold</b></div>'; 247 grid += '<hr style="background:#cccccc;margin:1px:size:1px;width:120px;"/>'; 248 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.hideFontStyleSelection()" id="fontStyle1" style="width:100px">Close This Menu</div>'; 284 249 285 250 return grid; 286 251 } 287 252 288 Templates.prototype.font_style = function()289 {290 grid = '';291 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFontStyle(\'normal\')" id="fontStyle1" style="width:100px">Regular</div>';292 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFontStyle(\'italic\')" id="fontStyle1" style="width:100px"><i>Italic</i></div>';293 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_conf_font.changeFontStyle(\'bold\')" id="fontStyle1" style="width:100px"><b>Bold</b></div>';294 grid += '<div style="background:#cccccc;margin:1px"><img src="../images/blank.gif" height="1" width="1" border="0"/></div>';295 grid += '<div class="menuitems" onMouseover="im_win.highlightie5(this)" onMouseout="im_win.lowlightie5(this)" onclick="im_win.hideFontStyleSelection()" id="fontStyle1" style="width:100px">Close This Menu</div>';296 297 return grid;253 /* 254 * Preferências do usuário 255 */ 256 257 Templates.prototype.yourPreferences = function() 258 { 259 var _this = this; 260 var _XmlPreferences = '<preferences />'; 261 _this.conf_form("divYourPreferences",345,222,parse_XmlXsl(_XmlPreferences,'preferences.xsl'),":: Informações do Contato - Expresso ::"); 262 IM_Preferences.LoadPreferences(null); 298 263 } 299 264 … … 305 270 { 306 271 var _this = this; 307 var form_send_file = '<iframe style="display:none;" name="send_file"></iframe>'+ 308 '<div id="div_send_file_im" style="margin-left:5px;margin-top:10px;display:block;">'+ 309 '<span>.: Enviar Arquivo :.</span><br>'+ 310 '<form method="POST" target="send_file" action="'+im_path+'inc/class.upload.inc.php" enctype="multipart/form-data">'+ 311 '<input id="to_jid_im" type="hidden" value="' + pJid + '" name="to">'+ 312 '<input id="send_file_im" type="file" size="40" name="file">'+ 313 '<br><br><input type="submit" value="'+IM.get_lang('Send')+'" onclick="javascript:Templates.Wait_file(\'' + pJid + '\');return true;">'+ 314 '</form></div>'+ 315 '<div id="status_upload" style="margin-left:5px;margin-top:10px;display:none;">' + 316 '<span>.: Status da Transferência :.</span>'+ 317 '<br><br>'+ 318 '<div id="progressbar_p" style="border:1px solid #C9D9E8;width:70%;height:12%">'+ 319 '<div id="progressbar_f" style="border:1px solid #000;width:0%;height:100%;background-color:#C9D9E8;text-align:right">'+ 320 '<font style="font-size:8pt"><span id="porcent_im">100%</span></font>'+ 321 '</div></div></div>'; 322 _this.conf_form("divSendFile",360,110,form_send_file,":: Envio de Arquivo - Expresso ::"); 323 } 324 325 Templates.prototype.Wait_file = function(pJid) 326 { 272 var _XmlSendFile = '<send_file path="'+im_path+'" jid="'+pJid+'" lang1="'+IM.get_lang('Send File')+'" lang2="'+IM.get_lang('Send')+'" lang3="'+IM.get_lang('Status of the Transference')+'"/>'; 273 274 _this.conf_form("divSendFile",360,110,parse_XmlXsl(_XmlSendFile,'send_file.xsl'),":: Envio de Arquivo - Expresso ::"); 275 } 276 277 Templates.prototype.Wait_file = function(pJid) 278 { 327 279 if(document.getElementById("send_file_im").value != ""){ 328 280 document.getElementById("div_send_file_im").style.display = "none"; 329 document.getElementById("status_upload").style.display = "block"; 281 document.getElementById("status_upload").style.display = "block"; 330 282 this.UpdateStatusSendFile(pJid); 331 283 }else{ … … 333 285 } 334 286 } 335 287 336 288 Templates.prototype.UpdateStatusSendFile = function(pJid) 337 289 { … … 342 294 document.getElementById("div_send_file_im").style.display = "block"; 343 295 document.getElementById("status_upload").style.display = "none"; 344 document.getElementById("send_file_im").value = ""; 296 document.getElementById("send_file_im").value = ""; 345 297 this.transfer = 0; 346 298 this.time_set = ""; … … 348 300 var h_name_file = function(data){ 349 301 //var pJID = "alexandrecorreia@im.pr.gov.br"; 350 var pJID = pJid; 302 var pJID = pJid; 351 303 var message_conf = '<iframe name="IM_down_file" style="display:none"></iframe>'+ 352 304 '<b>VOCÊ ACABA DE RECEBER UM ARQUIVO !!!! </b>'+ 353 305 '<a href="../instant_messenger/inc/class.download.inc.php?file=' + data + '" target="IM_down_file">Clique aqui</a>'; 354 var Conf_send_file = function(data){ 306 var Conf_send_file = function(data){ 355 307 if(!data) 356 308 alert(data); … … 359 311 } 360 312 cIM.cExecute("$this.upload.name_file",h_name_file); 361 }else{ 313 }else{ 362 314 var h_size_file = function(data){ 363 315 _this.transfer++; … … 367 319 cIM.cExecute("$this.upload.size_file",h_size_file); 368 320 } 369 }370 371 /*372 * Preferências do usuário373 */374 Templates.prototype.yourPreferences = function()375 {376 var form_your_prefe = '<div style="margin-left:10px;margin-top:5px"><dl>' +377 '<fieldset><legend> Opções :</legend>'+378 '<dt><input id="ch_time" type="checkbox"> Mostar marcação de tempo </dt> ' +379 '<dt><input id="ch_offline" type="checkbox"> Exibir amigos desconectados </dt> ' +380 '<dt><input id="ch_contacts" type="checkbox"> Desativar aviso de novos contatos </dt> ' +381 '<dl></fieldset></div>' +382 '<div style="margin-left:10px;margin-top:5px">' +383 '<fieldset><legend> Ativar aviso de mensagens recebidas :</legend>'+384 '<input id="rd_nm" type="radio" name="rd_aviso"> Normal <i>(Função Indisponível)</i></br>' +385 '<input id="rd_al" type="radio" name="rd_aviso"> Com Alertas <i>(Função Indisponível)</i></br>' +386 '<input id="rd_ch" type="radio" name="rd_aviso"> Treme Tela <i>(Função Indisponível)</i>' +387 '</fieldset>'+388 '</div>'+389 '<div style="margin-left:10px;margin-top:5px">'+390 '<font style="size:8pt;color:red">* É necessário salvar as opções *</p>'+391 '<input type="button" value="Salvar" onclick="javascript:Preferences.SetPreferences()">'+392 '<input type="button" value="Cancelar" onclick="javascript:im_win.windowClose(\'divYourPrefe_im_window\')">'+393 '</div>';394 395 this.conf_form("divYourPrefe",345,230,form_your_prefe,":: " + IM.get_lang('Preferences') + " - Expresso ::");396 321 } 397 322 -
trunk/instant_messenger/js/im_var_globals.js
r20 r55 10 10 window.onfocus = windowFocus; 11 11 window.onclick = windowFocus; 12 window.onmousemove = awayTimer; 12 13 13 window_title = document.title;14 var window_title = document.title; 14 15 16 var statusFlag = 'available'; 17 var awayFlag = false; 18 var _awayTimer = null; 19 20 function awayTimer() 21 { 22 if ( awayFlag ) 23 IM.setAway(); 24 25 if(IM.im_time_) 26 { 27 if ( _awayTimer ) 28 clearTimeout(_awayTimer); 29 _awayTimer = setTimeout("IM.setAway()", parseInt(IM.im_time_) * 60000 ); 30 } 31 } 32 awayTimer(); 15 33 function windowBlur() {focusFlag = false; document.title = window_title;} 16 34 function windowFocus() {focusFlag = true; document.title = window_title;} -
trunk/instant_messenger/js/im_win.js
r36 r55 4 4 _imWindowTemplate : null, 5 5 xslWin : false, 6 6 photo : false, 7 7 8 "load" : function() 8 9 { 9 backFantom = func.newEl('div'); 10 func.confEl(backFantom, 'id', 'backFantom'); 11 func.confEl(backFantom, 'style', 'position:absolute;top:0px;left:0px;width:100%;height:100%;'); 12 13 test = func.newEl('div'); 14 func.confEl(test, 'id', 'test'); 15 func.confEl(test, 'style', 'visibility: hidden;'); 16 17 emotions = func.newEl('div'); 18 func.confEl(emotions, 'id', 'shared_emotions'); 19 func.confEl(emotions, 'class', 'emotionFrame'); 20 func.confEl(emotions, 'style', 'position:absolute;padding:1px;left:350px;visibility:hidden;top:0px'); 21 22 font_name = func.newEl('div'); 23 func.confEl(font_name, 'id', 'shared_fontName'); 24 func.confEl(font_name, 'class', 'statusMenu'); 25 func.confEl(font_name, 'style', 'position:absolute;visibility:hidden;padding:1px;left:400px;top:0px'); 26 27 font_size = func.newEl('div'); 28 func.confEl(font_size, 'id', 'shared_fontSize'); 29 func.confEl(font_size, 'class', 'statusMenu'); 30 func.confEl(font_size, 'style', 'position:absolute;visibility:hidden;padding:1px;left:400px;top:0px'); 31 32 font_color = func.newEl('div'); 33 func.confEl(font_color, 'id', 'shared_fontColor'); 34 func.confEl(font_color, 'class', 'statusMenu'); 35 func.confEl(font_color, 'style', 'position:absolute;visibility:hidden;padding:1px;left:400px;top:0px'); 36 37 font_style = func.newEl('div'); 38 func.confEl(font_style, 'id', 'shared_fontStyle'); 39 func.confEl(font_style, 'class', 'statusMenu'); 40 func.confEl(font_style, 'style', 'position:absolute;visibility:hidden;padding:1px;left:400px;top:0px'); 41 42 func.insEl(backFantom, test, emotions, font_name, font_size, font_color, font_style, false); 43 44 emotions.innerHTML = Templates.emotions(); 45 font_name.innerHTML = Templates.font_name(); 46 font_size.innerHTML = Templates.font_size(); 47 font_color.innerHTML = Templates.font_color(); 48 font_style.innerHTML = Templates.font_style(); 49 50 pId = 'contacts'; 51 52 main_menu_all = func.newEl('div'); 53 func.confEl(main_menu_all, 'style', 'margin: 3px;'); 54 55 main_menu_head = func.newEl('div'); 56 func.confEl(main_menu_head, 'id', pId + '_im_window_body_inner_head'); 57 func.confEl(main_menu_head, 'style', 'margin: 0px 0px 3px 0px; border: 1px solid #809aa9; display: block;'); 58 59 main_menu_body = func.newEl('div'); 60 func.confEl(main_menu_body, 'id', 'div_contacts'); 61 func.confEl(main_menu_body, 'style', 'border: 1px solid #809aa9;'); 62 63 func.insEl(main_menu_head, main_menu_body, main_menu_all); 64 65 main_menu_head_picture = func.newEl('img'); 66 func.confEl(main_menu_head_picture, 'id', pId + '_avatar'); 67 func.confEl(main_menu_head_picture, 'src', img_photo.src); 68 func.confEl(main_menu_head_picture, 'style', 'float: left; height: 65px; margin: 2px; width: 49px;'); 69 70 main_menu_head_name = func.newEl('span'); 71 func.confEl(main_menu_head_name, 'id', 'span_nickname'); 72 main_menu_head_name_txt = document.createTextNode(" your nickname"); 73 func.insEl(main_menu_head_name_txt, main_menu_head_name); 74 75 br1 = func.newEl('br'); 76 77 main_menu_head_message = func.newEl('span'); 78 func.confEl(main_menu_head_message, 'id', 'span_message'); 79 main_menu_head_message_txt = document.createTextNode(' your message'); 80 func.insEl(main_menu_head_message_txt, main_menu_head_message); 81 82 br2 = func.newEl('br'); 83 84 main_menu_head_pref = func.newEl('span'); 85 func.confEl(main_menu_head_pref, 'id', 'span_menu_pref'); 86 func.confEl(main_menu_head_pref,'style','float: left;'); 87 88 br3 = func.newEl('br'); 89 func.confEl(br3, 'style', 'clear: both'); 90 91 func.insEl(main_menu_head_picture, main_menu_head_name, br1, main_menu_head_message, br2, main_menu_head_pref, br3, main_menu_head); 92 93 main_menu_head_pref_img = func.newEl('img'); 94 func.confEl(main_menu_head_pref_img, 'src', img_group_close.src); 95 func.confEl(main_menu_head_pref_img, 'id', 'img_pref'); 96 97 main_menu_head_pref.onclick = function(){IM.menu_preferences('menu_preferences');}; 98 main_menu_head_pref_txt = document.createTextNode(IM.get_lang('Options')); 99 100 main_menu_head_div = func.newEl("div"); 101 func.confEl(main_menu_head_div,'id','menu_preferences'); 102 func.confEl(main_menu_head_div,'class','menu_im'); 103 func.confEl(main_menu_head_div,'style','float: left;cursor:pointer'); 104 105 func.insEl(main_menu_head_pref_img, main_menu_head_pref_txt, main_menu_head_div, main_menu_head_pref); 106 107 var params = []; 108 params['body'] = main_menu_all; 109 params['close'] = true; 110 params['height'] = 260; 111 params['left'] = 10; 112 params['id'] = pId; 113 params['maximize'] = true; 114 params['style'] = 'visibility:hidden'; 115 params['title'] = ".: " + IM.get_lang("instant_messenger") + " :."; 116 params['top'] = 10; 117 params['width'] = 250; 118 this.build(params); 119 120 this.config(pId); 121 122 this.windowMinimize(pId + '_im'); 10 try 11 { 12 backFantom = func.newEl('div'); 13 func.confEl(backFantom, 'id', 'backFantom'); 14 func.confEl(backFantom, 'style', 'position:absolute;top:0px;left:0px;width:100%;height:100%;z-Index:-1;'); 15 16 test = func.newEl('div'); 17 func.confEl(test, 'id', 'test'); 18 func.confEl(test, 'style', 'visibility: hidden;'); 19 20 menu_contato = func.newEl('div'); 21 func.confEl(menu_contato, 'id', 'menu_contato'); 22 func.confEl(menu_contato, 'class', 'menu_im'); 23 func.confEl(menu_contato, 'style', 'position:absolute;z-index:99999'); 24 25 emotions = func.newEl('div'); 26 func.confEl(emotions, 'id', 'shared_emotions'); 27 func.confEl(emotions, 'class', 'emotionFrame'); 28 func.confEl(emotions, 'style', 'position:absolute;padding:1px;left:350px;visibility:hidden;top:0px'); 29 30 font_name = func.newEl('div'); 31 func.confEl(font_name, 'id', 'shared_fontName'); 32 func.confEl(font_name, 'class', 'statusMenu'); 33 func.confEl(font_name, 'style', 'position:absolute;visibility:hidden;padding:1px;left:400px;top:0px'); 34 35 font_size = func.newEl('div'); 36 func.confEl(font_size, 'id', 'shared_fontSize'); 37 func.confEl(font_size, 'class', 'statusMenu'); 38 func.confEl(font_size, 'style', 'position:absolute;visibility:hidden;padding:1px;left:400px;top:0px'); 39 40 font_color = func.newEl('div'); 41 func.confEl(font_color, 'id', 'shared_fontColor'); 42 func.confEl(font_color, 'class', 'statusMenu'); 43 func.confEl(font_color, 'style', 'position:absolute;visibility:hidden;padding:1px;left:400px;top:0px'); 44 45 font_style = func.newEl('div'); 46 func.confEl(font_style, 'id', 'shared_fontStyle'); 47 func.confEl(font_style, 'class', 'statusMenu'); 48 func.confEl(font_style, 'style', 'position:absolute;visibility:hidden;padding:1px;left:400px;top:0px'); 49 50 func.insEl(backFantom, test, menu_contato, emotions, font_name, font_size, font_color, font_style, false); 51 52 emotions.innerHTML = Templates.emotions(); 53 font_name.innerHTML = Templates.font_name(); 54 font_size.innerHTML = Templates.font_size(); 55 font_color.innerHTML = Templates.font_color(); 56 font_style.innerHTML = Templates.font_style(); 57 58 pId = 'contacts'; 59 60 main_menu_all = func.newEl('div'); 61 func.confEl(main_menu_all, 'style', 'margin: 3px;'); 62 63 main_menu_head = func.newEl('div'); 64 func.confEl(main_menu_head, 'id', pId + '_im_window_body_inner_head'); 65 func.confEl(main_menu_head, 'style', 'margin: 0px 0px 3px 0px; border: 1px solid #809aa9; display: block;'); 66 67 main_menu_vcard = func.newEl('div'); 68 func.confEl(main_menu_vcard, 'id', 'im_vcard_contacts'); 69 func.confEl(main_menu_vcard, 'style', 'display: none;'); 70 71 main_menu_body = func.newEl('div'); 72 func.confEl(main_menu_body, 'id', 'div_contacts'); 73 func.confEl(main_menu_body, 'style', 'border: 1px solid #809aa9;'); 74 75 func.insEl(main_menu_head, main_menu_vcard, main_menu_body, main_menu_all); 76 77 main_menu_head_picture = func.newEl('img'); 78 func.confEl(main_menu_head_picture, 'id', pId + '_avatar'); 79 func.confEl(main_menu_head_picture, 'src', img_photo.src); 80 func.confEl(main_menu_head_picture, 'style', 'float: left; height: 65px; margin: 2px; width: 49px;'); 81 82 main_menu_head_name = func.newEl('span'); 83 func.confEl(main_menu_head_name, 'id', 'span_nickname'); 84 main_menu_head_name_txt = document.createTextNode(" your nickname"); 85 func.insEl(main_menu_head_name_txt, main_menu_head_name); 86 87 br1 = func.newEl('br'); 88 89 main_menu_head_message = func.newEl('span'); 90 func.confEl(main_menu_head_message, 'id', 'span_message'); 91 main_menu_head_message_txt = document.createTextNode(' your message'); 92 func.insEl(main_menu_head_message_txt, main_menu_head_message); 93 94 br2 = func.newEl('br'); 95 96 func.insEl(main_menu_head_picture, main_menu_head_name, br1, main_menu_head_message, br2, main_menu_head); 97 98 main_menu_head_div = func.newEl("div"); 99 func.confEl(main_menu_head_div,'id','menu_preferences'); 100 func.confEl(main_menu_head_div,'class','menu_im'); 101 func.confEl(main_menu_head_div,'style','float: left;cursor:pointer'); 102 103 func.insEl(main_menu_head_div, false); 104 105 var params = []; 106 params['body'] = main_menu_all; 107 params['close'] = true; 108 params['height'] = 260; 109 params['left'] = 10; 110 params['id'] = pId; 111 params['maximize'] = true; 112 params['style'] = 'visibility:hidden'; 113 params['title'] = ".: " + IM.get_lang("instant_messenger") + " :."; 114 params['top'] = 10; 115 params['width'] = 200; 116 this.build(params); 117 118 this.config(pId); 119 120 this.windowMinimize(pId + '_im'); 121 122 main_menu_head.innerHTML += '<span id="span_menu_pref" style="float: left;" onmousedown="IM.menu_preferences(event ,\'menu_preferences\'); document.oncontextmenu = new Function(\'return false\');"></span>'; 123 124 br3 = func.newEl('br'); 125 func.confEl(br3, 'style', 'clear: both'); 126 127 div_ie = func.newEl('div'); 128 129 func.insEl(br3, div_ie, main_menu_head); 130 131 main_menu_head_pref_img = func.newEl('img'); 132 func.confEl(main_menu_head_pref_img, 'src', img_group_close.src); 133 func.confEl(main_menu_head_pref_img, 'id', 'img_pref'); 134 135 main_menu_head_pref_txt = document.createTextNode(IM.get_lang('Options')); 136 137 func.insEl(main_menu_head_pref_img, main_menu_head_pref_txt, 'span_menu_pref'); 138 } 139 catch(e) 140 { 141 alert("load\n\n" + e + "\n\n" + e.description) 142 } 123 143 }, 124 144 125 145 "config" : function(pId) 126 146 { 127 ADD_DHTML("backFantom"+NO_DRAG); 128 ADD_DHTML("shared_fontStyle"+NO_DRAG); 129 ADD_DHTML("shared_fontColor"+NO_DRAG); 130 ADD_DHTML("shared_fontSize"+NO_DRAG); 131 ADD_DHTML("shared_fontName"+NO_DRAG); 132 ADD_DHTML("shared_emotions"+NO_DRAG); 133 ADD_DHTML(pId+"_im_window_body_inner"+NO_DRAG); 134 ADD_DHTML(pId+"_im_window"+NO_DRAG); 135 ADD_DHTML(pId+"_im_window_master"+NO_DRAG); 136 ADD_DHTML(pId+"_im_window_fantom"+NO_DRAG); 137 ADD_DHTML(pId+"_im_window_movable"+CURSOR_MOVE); 138 ADD_DHTML(pId+"_im_window_resize"+CURSOR_NW_RESIZE); 139 140 141 dd.elements.backFantom.setOpacity(0); 142 document.getElementById("backFantom").style.zIndex = -1; 143 144 145 dd.elements.contacts_im_window_resize.moveTo(dd.elements.contacts_im_window.x+dd.elements.contacts_im_window.w-dd.elements.contacts_im_window_resize.w-2, dd.elements.contacts_im_window.y+dd.elements.contacts_im_window.h-dd.elements.contacts_im_window_resize.h-2); 146 dd.elements.contacts_im_window_movable.moveTo(dd.elements.contacts_im_window.x, dd.elements.contacts_im_window.y); 147 dd.elements.contacts_im_window_movable.setOpacity(0); 148 149 dd.elements.contacts_im_window_resize.setOpacity(1); 150 dd.elements.contacts_im_window_resize.moveTo(dd.elements.contacts_im_window_fantom.x+dd.elements.contacts_im_window_fantom.w-dd.elements.contacts_im_window_resize.w-2, dd.elements.contacts_im_window_fantom.y+dd.elements.contacts_im_window_fantom.h-dd.elements.contacts_im_window_resize.h-2); 151 152 var contacts_im_window = new Object(); 153 contacts_im_window.x = dd.elements.contacts_im_window_master.x; 154 contacts_im_window.y = dd.elements.contacts_im_window_master.y; 155 contacts_im_window.w = dd.elements.contacts_im_window_master.w; 156 contacts_im_window.h = dd.elements.contacts_im_window_master.h; 157 contacts_im_window.state = WINDOW_STATE_REGULAR; 158 windowItems[pId] = contacts_im_window; 147 try 148 { 149 ADD_DHTML("backFantom"+NO_DRAG); 150 ADD_DHTML("shared_fontStyle"+NO_DRAG); 151 ADD_DHTML("shared_fontColor"+NO_DRAG); 152 ADD_DHTML("shared_fontSize"+NO_DRAG); 153 ADD_DHTML("shared_fontName"+NO_DRAG); 154 ADD_DHTML("shared_emotions"+NO_DRAG); 155 ADD_DHTML(pId+"_im_window_body_inner"+NO_DRAG); 156 ADD_DHTML(pId+"_im_window"+NO_DRAG); 157 ADD_DHTML(pId+"_im_window_master"+NO_DRAG); 158 ADD_DHTML(pId+"_im_window_fantom"+NO_DRAG); 159 ADD_DHTML(pId+"_im_window_movable"+CURSOR_MOVE); 160 ADD_DHTML(pId+"_im_window_resize"+CURSOR_NW_RESIZE); 161 162 163 dd.elements.backFantom.setOpacity(0); 164 document.getElementById("backFantom").style.zIndex = -1; 165 166 167 dd.elements.contacts_im_window_resize.moveTo(dd.elements.contacts_im_window.x+dd.elements.contacts_im_window.w-dd.elements.contacts_im_window_resize.w-2, dd.elements.contacts_im_window.y+dd.elements.contacts_im_window.h-dd.elements.contacts_im_window_resize.h-2); 168 dd.elements.contacts_im_window_movable.moveTo(dd.elements.contacts_im_window.x, dd.elements.contacts_im_window.y); 169 dd.elements.contacts_im_window_movable.setOpacity(0); 170 171 dd.elements.contacts_im_window_resize.setOpacity(1); 172 dd.elements.contacts_im_window_resize.moveTo(dd.elements.contacts_im_window_fantom.x+dd.elements.contacts_im_window_fantom.w-dd.elements.contacts_im_window_resize.w-2, dd.elements.contacts_im_window_fantom.y+dd.elements.contacts_im_window_fantom.h-dd.elements.contacts_im_window_resize.h-2); 173 174 var contacts_im_window = new Object(); 175 contacts_im_window.x = dd.elements.contacts_im_window_master.x; 176 contacts_im_window.y = dd.elements.contacts_im_window_master.y; 177 contacts_im_window.w = dd.elements.contacts_im_window_master.w; 178 contacts_im_window.h = dd.elements.contacts_im_window_master.h; 179 contacts_im_window.state = WINDOW_STATE_REGULAR; 180 windowItems[pId] = contacts_im_window; 181 } 182 catch(e) 183 { 184 alert("config\n\n" + e + "\n\n" + e.description) 185 } 159 186 }, 160 187 … … 172 199 var pTop = NaN; 173 200 var pWidth = 250; 174 201 //for ( aa in arguments ) 175 202 for ( var i = 0; i < arguments.length; i++ ) 176 203 { 177 if ( func.isArray(arguments[i]) )204 //if ( func.isArray(arguments[i]) ) 178 205 for ( var n in arguments[i] ) 179 206 if ( !func.isUndefined(arguments[i][n]) ) … … 215 242 } 216 243 217 if ( !this.xslWin ) this.xslWin = XMLTools.load(im_path + 'xsl/window.xsl ' + _time);244 if ( !this.xslWin ) this.xslWin = XMLTools.load(im_path + 'xsl/window.xsl?' + Date.parse(new Date)); 218 245 _xmlDoc = '<window id="' + pId + '" title="' + pTitle + '" height="' + pHeight + '" width="' + pWidth + '" left="' + pLeft + '" top="' + pTop + '" minimize="' + pMinimize + '" maximize="' + pMaximize + '" close="' + pClose + '" style="position:absolute;' + pStyle + '" />'; 219 246 … … 246 273 RoundedTop('div#' + pId + '_im_window_master', '', '#cbdae4'); 247 274 this.windowMaximizeZ(pId); 275 248 276 }, 249 277 … … 259 287 "hideWindowItem" : function(pId) 260 288 { 261 dd.elements[pId + "_im_window"].hide(); 262 dd.elements[pId + "_im_window_master"].hide(); 263 dd.elements[pId + "_im_window_fantom"].hide(); 264 dd.elements[pId + "_im_window_resize"].hide(); 265 dd.elements[pId + "_im_window_movable"].hide(); 266 if ( (name_document = document.getElementById(pId + '_divEdita')) ) 267 { 268 name_document.innerHTML = ''; 269 var contact = func.byId(pId); 270 var _status = IM.array_users[contact.getAttribute('nuncontact')].online 271 contact.firstChild.src = ( _status == parseInt(1) ) ? img_online.src : img_offline.src; 272 } 289 try 290 { 291 dd.elements[pId + "_im_window"].hide(); 292 dd.elements[pId + "_im_window_master"].hide(); 293 dd.elements[pId + "_im_window_fantom"].hide(); 294 dd.elements[pId + "_im_window_resize"].hide(); 295 dd.elements[pId + "_im_window_movable"].hide(); 296 if ( (name_document = document.getElementById(pId + '_divEdita')) ) 297 { 298 name_document.innerHTML = ''; 299 var contact = func.byId(pId); 300 var _status = IM.vcard_contacts[contact.getAttribute('nuncontact')].online 301 contact.firstChild.src = ( _status == parseInt(1) ) ? img_online.src : img_offline.src; 302 } 303 } 304 catch(e) 305 {} 273 306 }, 274 307 … … 430 463 if ( (name_document = document.getElementById(pId + '_divEdita')) ) 431 464 { 432 name_document.innerHTML = '<iframe name="' + pId.replace('@', '_at_').replace(/\./g, '_dot_') + '_edita" class="edit_message" id="' + pId + '_edita" frameborder="0" style="border:margin: 3px 1px 0px 2px; width:2 90px; height:50px; float:left;"></iframe>';465 name_document.innerHTML = '<iframe name="' + pId.replace('@', '_at_').replace(/\./g, '_dot_') + '_edita" class="edit_message" id="' + pId + '_edita" frameborder="0" style="border:margin: 3px 1px 0px 2px; width:220px; height:50px; float:left;"></iframe>'; 433 466 434 467 name_document = document.getElementById(pId + '_edita'); … … 452 485 "windowMaximizeZ" : function(objName) 453 486 { 454 this.incZ(); 455 document.getElementById(objName + "_im_window_fantom").style.zIndex = zValue-3; 456 document.getElementById(objName + "_im_window_master").style.zIndex = zValue-2; 457 document.getElementById(objName + "_im_window").style.zIndex = zValue-1; 458 document.getElementById(objName + "_im_window_body_inner").style.zIndex = zValue-1; 459 document.getElementById(objName + "_im_window_resize").style.zIndex = zValue; 460 document.getElementById(objName + "_im_window_movable").style.zIndex = zValue; 461 if ( dd.elements[objName + "_im_window_movable"] ) 462 dd.elements[objName + "_im_window_movable"].z = zValue+1; 487 try 488 { 489 this.incZ(); 490 document.getElementById(objName + "_im_window_fantom").style.zIndex = zValue-3; 491 document.getElementById(objName + "_im_window_master").style.zIndex = zValue-2; 492 document.getElementById(objName + "_im_window").style.zIndex = zValue-1; 493 document.getElementById(objName + "_im_window_body_inner").style.zIndex = zValue-1; 494 document.getElementById(objName + "_im_window_resize").style.zIndex = zValue; 495 document.getElementById(objName + "_im_window_movable").style.zIndex = zValue; 496 if ( dd.elements[objName + "_im_window_movable"] ) 497 dd.elements[objName + "_im_window_movable"].z = zValue+1; 498 } 499 catch(e) 500 {} 463 501 }, 464 502 … … 474 512 windowItem.state = WINDOW_STATE_MINIMIZED; 475 513 } 476 //this.hideAllChatSelections(); 514 477 515 }, 478 516 … … 515 553 window.status = objName + "'s Z: " + document.getElementById(objName+"_im_window").style.zIndex; 516 554 517 /*518 windowItem.x = dd.elements[objName + "_im_window"].x;519 windowItem.y = dd.elements[objName + "_im_window"].y;520 windowItem.w = dd.elements[objName + "_im_window"].w;521 windowItem.h = dd.elements[objName + "_im_window"].h;522 */523 555 } 524 556 else … … 532 564 dd.elements[objName + "_im_window_master"].moveTo(windowItem.x, windowItem.y); 533 565 dd.elements[objName + "_im_window_resize"].moveTo(dd.elements[objName + "_im_window_fantom"].x+dd.elements[objName + "_im_window_fantom"].w-dd.elements[objName + "_im_window_resize"].w-2, dd.elements[objName + "_im_window_fantom"].y+dd.elements[objName + "_im_window_fantom"].h-dd.elements[objName + "_im_window_resize"].h-2); 534 //document.getElementById(objName + "_im_window_body_inner").style.width="100%";535 //document.getElementById(objName + "_im_window_body_inner").style.height="100%";536 566 windowItem.state = WINDOW_STATE_REGULAR; 537 567 } … … 543 573 this.windowMaximizeZ(objName); 544 574 } 575 576 if( !this.photo ) 577 { 578 setTimeout('im_win.get_photo_ldap(\"user@user\")',1000 ); 579 this.photo = true; 580 } 545 581 }, 546 582 … … 552 588 { 553 589 this.windowMaximizeZ(pId); 554 this.showWindowItem(pId);590 this.showWindowItem(pId); 555 591 } 556 592 else … … 593 629 { 594 630 text = ''; 595 text += '<div class=border id="' + pId + '_chatMessages" style="width:99%; height:130px; margin: 0 0 2px 0; overflow:auto;"></div>' 631 text += '<div class="border" id="' + pId + '_chatMessages" style="width:220px; height:130px; margin: 2px 0px 2px 2px; overflow:auto;"></div>' 632 text += '<div style="float: left; position: relative; height:130px;">'; 633 text += ' <div class="myAvatar">' 634 text += ' <img id="' + pId + '_avatar" alt="Display Picture" title="Display Picture" src="' + im_path + 'templates/default/images/photo.png" width="49" height="65" border="0" />' 635 text += ' </div>' 636 text += ' <div id="' + pId + '_composing" class="composing"><img src="' + img_typing.src + '" /></div>'; 637 text += '</div>'; 596 638 text += '<br style="clear:both;"/>' 597 text += '<div class="myAvatar">'598 text += ' <img id="' + pId + '_avatar" alt="Display Picture" title="Display Picture" src="' + im_path + 'templates/default/images/photo.png" width="49" height="65" border="0" />'599 text += '</div>'600 639 text += '<dl>' 601 640 text += ' <dd class="small">' … … 618 657 text += ' <span id="selectFontStyleDiv" class="des-small" onmouseover="selectDiv(this)" onmouseout="unselectDiv(this)" onclick="im_win.showFontStyleSelection(\'' + pId + '\')" title="Select Font Color here!" style="height:19px;">'+IM.get_lang('Style')+'</span>' 619 658 text += ' </dd>' 620 text += ' <dd class="small">|</dd>'621 text += ' <dd class="small">'622 text += ' <span id="selectFontStyleDiv" class="des-small" onmouseover="selectDiv(this)" onmouseout="unselectDiv(this)" onclick="Preferences.SendFile(\'' + pId + '\')" title="Select Send File here!" style="height:19px;">'+IM.get_lang('Send File')+'</span>'623 text += ' </dd>'624 659 text += '</dl>' 625 text += '<div id="' + pId + '_divEdita"><iframe name="' + pId.replace('@', '_at_').replace(/\./g, '_dot_') + '_edita" class="edit_message" id="' + pId + '_edita" frameborder="0" style="border:margin: 3px 1px 0px 2px; width:290px; height:50px; float:left;"></iframe></div>' 626 text += '<a onclick="javascript:IM.sendMessage(\'' + pId + '\')" title="Send a message" style="float:left"><img src="' + im_path + 'templates/default/images/img/skins/deathdart/send.gif" width="102" height="50" border=0 style="margin-top:3px"></a>'; 660 text += '<div id="' + pId + '_divEdita" style="margin: 0px 2px"><iframe name="' + pId.replace('@', '_at_').replace(/\./g, '_dot_') + '_edita" class="edit_message" id="' + pId + '_edita" frameborder="0" style="margin: 3px 1px 0px 2px; width:220px; height:50px; float:left;"></iframe></div>' 661 text += '<br/><a onclick="javascript:IM.sendMessage(\'' + pId + '\')" title="Send a message" style="float:left;margin: 0px 2px;"><img src="' + im_path + 'templates/default/images/img/skins/deathdart/send.gif" width="50" height="25" border=0 style="margin-top:3px"></a>'; 662 text += '<br style="clear:both" /><span id="' + pId + '_im_window_message" style="margin-left: 2px" />'; 627 663 628 664 var params = []; 629 665 params['body'] = text; 630 params['height'] = 2 15;666 params['height'] = 225; 631 667 params['id'] = pId; 632 668 params['maximize'] = false; 633 669 params['minimize'] = false; 634 670 params['title'] = pId; 635 params['width'] = 475;671 params['width'] = 320; 636 672 this.create_window(params); 637 673 … … 648 684 649 685 name_document.contentWindow.focus(); 686 687 var status = func.byId(pId + '_im_window'); 688 status.firstChild.style.background = 'url('+func.byId(pId).firstChild.src+')'; 650 689 } 651 690 else … … 658 697 { 659 698 var uid_ldap = IdLdap.substr(0,IdLdap.indexOf('@')); 660 var handler_photo_ldap = function(data){ 661 if(data){ 662 IdLdap = ( IM.vcard_user['VCARD_JID'] == IdLdap ) ? 'contacts' : IdLdap; 699 var handler_photo_ldap = function(_XMLdata) 700 { 701 var data = _XMLdata.getElementsByTagName('retorno').item(0); 702 data = eval(data.firstChild.nodeValue); 703 if(data) 704 { 705 IdLdap = ( IdLdap == 'user@user' ) ? 'contacts' : IdLdap; 663 706 if( document.getElementById(IdLdap + "_avatar") != null ){ 664 707 var ph_img = document.getElementById(IdLdap + "_avatar"); … … 667 710 } 668 711 } 669 cIM.cExecute("$this.ldap_im.photo_ldap",handler_photo_ldap,"uid="+uid_ldap); 712 713 XMLTools.__RETURN_MODE__ = 'XML'; 714 XMLTools.request('$this.ldap_im.photo_ldap','POST',handler_photo_ldap,'uid='+uid_ldap); 670 715 }, 671 716 … … 684 729 if ( objName != 'contacts' ) 685 730 { 686 var win dow = document.getElementById(objName + '_im_window');731 var win = document.getElementById(objName + '_im_window_master'); 687 732 var resize = document.getElementById(objName + '_im_window_resize'); 688 733 var fantom = document.getElementById(objName + '_im_window_fantom'); 689 734 var movable = document.getElementById(objName + '_im_window_movable'); 690 735 691 win dow.parentNode.removeChild(window);736 win.parentNode.removeChild(win); 692 737 resize.parentNode.removeChild(resize); 693 738 fantom.parentNode.removeChild(fantom); … … 902 947 { 903 948 if ( document.title=="......................" ) 904 document.title = IM.get_lang( 'New Message!');949 document.title = IM.get_lang("New Message!"); 905 950 else 906 951 document.title = "......................"; 907 952 908 //this.Mod_Notification();909 953 this.Mod_Notification(); 954 910 955 if ( newMessageTimer ) 911 956 clearTimeout(newMessageTimer); … … 921 966 "Mod_Notification" : function() 922 967 { 923 /*var mode = ""; 924 925 switch(mode){ 926 927 case "normal" : 928 //alert('Modo Normal'); 929 break; 930 case "alerta" : 931 //alert('Modo Alerta'); 932 break; 933 case "chato" : 934 // Treme Tela 935 if(self.moveBy) 936 { 937 for(i=10;i>0;i--) 938 { 939 self.moveBy(i,0); 940 self.moveBy(-i,0); 941 } 942 } 943 break; 944 default : 945 }*/ 946 968 // Aviso Normal 969 if(eval(IM_Preferences.LoadPreferences('rd_nm'))) 970 { 971 } 972 // Aviso Chato 973 if(eval(IM_Preferences.LoadPreferences('rd_ch'))) 974 { 975 if(self.moveBy) 976 { 977 for(i=10;i>0;i--) 978 { 979 self.moveBy(i,0); 980 self.moveBy(-i,0); 981 } 982 } 983 } 947 984 }, 948 985 … … 1044 1081 return(objlist); 1045 1082 } 1046 function AddTop(el,bk,color,size){ 1047 var i; 1048 var d=document.createElement("b"); 1049 var cn="_r"; 1050 var lim=4; 1051 if(size && size=="small"){ cn="_rs"; lim=2} 1052 d.className="_rtop"; 1053 d.style.backgroundColor=bk; 1054 for(i=1;i<=lim;i++) 1055 { 1056 var x=document.createElement("b"); 1057 x.className=cn + i; 1058 x.style.backgroundColor=color; 1059 d.appendChild(x); 1083 function AddTop(el,bk,color,size) 1084 { 1085 try 1086 { 1087 var i; 1088 var d=document.createElement("b"); 1089 var cn="_r"; 1090 var lim=4; 1091 if(size && size=="small"){ cn="_rs"; lim=2} 1092 d.className="_rtop"; 1093 d.style.backgroundColor=bk; 1094 for(i=1;i<=lim;i++) 1095 { 1096 var x=document.createElement("b"); 1097 x.className=cn + i; 1098 x.style.backgroundColor=color; 1099 d.appendChild(x); 1100 } 1101 el.insertBefore(d,el.firstChild); 1060 1102 } 1061 el.insertBefore(d,el.firstChild); 1103 catch(e) 1104 {} 1062 1105 } 1063 1106 function RoundedTop(selector,bk,color,size){ -
trunk/instant_messenger/templates/default/css.css
r20 r55 176 176 width: 166px; 177 177 } 178 178 179 .im_window_icon 179 180 { 180 background: url(images/img/favicon.ico) 0 0 no-repeat; 181 float: left; 182 height: 16px; 183 left: 4px; 184 overflow: hidden; 185 position: relative; 186 top: 3px; 187 width: 16px; 181 float: left; 182 height: 16px; 183 margin: 0px 5px; 184 width: 16px; 188 185 } 189 186 -
trunk/instant_messenger/templates/default/messenger.css
r20 r55 253 253 { 254 254 background: #fff; 255 border: 1px solid #b9cfd8; 256 float: left; 255 border: 2px solid #C9D9E8; 257 256 height: 65px; 257 margin: 2px; 258 258 padding: 2px; 259 position: relative;260 cursor: pointer;261 259 width: 49px; 260 } 261 262 div.composing 263 { 264 background: #fff; 265 bottom: 0px; 266 display: none; 267 height: 14px; 268 position: absolute; 269 width: 14px; 262 270 } 263 271 … … 288 296 .master 289 297 { 290 /*border:1px solid red;*/291 298 height: 250px; 292 299 margin: 0px; … … 299 306 .pai 300 307 { 301 background: #cbdae4 url(templates/default/images/icone.png)4px 2px no-repeat;308 background: #cbdae4 4px 2px no-repeat; 302 309 border: 1px solid #809aa9; 303 310 border-top: 0px; … … 305 312 margin: 0px 0px 0px 0px; 306 313 padding: 3px 2px 0px 0px; 307 314 position: relative; 308 315 z-index: 1; 309 316 } … … 330 337 { 331 338 border: 1px solid #809aa9; 332 /*float: right*/; 333 height: 13px; 334 width: 13px; 339 height: 13px; 340 width: 13px; 335 341 margin: 3px 58px 3px -3px; 336 342 padding: 0px; … … 338 344 .tit 339 345 { 340 /*border: 1px solid #f00;341 346 float: left; 342 width: 80%;*/343 347 height: 13px; 344 margin: 0px 0px 0px 22px;348 margin: 0px; 345 349 padding: 0px; 346 350 overflow: hidden; 347 351 } 348 /*349 .tit:before350 {351 content:"meu novo texto";352 overflow: hidden;353 }354 */355 352 ._rtop{display:block;} 356 353 ._rtop *{display:block;height: 1px;overflow: hidden} -
trunk/instant_messenger/xsl/window.xsl
r20 r55 10 10 <div id="{@id}_im_window_master" class="master" style="top:{@top};left:{@left};height:{(@height + 48)};width:{(@width + 12)};{@style}"> 11 11 <div id="{@id}_im_window" class="pai" style="height:{(@height + 40)}"> 12 <div id="{@id}_im_window_icon" class="im_window_icon" /> 12 13 <div class="tit"><xsl:value-of select="@title" /></div> 13 14 <xsl:apply-templates select="/" mode='buttons' />
Note: See TracChangeset
for help on using the changeset viewer.