Ignore:
Timestamp:
05/22/09 17:10:59 (15 years ago)
Author:
alexandrecorreia
Message:

Ticket #505 - Arquivos modificados para a administração de hosts virtuais jabber

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/jabberit_messenger/js/ldap.js

    r815 r914  
    5252                                var _name = document.getElementById('im_name'); 
    5353                                var _group = document.getElementById('im_group'); 
     54                                var jidUser = document.getElementById('im_jidUser').value;  
    5455                                var     _jid = document.getElementById('im_jid').value; 
    5556                                var _status = document.getElementById('im_status_add'); 
     
    9192                                                                                          jabberitGetLang("This user is part of a small group!") +  
    9293                                                                                          "\n" + jabberitGetLang("Contact was not added!")); 
    93  
    9494                                                                                _name.value = ''; 
    9595                                                                                _group.value = ''; 
     
    104104                                                                                _status.innerHTML = '<br/>Adicionando contato, aguarde....<br/>'; 
    105105                                 
    106                                                                                 if( elementIframe = document.getElementById('iframe_applet_jabberit') ) 
    107                                                                                 { 
    108                                                                                         if( !_is_ie ) 
    109                                                                                                 result = elementIframe.contentDocument.applets[0].addContact( _uid, _name.value, _group.value ); 
    110                                                                                         else 
    111                                                                                                 result = elementIframe.contentWindow.document.applets[0].addContact( _uid, _name.value, _group.value ); 
     106                                                                                try 
     107                                                                                { 
     108                                                                                                  
     109                                                                                        if( elementIframe = document.getElementById('iframe_applet_jabberit') ) 
     110                                                                                        { 
     111                                                                                                if( !_is_ie ) 
     112                                                                                                        result = elementIframe.contentDocument.applets[0].addContact( jidUser, _name.value, _group.value ); 
     113                                                                                                else 
     114                                                                                                        result = elementIframe.contentWindow.document.applets[0].addContact( jidUser, _name.value, _group.value ); 
     115                                                                                        } 
     116                                                                                        else // If Pop-Up 
     117                                                                                        { 
     118                                                                                                result = _myWindow.document.applets[0].addContact( jidUser, _name.value, _group.value ); 
     119                                                                                        } 
     120                                                                                        _status.innerHTML = '<br/>' + jabberitGetLang('Add contact!') +  '<br/>'; 
    112121                                                                                } 
    113                                                                                 else // If Pop-Up 
     122                                                                                catch(e) 
    114123                                                                                { 
    115                                                                                         result = _myWindow.document.applets[0].addContact( _uid, _name.value, _group.value ); 
     124                                                                                        _status.innerHTML = '<br/>' + jabberitGetLang('The module is not loaded') + '! ' +  
     125                                                                                                                                jabberitGetLang('Contact was not added!') + '<br/>'; 
     126                                                                                         
    116127                                                                                } 
    117  
    118                                                                                 _status.innerHTML = '<br/>Contato adicionado !<br/>'; 
    119128                                                                                setTimeout('cleanStatusAddContactIM();',2500); 
    120129                                                                                 
    121130                                                                                _name.value = ''; 
    122131                                                                                _group.value = ''; 
    123                                                                                  
    124132                                                                        } 
    125133                                                                 }, "uid="+_uid); 
     
    175183                 
    176184                        _target.innerHTML = _xtools.parse(_data,'list_ldap_contacts.xsl', _params); 
    177                          
     185 
    178186                        function _show(m) 
    179187                        { 
    180188                                m = ( m.target ) ? m.target : m.srcElement; 
     189 
    181190                                if ( m.getAttribute('value')) 
     191                                { 
     192                                        var jidUser = m.getAttribute('jid'); 
    182193                                        m = m.getAttribute('value'); 
     194                                } 
    183195                                else 
     196                                { 
     197                                        var jidUser = m.parentNode.getAttribute('jid'); 
    184198                                        m = m.parentNode.getAttribute('value'); 
    185                                  
     199                                } 
     200         
    186201                                if ( !m ) 
    187202                                        return false; 
    188203 
    189204                                document.getElementById('__span_load_im_group').style.display = 'block'; 
     205                                document.getElementById('im_jidUser').value = jidUser; 
    190206                                document.getElementById('im_jid').value = m.substr(0, m.indexOf(';')); 
    191207                                document.getElementById('im_uid').value = m.substr((m.indexOf(';')+1)); 
     
    204220                                        _name.parentNode.nextSibling.nextSibling.innerHTML = ''; 
    205221                                 
    206                                 // If Layer; 
    207                                 if( elementIframe = document.getElementById('iframe_applet_jabberit') ) 
     222                                try 
    208223                                { 
    209                                         if( !_is_ie ) 
    210                                                 groups = elementIframe.contentDocument.applets[0].getGroupsToExpresso(); 
    211                                         else 
    212                                                 groups = elementIframe.contentWindow.document.applets[0].getGroupsToExpresso(); 
    213                                 } 
    214                                 else // If Pop-Up 
    215                                 { 
    216                                         groups = _myWindow.document.applets[0].getGroupsToExpresso(); 
    217                                 } 
    218                  
    219                                 if( typeof(groups) == 'object') 
    220                                 { 
    221                                         data = groups + ";"; 
    222                                         data = data.substring(0,(data.length-2)); 
    223                                 } 
    224                                 else                     
    225                                         data = groups.substring(0,(groups.length-1)); 
    226                                  
    227                                 if( data ) 
    228                                 { 
    229                                         document.getElementById('im_group').setAttribute('selectBoxOptions', data); 
     224                                        // If Layer; 
     225                                        if( elementIframe = document.getElementById('iframe_applet_jabberit') ) 
     226                                        { 
     227                                                if( !_is_ie ) 
     228                                                        groups = elementIframe.contentDocument.applets[0].getGroupsToExpresso(); 
     229                                                else 
     230                                                        groups = elementIframe.contentWindow.document.applets[0].getGroupsToExpresso(); 
     231                                        } 
     232                                        else // If Pop-Up 
     233                                        { 
     234                                                groups = _myWindow.document.applets[0].getGroupsToExpresso(); 
     235                                        } 
     236                         
     237                                        if( typeof(groups) == 'object') 
     238                                        { 
     239                                                data = groups + ";"; 
     240                                                data = data.substring(0,(data.length-2)); 
     241                                        } 
     242                                        else                     
     243                                                data = groups.substring(0,(groups.length-1)); 
    230244                                         
    231                                         if( document.getElementById('selectBox0') == null ) 
    232                                                 editS.create(document.getElementById('im_group')); 
    233                                 } 
    234  
    235                                 document.getElementById('__span_load_im_group').style.display = 'none'; 
    236                                 document.getElementById('im_group').value = ''; 
    237                                 document.getElementById('im_group').focus(); 
     245                                        if( data ) 
     246                                        { 
     247                                                document.getElementById('im_group').setAttribute('selectBoxOptions', data); 
     248                                                 
     249                                                if( document.getElementById('selectBox0') == null ) 
     250                                                        editS.create(document.getElementById('im_group')); 
     251                                        } 
     252         
     253                                        document.getElementById('__span_load_im_group').style.display = 'none'; 
     254                                        document.getElementById('im_group').value = ''; 
     255                                        document.getElementById('im_group').focus(); 
     256                                } 
     257                                catch(e) 
     258                                { 
     259                                        alert("*********** " + jabberitGetLang("Attention") + "!! ***********\n" +  
     260                                                  jabberitGetLang("The module is not loaded") + "!\n" );  
     261 
     262                                        document.getElementById('__span_load_im_group').style.display = 'none';                                  
     263                                } 
    238264                        } 
    239265 
Note: See TracChangeset for help on using the changeset viewer.