Changeset 24 for trunk/instant_messenger
- Timestamp:
- 05/10/07 11:51:20 (17 years ago)
- Location:
- trunk/instant_messenger
- Files:
-
- 1 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/instant_messenger/docs/change_log.txt
r21 r24 6 6 27/04/2007 [0.001] 7 7 - Vcard, corrigido para a visualização de caracteres e acentos. 8 -
trunk/instant_messenger/inc/class.Jabber.inc.php
r20 r24 34 34 private $log_error = false; 35 35 36 private $array_teste = array();37 38 36 function __construct($pJid = false, $pPassword = false, $pPort = false) 39 37 { -
trunk/instant_messenger/inc/class.Ujabber.inc.php
r21 r24 1 1 <?php 2 /************************************************************ 3 * Classe Jabber - Expresso *4 * ------------------------------------------------------- *5 * Com Autenticação no Servidor Jabber com Tls*6 * Rodrigo Souza - rodsouza@celepar.pr.gov.br *7 * Alexandre Correia - alexandrecorreia@celepar.pr.gov.br 8 ************************************************************ /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 9 10 10 require_once "class.Jabber.inc.php"; … … 70 70 $group_nusers[0]['VCARD_DESC'] = $VCARD_P['DESC']; 71 71 $group_nusers[0]['VCARD_JID'] = $VCARD_P['JID']; 72 72 73 73 natcasesort($group_users); 74 74 $i=1; … … 146 146 { 147 147 $array_return[$j]['subscription'] = 'to'; 148 $array_return[$j]['name'] = '';148 $array_return[$j]['name'] = $array_db[$i]['im_from']; 149 149 $array_return[$j]['jid'] = $array_db[$i]['im_from']; 150 $array_return[$j]['group'] = ' ';150 $array_return[$j]['group'] = 'sem_grupo'; 151 151 $array_return[$j]['online'] = 0; 152 152 $j++; -
trunk/instant_messenger/inc/class.db_im.inc.php
r20 r24 14 14 var $db_pass; 15 15 var $db_type; 16 var $teste;17 16 18 17 function db_im(){ -
trunk/instant_messenger/js/im_functions.js
r23 r24 4 4 function IM() 5 5 { 6 this.array_lang_im = []; 7 this.user_not_aut = []; 8 this.vcard_contacts = []; 9 this.vcard_user = []; 6 this.array_lang_im = new Array(); 7 this.array_users = new Array(); 8 this.vcard_user = new Array(); 10 9 this.load_photo = false; 11 10 } … … 25 24 if ( data[1] ) 26 25 { 27 _this.vcard_contacts.splice(0,_this.vcard_contacts.length); 28 _this.vcard_user.splice(0,_this.vcard_user.length); 29 _this.user_not_aut.splice(0,_this.user_not_aut.length); 26 _this.array_users.splice(0,_this.array_users.length); 27 _this.array_users = data; 30 28 _this.mount_list(data); 31 32 29 } 33 30 _this.conf_VcardUser(data[0]); … … 73 70 } 74 71 } 75 76 77 72 /* 73 * Monta Lista de Contatos 74 */ 78 75 79 76 IM.prototype.mount_list = function(pList) … … 82 79 var div = document.getElementById("div_contacts"); 83 80 div.innerHTML = ""; 81 82 div.innerHTML += '<img id="img_all_groups" src=' + img_group_open.src + 83 ' onclick=javascript:IM.visible_group("all_groups")>' + 84 '<b>'+_this.get_lang('list of contacts') + ' - ' + ( pList.length - 1 ) + '</b><br>' + 85 '<div id="all_groups"></div>'; 86 87 for(var i=1; i < pList.length; i++){ 88 89 var div_agroups = document.getElementById("all_groups"); 84 90 85 var groups = "<b>"+_this.get_lang("list of contacts")+" - 0 </b><br>"; 86 87 if(pList.length > 0){ 88 var name_group = ""; 89 groups = "<img id='img_all_groups' src=" + img_group_open.src + " onclick=javascript:IM.visible_group('all_groups')>" + 90 "<b>"+_this.get_lang("list of contacts")+" - " + ( pList.length - 1 ) + "</b><br>"+ 91 "<div id='all_groups'>"; 92 for(var i=1; i < pList.length; i++){ 93 if( i == 1 ){ 94 if(pList[i].group != "" && pList[i].name != ""){ 95 name_group = pList[i].group; 96 groups += '<img id="img_' + pList[i].group.rm_space() + '" src="' + img_group_open.src + '" onclick="javascript:IM.visible_group(\'' + pList[i].group.rm_space() + '\')" style="margin-left:16px;">'; 97 groups += "<b>" + pList[i].group + "</b><br>"; 98 groups += "<div id='" + pList[i].group.rm_space() + "'>"; 99 if(pList[i].subscription == "both"){ 100 groups += '<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 + '\');" style="cursor:pointer;padding-left:32px;"><img src="' + ((pList[i].online) == parseInt(1) ? img_online.src : img_offline.src) + '">' + pList[i].name + '</div><span id="_span_' + pList[i].jid + '" class="menu_im"></span>'; 101 }else{ 102 groups += _this.FromToNone(pList[i].jid,pList[i].subscription,pList[i].group,pList[i].name); 103 } 104 }else 105 _this.user_not_aut[_this.user_not_aut.length] = pList[i].jid + ";" + i; 91 if(document.getElementById("img_" + pList[i].group.rm_space()) == null ){ 92 div_agroups.innerHTML += '<img id="img_' + pList[i].group.rm_space() + '" src="' + img_group_open.src + '" onclick="javascript:IM.visible_group(\'' + pList[i].group.rm_space() + '\')" style="margin-left:16px;">'; 93 div_agroups.innerHTML += '<b>' + pList[i].group + '</b></br>'; 94 95 if(pList[i].group.rm_space() != 'sem_grupo'){ 96 var div_group = document.createElement('DIV'); 97 div_group.id = pList[i].group.rm_space(); 98 if(pList[i].subscription.rm_space() == "both") 99 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) + '">' + pList[i].name + '</div><span id="_span_' + pList[i].jid + '" class="menu_im"></span>'; 100 else 101 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_wait_auth.src + '">' + pList[i].name + '</div><span id="_span_' + pList[i].jid + '" class="menu_im"></span>'; 102 div_agroups.appendChild(div_group); 106 103 }else{ 107 if(pList[i].group != "" && pList[i].name != ""){ 108 if(pList[i].group == name_group){ 109 if(pList[i].subscription == "both"){ 110 groups += '<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 + '\');" style="cursor:pointer;padding-left:32px;"><img src="' + ((pList[i].online) == parseInt(1) ? img_online.src : img_offline.src) + '">' + pList[i].name + '</div><span id="_span_' + pList[i].jid + '" class="menu_im"></span>'; 111 }else{ 112 groups += _this.FromToNone(pList[i].jid,pList[i].subscription,pList[i].group,pList[i].name); 113 } 114 name_group = pList[i].group; 115 }else{ 116 groups += "</div>"; 117 groups += '<img id="img_' + pList[i].group.rm_space() + '" src="' + img_group_open.src + '" onclick="javascript:IM.visible_group(\'' + pList[i].group.rm_space() + '\')" style="margin-left:16px;">'; 118 groups += "<b>" + pList[i].group + "</b><br>"; 119 groups += "<div id='" + pList[i].group.rm_space() + "'>"; 120 if(pList[i].subscription == "both"){ 121 groups += '<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 + '\');" style="cursor:pointer;padding-left:32px;"><img src="' + ((pList[i].online) == parseInt(1) ? img_online.src : img_offline.src) + '">' + pList[i].name + '</div><span id="_span_' + pList[i].jid + '" class="menu_im"></span>'; 122 }else{ 123 groups += _this.FromToNone(pList[i].jid,pList[i].subscription,pList[i].group,pList[i].name); 124 } 125 name_group = pList[i].group; 126 } 127 }else{ 128 _this.user_not_aut[_this.user_not_aut.length] = pList[i].jid + ";" + i; 129 } 104 var div_group = document.createElement('DIV'); 105 div_group.id = pList[i].group.rm_space(); 106 div_group.innerHTML = '<div id="'+pList[i].jid+'" onclick=Preferences.updateLoad("'+i+'") style="cursor:pointer;padding-left:32px;">'+ 107 '<img src="'+img_not_authorized.src+'">'+pList[i].jid+'</div>'; 108 div_agroups.appendChild(div_group); 130 109 } 110 }else{ 111 112 if(pList[i].group.rm_space() != 'sem_grupo'){ 113 var div_group = document.getElementById(pList[i].group.rm_space()); 114 if(pList[i].subscription.rm_space() == "both") 115 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) + '">' + pList[i].name + '</div><span id="_span_' + pList[i].jid + '" class="menu_im"></span>'; 116 else 117 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_wait_auth.src + '">' + pList[i].name + '</div><span id="_span_' + pList[i].jid + '" class="menu_im"></span>'; 118 div_agroups.appendChild(div_group); 119 }else{ 120 var div_group = document.getElementById(pList[i].group.rm_space()); 121 div_group.innerHTML += '<div id="'+pList[i].jid+'" onclick=Preferences.updateLoad("'+i+'") style="cursor:pointer;padding-left:32px;">'+ 122 '<img src="'+img_not_authorized.src+'">'+pList[i].jid+'</div>'; 123 div_agroups.appendChild(div_group); 124 } 131 125 } 132 groups += "</div><div id='out_list'></div></div>";133 126 } 134 135 // Vcard Contato;136 if(pList.length > 0)137 _this.vcard_contacts = pList;138 139 // Imprime valor de groups;140 div.innerHTML = groups;141 142 // Usuários sem grupo e nome;143 if(_this.user_not_aut.length > 0)144 _this.Group_Name(document.getElementById('out_list'));145 }146 147 /*148 * Define se From - To - None149 */150 151 IM.prototype.FromToNone = function(pJid,pSubscription,pGroup,pName)152 {153 var n_groups = "";154 var _this = this;155 if(pSubscription == "from")156 n_groups += "<div id='" + pJid + "' nucontact="+ i +" style='cursor:pointer;padding-left:32px;' onclick=javascript:IM.Authorization(\'"+pJid+"\',\'"+pSubscription+"\')><img src="+img_not_authorized.src+" title='Aguardando/Enviar Autorização'>"+pName+"</div>";157 else if(pSubscription == "to")158 n_groups += "<div id='" + pJid + "' nucontact="+ i +" style='cursor:pointer;padding-left:32px;' onclick=javascript:IM.Authorization(\'"+pJid+"\',\'"+pSubscription+"\')><img src="+img_not_authorized.src+" title='Enviar Autorização'>"+pName+"</div>";159 else if(pSubscription == "none"){160 n_groups += "<div id='" + pJid + "' nucontact="+ i +" style='cursor:pointer;padding-left:32px;' onclick=javascript:IM.Authorization(\'"+pJid+"\',\'"+pSubscription+"\')><img src="+img_not_authorized.src+" title='Pedir Autorização'>"+pName+"</div>";161 }162 return n_groups;163 }164 165 /*166 * Usuário sem grupo e nome167 */168 169 IM.prototype.Group_Name = function(el)170 {171 var _this = this;172 var group_nt = "";173 174 group_nt += '<img id="img_not_aut" src="' + img_group_open.src + '" onclick="javascript:IM.visible_group(\'not_aut\')" style="margin-left:16px;">';175 group_nt += "<b>" + _this.get_lang("Sem Cadastro") + "</b><br>";176 group_nt += "<div id='not_aut'>";177 for(var i=0; i < _this.user_not_aut.length; i++){178 var pos = _this.user_not_aut[i].indexOf("@");179 var ind = _this.user_not_aut[i].substr((_this.user_not_aut[i].indexOf(";")+1),1);180 group_nt += '<div id="'+_this.user_not_aut[i]+'" onclick=Preferences.updateLoad("'+ind+'") style="cursor:pointer;padding-left:32px;">'+181 '<img src="'+img_not_authorized.src+'">'+_this.user_not_aut[i].substr(0,pos)+'</div>';182 }183 group_nt += "</div>";184 el.innerHTML = group_nt;185 127 setTimeout("Templates.Users_Not_Auth()",2500); 186 128 } … … 238 180 239 181 // Vcard pessoal; 240 241 182 if ( !_this.load_photo ){ 242 183 … … 249 190 _this.vcard_user['VCARD_DESC'] = decodeURI(data.VCARD_DESC); 250 191 _this.vcard_user['VCARD_JID'] = decodeURI(data.VCARD_JID); 251 252 im_win.get_photo_ldap( _this.vcard_user['VCARD_JID']);192 193 im_win.get_photo_ldap(decodeURI(data['VCARD_JID'])); 253 194 _this.load_photo = true; 254 195 } … … 341 282 mensagens = document.getElementById(data[i].from.substr(0, data[i].from.indexOf('/')) + '_chatMessages'); 342 283 var nickname = data[i].from.substr(0, data[i].from.indexOf('/')); 343 for(var j=1 ; j < _this. vcard_contacts.length ; j++)284 for(var j=1 ; j < _this.array_users.length ; j++) 344 285 { 345 if(data[i].from.substr(0, data[i].from.indexOf('/')) == _this.vcard_contacts[j].VCARD_JID) 346 if(_this.vcard_contacts[j].VCARD_NICKNAME != "") 347 nickname = _this.vcard_contacts[j].VCARD_NICKNAME; 286 var nick_user = decodeURI(_this.array_users[j].VCARD_JID); 287 288 if( nickname.rm_space() == nick_user.rm_space()) 289 { 290 var vcard_nick = decodeURI(_this.array_users[j].VCARD_NICKNAME); 291 if( vcard_nick != "") 292 { 293 nickname = vcard_nick; 294 if(nickname.rm_space() == decodeURI(_this.array_users[j].VCARD_NICKNAME)) 295 nickname = nickname; 296 else 297 nickname = decodeURI(_this.array_users[j].VCARD_NICKNAME); 298 } 299 } 348 300 } 349 301 350 302 minuto = ( hora.getMinutes() > 9 ) ? hora.getMinutes() : '0' + hora.getMinutes(); 351 303 _hora = '[' + hora.getHours() + ':' + minuto + '] '; … … 372 324 } 373 325 374 375 376 326 /* 327 * Envia Mensagens 328 */ 377 329 378 330 IM.prototype.sendMessage = function (pJID) … … 591 543 } 592 544 593 IM.prototype.menu_button_right = function(pElement) 594 { 595 var form_menu_button_right = '<dl>'+ 596 '<dt><a href="javascript:void(0);" onclick="javascript:Preferences.Update_NickName(\''+pElement+'\');"><img src="'+img_group_close.src+'">' + IM.get_lang('Nick') + '</a>'+ 597 '<dt><a href="javascript:void(0);" onclick="javascript:Preferences.SendFile(\''+pElement+'\');"><img src="'+img_group_close.src+'">' + IM.get_lang('Send File') + '</a>'+ 598 '<dt><a href="javascript:void(0);" onclick="javascript:Preferences.Update_Group(\''+pElement+'\');"><img src="'+img_group_close.src+'">' + IM.get_lang('Group') + '</a>'+ 599 '<dt><a href="javascript:void(0);" onclick="javascript:Preferences.Remove_Contact(\''+pElement+'\');"><img src="'+img_group_close.src+'">' + IM.get_lang('Delete') + '</a>'+ 600 '<dt><a href="javascript:void(0);" onclick="javascript:Preferences.vCardLoad_Contact(\''+pElement+'\');"><img src="'+img_group_close.src+'">' + IM.get_lang('See Info') + '</a>'+ 601 '</dl>'; 545 IM.prototype.menu_button_right = function(pElement,pReq) 546 { 547 var form_menu_button_right = '<dl>'; 548 if(pReq) 549 { 550 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>'; 551 } 552 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>'+ 553 '<dt><a href="javascript:void(0);" onclick="javascript:Preferences.SendFile(\''+pElement+'\');"><img src="'+img_group_close.src+'">' + IM.get_lang('Send File') + '</a>'+ 554 '<dt><a href="javascript:void(0);" onclick="javascript:Preferences.Update_Group(\''+pElement+'\');"><img src="'+img_group_close.src+'">' + IM.get_lang('Group') + '</a>'+ 555 '<dt><a href="javascript:void(0);" onclick="javascript:Preferences.Remove_Contact(\''+pElement+'\');"><img src="'+img_group_close.src+'">' + IM.get_lang('Delete') + '</a>'+ 556 '<dt><a href="javascript:void(0);" onclick="javascript:Preferences.vCardLoad_Contact(\''+pElement+'\');"><img src="'+img_group_close.src+'">' + IM.get_lang('See Info') + '</a>'+ 557 '</dl>'; 602 558 im_menu_action.menu("_span_" + pElement, form_menu_button_right); 603 559 } … … 608 564 609 565 function url_encode(str) 610 {566 { 611 567 var hex_chars = "0123456789ABCDEF"; 612 568 var noEncode = /^([a-zA-Z0-9\_\-\.])$/; … … 634 590 */ 635 591 636 IM.prototype.action_button = function(pEv,pStatus,pJid )592 IM.prototype.action_button = function(pEv,pStatus,pJid,pReq) 637 593 { 638 594 var _this = this; 639 595 if(pEv.button > 1){ 640 _this.menu_button_right(pJid );596 _this.menu_button_right(pJid,pReq); 641 597 document.oncontextmenu = new Function("return false"); 642 598 }else{ … … 684 640 } 685 641 686 function teste(pJID)687 {688 document.getElementById(pJID + '_edita').onkeydown = function (e){689 if (is_ie)690 {691 if ((window.event.keyCode) == 13)692 send(pJID);693 }694 else695 {696 if ((e.keyCode) == 13)697 {698 send(pJID);699 return false;700 }701 }702 }703 }704 705 642 // Build Object 706 643 var IM = new IM(); -
trunk/instant_messenger/js/im_images.js
r23 r24 34 34 var img_wait = new Image(); 35 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"; 36 38 var img_chat_bubble = new Image(); 37 39 img_chat_bubble.src = im_path + "templates/default/images/chat_bubble.gif"; 38 // MANUTENÇÃO39 var img_manutencao_im = new Image();40 img_manutencao_im.src = im_path + "templates/default/images/manutencao_im.png";41 40 42 43 44 var smile_1 = new Image(); 41 // Smiles 42 var smile_1 = new Image(); 45 43 smile_1.src = im_path + "templates/default/images/img/smiles/1.gif" 46 44 var smile_2 = new Image(); -
trunk/instant_messenger/js/im_preferences.js
r23 r24 86 86 var text2 = document.getElementById('text2'); 87 87 var _this = this; 88 89 if(pFunc != "divUpdateUser_im"){ 90 var jid = text0.value.substr(0,text0.value.indexOf('@')); 91 for(var i=0; i < IM.user_not_aut.length; i++){ 92 if(IM.user_not_aut[i].substr(0,IM.user_not_aut[i].indexOf('@')) == jid){ 93 return; 94 } 95 } 96 } 97 88 98 89 if(IM.LTrim(text0.value) != "" && IM.LTrim(text1.value) != "" && IM.LTrim(text2.value) != ""){ 99 90 var handler_add_contact = function(data){ … … 130 121 sel_contact.options[sel_contact.length] = opt; 131 122 132 for(var i=1; i < IM. vcard_contacts.length; i++){133 if(IM. vcard_contacts[i].name != ""){134 opt = new Option(IM. vcard_contacts[i].name,IM.vcard_contacts[i].jid, false, false);123 for(var i=1; i < IM.array_users.length; i++){ 124 if(IM.array_users[i].name != ""){ 125 opt = new Option(IM.array_users[i].name,IM.array_users[i].jid, false, false); 135 126 sel_contact.options[sel_contact.length] = opt; 136 127 }else{ 137 name = IM. vcard_contacts[i].jid.substr(0,IM.vcard_contacts[i].jid.indexOf('@'));138 opt = new Option(name,IM. vcard_contacts[i].jid, false, false);128 name = IM.array_users[i].jid.substr(0,IM.array_users[i].jid.indexOf('@')); 129 opt = new Option(name,IM.array_users[i].jid, false, false); 139 130 sel_contact.options[sel_contact.length] = opt; 140 131 } … … 150 141 if(confirm("Excluir o contato " + sel_contact.options[i].innerHTML + "?")){ 151 142 var in_el = sel_contact.options[i].innerHTML; 152 for(var j=1 ; j < IM. vcard_contacts.length; j++){153 var name = IM. vcard_contacts[j].jid.substr(0,IM.vcard_contacts[j].jid.indexOf('@'));154 if(IM. vcard_contacts[j].name == in_el || name == in_el){143 for(var j=1 ; j < IM.array_users.length; j++){ 144 var name = IM.array_users[j].jid.substr(0,IM.array_users[j].jid.indexOf('@')); 145 if(IM.array_users[j].name == in_el || name == in_el){ 155 146 var handler_remove_contact = function(data){ 156 147 if(!data){ … … 161 152 } 162 153 cIM.cExecute("$this.Ujabber.RosterRemoveUser",handler_remove_contact,"jid="+sel_contact.options[i].value); 163 IM. vcard_contacts.splice(j,1);154 IM.array_users.splice(j,1); 164 155 _this.ComboRemove(); 165 156 j--; … … 183 174 var opt = new Option("-- "+IM.get_lang('Choice Contact')+" -- ","0",true,true); 184 175 sel_contact.options[sel_contact.length] = opt; 185 for(var i=0; i < IM. vcard_contacts.length; i++){186 opt = new Option(IM. vcard_contacts[i].name,IM.vcard_contacts[i].jid, false, false);176 for(var i=0; i < IM.array_users.length; i++){ 177 opt = new Option(IM.array_users[i].name,IM.array_users[i].jid, false, false); 187 178 sel_contact.options[sel_contact.length] = opt; 188 179 } … … 191 182 Preferences.prototype.Remove_Contact = function(pJid) 192 183 { 193 for(var i=0; i < IM. vcard_contacts.length; i++){194 if(IM. vcard_contacts[i].jid == pJid){195 if(confirm("Excluir o contato " + IM. vcard_contacts[i].name + "?")){184 for(var i=0; i < IM.array_users.length; i++){ 185 if(IM.array_users[i].jid == pJid){ 186 if(confirm("Excluir o contato " + IM.array_users[i].name + "?")){ 196 187 var handler_remove_contact = function(data){ 197 188 if(!data){ … … 215 206 Preferences.prototype.updateLoad = function(i) 216 207 { 217 Jid = IM. vcard_contacts[i].jid;208 Jid = IM.array_users[i].jid; 218 209 Templates.update_user(); 219 210 document.getElementById('text0').value = Jid; … … 227 218 var jid = pJid; 228 219 229 for(var i=1; i < IM. vcard_contacts.length; i++){230 if(IM. vcard_contacts[i].jid == pJid){231 name = IM. vcard_contacts[i].name;232 group = IM. vcard_contacts[i].group;220 for(var i=1; i < IM.array_users.length; i++){ 221 if(IM.array_users[i].jid == pJid){ 222 name = IM.array_users[i].name; 223 group = IM.array_users[i].group; 233 224 } 234 225 } … … 314 305 { 315 306 Templates.information_Contact(); 316 for(var i=0; i < IM. vcard_contacts.length; i++){317 if(IM. vcard_contacts[i].jid == pJid){318 document.getElementById('_lbl_FN').innerHTML = decodeURI(IM. vcard_contacts[i].VCARD_FN);319 document.getElementById('_lbl_Nickname').innerHTML = decodeURI(IM. vcard_contacts[i].VCARD_NICKNAME);320 document.getElementById('_lbl_Orgunit').innerHTML = decodeURI(IM. vcard_contacts[i].VCARD_ORGUNIT);321 document.getElementById('_lbl_Role').innerHTML = decodeURI(IM. vcard_contacts[i].VCARD_ROLE);322 document.getElementById('_lbl_Birthday').innerHTML = decodeURI(IM. vcard_contacts[i].VCARD_BDAY);307 for(var i=0; i < IM.array_users.length; i++){ 308 if(IM.array_users[i].jid == pJid){ 309 document.getElementById('_lbl_FN').innerHTML = decodeURI(IM.array_users[i].VCARD_FN); 310 document.getElementById('_lbl_Nickname').innerHTML = decodeURI(IM.array_users[i].VCARD_NICKNAME); 311 document.getElementById('_lbl_Orgunit').innerHTML = decodeURI(IM.array_users[i].VCARD_ORGUNIT); 312 document.getElementById('_lbl_Role').innerHTML = decodeURI(IM.array_users[i].VCARD_ROLE); 313 document.getElementById('_lbl_Birthday').innerHTML = decodeURI(IM.array_users[i].VCARD_BDAY); 323 314 return; 324 315 } -
trunk/instant_messenger/js/im_templates.js
r20 r24 93 93 Templates.prototype.Users_Not_Auth = function () 94 94 { 95 var _this = this; 96 var form_auth_user = "<div style='margin-left:10px;margin-top:5'>" + 97 "<br>"+ 98 "<b>O(s) contato(s) abaixo aguarda(m) sua autorização." + 99 "<br>Para adicionar este(s) novo(s) contato(s), basta dar um " + 100 "<br>clique em cima do contato." + 101 "<p>Contato(s) :" + 102 "</b><br>" + 103 "<div id='divChildrenFormAuthUser'>" + 104 "<p>" + document.getElementById('not_aut').innerHTML + 105 "</div></div>"; 106 107 _this.conf_form("divFormAuthUser",370,200,form_auth_user, ":: Contatos sem Cadastro - Expresso ::"); 108 95 var cont = 0; 96 var _this = this; 97 98 for(var i=0 ; i < IM.array_users.length; i++) 99 if(IM.array_users[i].group == "sem_grupo") 100 cont++; 101 102 if(cont > 0){ 103 var form_auth_user = "<div style='margin-left:10px;margin-top:5'>" + 104 "<br>"+ 105 "<b>O(s) contato(s) abaixo aguarda(m) sua autorização." + 106 "<br>Para adicionar este(s) novo(s) contato(s), basta dar um " + 107 "<br>clique em cima do contato." + 108 "<p>Contato(s) :" + 109 "</b><br>" + 110 "<div id='divChildrenFormAuthUser'>" + 111 "<p>" + document.getElementById('sem_grupo').innerHTML + 112 "</div></div>"; 113 114 _this.conf_form("divFormAuthUser",370,200,form_auth_user, ":: Contatos sem Cadastro - Expresso ::"); 115 } 109 116 } 110 117 … … 141 148 '<tr><td width="30%" align="right">'+IM.get_lang('Birthday')+' .: </td><td width="70%" align="left"><label id="_lbl_Birthday"></label></td></tr>'+ 142 149 '<table>'; 143 _this.conf_form("divInfoContact",4 00,130,form_info_contact,":: Informações do Contato - Expresso ::");150 _this.conf_form("divInfoContact",430,130,form_info_contact,":: Informações do Contato - Expresso ::"); 144 151 145 152 } … … 206 213 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>'; 207 214 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>'; 208 grid += ' <td><div class="emotionItem" onMouseover="im_win.h ighlightie5(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>';215 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>'; 209 216 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>'; 210 217 grid += ' </tr>'; -
trunk/instant_messenger/js/im_win.js
r20 r24 268 268 name_document.innerHTML = ''; 269 269 var contact = func.byId(pId); 270 var _status = IM. vcard_contacts[contact.getAttribute('nuncontact')].online270 var _status = IM.array_users[contact.getAttribute('nuncontact')].online 271 271 contact.firstChild.src = ( _status == parseInt(1) ) ? img_online.src : img_offline.src; 272 272 }
Note: See TracChangeset
for help on using the changeset viewer.