Changeset 24 for trunk/instant_messenger


Ignore:
Timestamp:
05/10/07 11:51:20 (17 years ago)
Author:
niltonneto
Message:

* empty log message *

Location:
trunk/instant_messenger
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/instant_messenger/docs/change_log.txt

    r21 r24  
    6627/04/2007 [0.001] 
    77- Vcard, corrigido para a visualização de caracteres e acentos.  
     8 
  • trunk/instant_messenger/inc/class.Jabber.inc.php

    r20 r24  
    3434        private $log_error = false; 
    3535         
    36         private $array_teste = array(); 
    37  
    3836        function __construct($pJid = false, $pPassword = false, $pPort = false) 
    3937        { 
  • trunk/instant_messenger/inc/class.Ujabber.inc.php

    r21 r24  
    11<?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         *************************************************************/ 
    99 
    1010require_once "class.Jabber.inc.php"; 
     
    7070                $group_nusers[0]['VCARD_DESC'] = $VCARD_P['DESC']; 
    7171                $group_nusers[0]['VCARD_JID'] = $VCARD_P['JID'];                                 
    72  
     72                 
    7373                natcasesort($group_users);               
    7474                $i=1; 
     
    146146            { 
    147147                                $array_return[$j]['subscription'] = 'to'; 
    148                                 $array_return[$j]['name'] = ''; 
     148                                $array_return[$j]['name'] = $array_db[$i]['im_from']; 
    149149                                $array_return[$j]['jid'] = $array_db[$i]['im_from']; 
    150                                 $array_return[$j]['group'] = ''; 
     150                                $array_return[$j]['group'] = 'sem_grupo'; 
    151151                                $array_return[$j]['online'] = 0; 
    152152                                $j++; 
  • trunk/instant_messenger/inc/class.db_im.inc.php

    r20 r24  
    1414        var $db_pass; 
    1515        var $db_type; 
    16         var $teste; 
    1716         
    1817        function db_im(){ 
  • trunk/instant_messenger/js/im_functions.js

    r23 r24  
    44   function IM() 
    55   { 
    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(); 
    109      this.load_photo     = false; 
    1110   } 
     
    2524         if ( data[1] ) 
    2625         { 
    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; 
    3028            _this.mount_list(data); 
    31  
    3229         } 
    3330         _this.conf_VcardUser(data[0]); 
     
    7370      } 
    7471   } 
    75         /* 
    76          * Monta Lista de Contatos 
    77          */ 
     72   /* 
     73        * Monta Lista de Contatos 
     74        */ 
    7875         
    7976        IM.prototype.mount_list = function(pList) 
     
    8279                var div = document.getElementById("div_contacts"); 
    8380                        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"); 
    8490                 
    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); 
    106103                                }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);                                      
    130109                                } 
     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                                }        
    131125                        } 
    132                         groups += "</div><div id='out_list'></div></div>"; 
    133126                } 
    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 - None 
    149          */ 
    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 nome 
    167          */ 
    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; 
    185127                setTimeout("Templates.Users_Not_Auth()",2500); 
    186128        } 
     
    238180 
    239181                // Vcard pessoal; 
    240  
    241182                if ( !_this.load_photo ){ 
    242183 
     
    249190                        _this.vcard_user['VCARD_DESC'] = decodeURI(data.VCARD_DESC); 
    250191                        _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'])); 
    253194                        _this.load_photo = true; 
    254195                } 
     
    341282                        mensagens = document.getElementById(data[i].from.substr(0, data[i].from.indexOf('/')) + '_chatMessages'); 
    342283                            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++) 
    344285                    { 
    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                                           } 
    348300                        } 
    349                      
     301                    
    350302                    minuto = ( hora.getMinutes() > 9 ) ? hora.getMinutes() : '0' + hora.getMinutes(); 
    351303                    _hora = '[' + hora.getHours() + ':' + minuto + '] '; 
     
    372324        } 
    373325 
    374         /* 
    375          * Envia Mensagens 
    376          */ 
     326   /* 
     327        * Envia Mensagens 
     328        */ 
    377329 
    378330   IM.prototype.sendMessage = function (pJID) 
     
    591543   } 
    592544 
    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>'; 
    602558      im_menu_action.menu("_span_" + pElement, form_menu_button_right); 
    603559   } 
     
    608564         
    609565        function url_encode(str) 
    610    {  
     566    {  
    611567            var hex_chars = "0123456789ABCDEF";  
    612568            var noEncode = /^([a-zA-Z0-9\_\-\.])$/;  
     
    634590         */ 
    635591 
    636         IM.prototype.action_button = function(pEv,pStatus,pJid) 
     592        IM.prototype.action_button = function(pEv,pStatus,pJid,pReq) 
    637593        { 
    638594                var _this = this; 
    639595                if(pEv.button > 1){ 
    640                         _this.menu_button_right(pJid); 
     596                        _this.menu_button_right(pJid,pReq); 
    641597                        document.oncontextmenu = new Function("return false"); 
    642598                }else{ 
     
    684640        } 
    685641 
    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                         else 
    695                         { 
    696                                 if ((e.keyCode) == 13) 
    697                                 { 
    698                                         send(pJID); 
    699                                         return false; 
    700                                 } 
    701                         } 
    702                 } 
    703         } 
    704  
    705642// Build Object  
    706643        var IM = new IM(); 
  • trunk/instant_messenger/js/im_images.js

    r23 r24  
    3434        var img_wait = new Image(); 
    3535        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"; 
    3638        var img_chat_bubble = new Image(); 
    3739        img_chat_bubble.src = im_path + "templates/default/images/chat_bubble.gif"; 
    38         // MANUTENÇÃO 
    39         var img_manutencao_im = new Image(); 
    40         img_manutencao_im.src = im_path + "templates/default/images/manutencao_im.png"; 
    4140 
    42  
    43  
    44         var smile_1 = new Image(); 
     41   // Smiles 
     42   var smile_1 = new Image(); 
    4543   smile_1.src = im_path + "templates/default/images/img/smiles/1.gif" 
    4644   var smile_2 = new Image(); 
  • trunk/instant_messenger/js/im_preferences.js

    r23 r24  
    8686                var text2 = document.getElementById('text2'); 
    8787                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 
    9889                if(IM.LTrim(text0.value) != "" && IM.LTrim(text1.value) != "" && IM.LTrim(text2.value) != ""){ 
    9990                        var handler_add_contact = function(data){ 
     
    130121                sel_contact.options[sel_contact.length] = opt; 
    131122 
    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); 
    135126                                sel_contact.options[sel_contact.length] = opt; 
    136127                        }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); 
    139130                                sel_contact.options[sel_contact.length] = opt; 
    140131                        } 
     
    150141                                if(confirm("Excluir o contato " + sel_contact.options[i].innerHTML + "?")){ 
    151142                                        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){ 
    155146                                                        var handler_remove_contact = function(data){ 
    156147                                                                if(!data){ 
     
    161152                                                        } 
    162153                                                        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); 
    164155                                                        _this.ComboRemove();                                                     
    165156                                                        j--; 
     
    183174                var opt = new Option("-- "+IM.get_lang('Choice Contact')+" -- ","0",true,true); 
    184175                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); 
    187178                        sel_contact.options[sel_contact.length] = opt; 
    188179                } 
     
    191182        Preferences.prototype.Remove_Contact = function(pJid) 
    192183        { 
    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 + "?")){ 
    196187                                        var handler_remove_contact = function(data){ 
    197188                                                if(!data){ 
     
    215206   Preferences.prototype.updateLoad = function(i) 
    216207   { 
    217                 Jid = IM.vcard_contacts[i].jid; 
     208                Jid = IM.array_users[i].jid; 
    218209                Templates.update_user();         
    219210                document.getElementById('text0').value = Jid; 
     
    227218                var jid   = pJid; 
    228219                 
    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; 
    233224                        } 
    234225                } 
     
    314305        { 
    315306                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);                                                                                                                            
    323314                                return; 
    324315                        }        
  • trunk/instant_messenger/js/im_templates.js

    r20 r24  
    9393        Templates.prototype.Users_Not_Auth = function () 
    9494        { 
    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                } 
    109116        } 
    110117 
     
    141148                                                                '<tr><td width="30%" align="right">'+IM.get_lang('Birthday')+'&nbsp;.:&nbsp;</td><td width="70%" align="left"><label id="_lbl_Birthday"></label></td></tr>'+                                                     
    142149                                                                '<table>'; 
    143                 _this.conf_form("divInfoContact",400,130,form_info_contact,":: Informações do Contato - Expresso ::"); 
     150                _this.conf_form("divInfoContact",430,130,form_info_contact,":: Informações do Contato - Expresso ::"); 
    144151         
    145152        } 
     
    206213      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>'; 
    207214      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.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>'; 
     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>'; 
    209216      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>'; 
    210217      grid += '    </tr>'; 
  • trunk/instant_messenger/js/im_win.js

    r20 r24  
    268268         name_document.innerHTML = ''; 
    269269         var contact = func.byId(pId); 
    270          var _status = IM.vcard_contacts[contact.getAttribute('nuncontact')].online 
     270         var _status = IM.array_users[contact.getAttribute('nuncontact')].online 
    271271         contact.firstChild.src = ( _status == parseInt(1) ) ? img_online.src : img_offline.src; 
    272272      } 
Note: See TracChangeset for help on using the changeset viewer.