Changeset 68 for trunk/instant_messenger/js/im_functions.js
- Timestamp:
- 09/14/07 17:43:09 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/instant_messenger/js/im_functions.js
r67 r68 7 7 this.UsersNot = []; 8 8 this.userPrefe = false; 9 this.count_Vcard = 0; 9 10 } 10 11 11 12 IM.prototype.load_im = function() 12 13 { 13 IM.listen(); 14 IM.requireContacts(); 14 this.listen(); 15 this.requireContacts(); 16 this.atalho(); 15 17 16 18 var handler_Status = function(XmlData) … … 51 53 if(!_this.vcards) 52 54 { 53 _this. requireVcard();55 _this.Vcard(); 54 56 _this.vcards = true; 55 57 } … … 125 127 group = group.nextSibling; 126 128 } 127 this.atalho();129 //this.atalho(); 128 130 } 129 131 }catch(e){} … … 309 311 nickname = nickname.substr(0,nickname.indexOf('|')); 310 312 nickname = nickname.substr(nickname.indexOf(':') + 1 , nickname.length); 311 nickname = func.trim(nickname);313 nickname = ( func.trim(nickname) != "" ) ? nickname : from ; 312 314 } 313 315 else … … 374 376 } 375 377 376 envio.innerHTML = func.trim(envio.innerHTML.replace(/ | +/g, ' '));377 envio.innerHTML = func.trim(envio.innerHTML.replace(/<br>/g, '<br/>'));378 378 envio.innerHTML = func.trim(envio.innerHTML); 379 envio.innerHTML = envio.innerHTML.replace(/ | +/gi, ' '); 380 envio.innerHTML = envio.innerHTML.replace(/<br[^>]*>/gi, '<br />'); 379 381 380 382 if ( envio.innerHTML != "" ) … … 389 391 message_text += envio.innerHTML + "</div>"; 390 392 393 message_text = message_text.replace(/ | +/gi, ' '); 394 message_text = message_text.replace(/<br[^>]*>/gi, '<br />'); 395 391 396 envio.innerHTML = ''; 392 397 … … 399 404 nickname = nickname.substr(0,nickname.indexOf('|')); 400 405 nickname = nickname.substr(nickname.indexOf(':') + 1 , nickname.length); 406 nickname = (func.trim(nickname) != "") ? nickname : IM_Preferences.jid; 401 407 } 402 408 … … 559 565 */ 560 566 561 IM.prototype. requireVcard = function()567 IM.prototype.Vcard = function() 562 568 { 563 569 var _this = this; 564 var handler_getVcard = function(_XMLdata)570 if( _this.count_Vcard < 3) 565 571 { 566 var data = _XMLdata.getElementsByTagName('retorno').item(0); 567 data = eval(data.firstChild.nodeValue); 568 if(!data) 569 setTimeout("IM.requireVcard()",2000); 570 }; 571 XMLTools.request('$this.Ujabber.requireVcard','GET',handler_getVcard); 572 } 572 var handler_getVcard = function(_XMLdata) 573 { 574 var data = _XMLdata.getElementsByTagName('retorno').item(0); 575 data = eval(data.firstChild.nodeValue); 576 if(!data) 577 setTimeout("IM.Vcard()",2000); 578 _this.count_Vcard++; 579 }; 580 XMLTools.request('$this.Ujabber.Vcard','GET',handler_getVcard); 581 }else{ 582 var handler_getVcardUser = function(XMLdata) 583 { 584 }; 585 XMLTools.request('$this.Ujabber.VcardUser','GET',handler_getVcardUser); 586 } 587 588 }; 573 589 574 590 IM.prototype.getVcard = function(data) … … 585 601 div.innerHTML = ""; 586 602 div.innerHTML += XMLTools.transform(data, xsl); 587 IM_Preferences.vCardInit();603 IM_Preferences.vCardInit(); 588 604 } 605 589 606 590 607 }catch(e){}
Note: See TracChangeset
for help on using the changeset viewer.