- Timestamp:
- 05/22/09 17:10:59 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/jabberit_messenger/js/ldap.js
r815 r914 52 52 var _name = document.getElementById('im_name'); 53 53 var _group = document.getElementById('im_group'); 54 var jidUser = document.getElementById('im_jidUser').value; 54 55 var _jid = document.getElementById('im_jid').value; 55 56 var _status = document.getElementById('im_status_add'); … … 91 92 jabberitGetLang("This user is part of a small group!") + 92 93 "\n" + jabberitGetLang("Contact was not added!")); 93 94 94 _name.value = ''; 95 95 _group.value = ''; … … 104 104 _status.innerHTML = '<br/>Adicionando contato, aguarde....<br/>'; 105 105 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/>'; 112 121 } 113 else // If Pop-Up122 catch(e) 114 123 { 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 116 127 } 117 118 _status.innerHTML = '<br/>Contato adicionado !<br/>';119 128 setTimeout('cleanStatusAddContactIM();',2500); 120 129 121 130 _name.value = ''; 122 131 _group.value = ''; 123 124 132 } 125 133 }, "uid="+_uid); … … 175 183 176 184 _target.innerHTML = _xtools.parse(_data,'list_ldap_contacts.xsl', _params); 177 185 178 186 function _show(m) 179 187 { 180 188 m = ( m.target ) ? m.target : m.srcElement; 189 181 190 if ( m.getAttribute('value')) 191 { 192 var jidUser = m.getAttribute('jid'); 182 193 m = m.getAttribute('value'); 194 } 183 195 else 196 { 197 var jidUser = m.parentNode.getAttribute('jid'); 184 198 m = m.parentNode.getAttribute('value'); 185 199 } 200 186 201 if ( !m ) 187 202 return false; 188 203 189 204 document.getElementById('__span_load_im_group').style.display = 'block'; 205 document.getElementById('im_jidUser').value = jidUser; 190 206 document.getElementById('im_jid').value = m.substr(0, m.indexOf(';')); 191 207 document.getElementById('im_uid').value = m.substr((m.indexOf(';')+1)); … … 204 220 _name.parentNode.nextSibling.nextSibling.innerHTML = ''; 205 221 206 // If Layer; 207 if( elementIframe = document.getElementById('iframe_applet_jabberit') ) 222 try 208 223 { 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)); 230 244 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 } 238 264 } 239 265
Note: See TracChangeset
for help on using the changeset viewer.