Changeset 2725 for sandbox/jabberit_messenger
- Timestamp:
- 05/06/10 17:02:01 (14 years ago)
- Location:
- sandbox/jabberit_messenger/trophy_expresso
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/jabberit_messenger/trophy_expresso/js/trophyim.js
r2724 r2725 612 612 return true; 613 613 }, 614 614 615 /** Function: onMessage 615 616 * … … 647 648 var jid_lower = barejid.toLowerCase(); 648 649 var contact = ""; 649 var state = ''; 650 651 var chatBox = document.getElementById(jid_lower + "__chatState"); 652 653 contact = barejid.toLowerCase(); 654 contact = contact.substring(0, contact.indexOf('@')); 650 var state = ""; 651 652 var chatBox = null; 653 654 if( document.getElementById(jid_lower + "__chatState") != null ) 655 { 656 chatBox = document.getElementById(jid_lower + "__chatState"); 657 } 658 659 contact = barejid.toLowerCase(); 660 contact = contact.substring(0, contact.indexOf('@')); 655 661 656 662 if( TrophyIM.rosterObj.roster[barejid] ) … … 663 669 664 670 // Message with body are "content message", this mean state active 665 if ( elems.length > 0)671 if ( elems.length > 0 ) 666 672 { 667 673 state = contact + ' está ativo.'; 668 674 669 if (type == 'chat' || type == 'normal') {670 675 if (type == 'chat' || type == 'normal') 676 { 671 677 var _message = document.createElement("div"); 672 678 _message.innerHTML = Strophe.getText(elems[0]); … … 679 685 _message.innerHTML = _message.innerHTML.replace(/^\s+|\s+$|^\n|\n$/g, ""); 680 686 681 if ( _message.hasChildNodes() )687 if ( _message.hasChildNodes() ) 682 688 { 683 689 var message = … … 688 694 689 695 TrophyIM.makeChat(from); //Make sure we have a chat window 690 TrophyIM.addMessage( message, jid_lower);696 TrophyIM.addMessage( message, jid_lower ); 691 697 } 692 698 } … … 695 701 else 696 702 { 697 state = contact + TrophyIM.getChatState(msg); 698 } 699 chatBox.innerHTML = "<font style='font-weight:bold; color:grey;'>" + state + "</font>"; 703 if( chatBox != null ) 704 state = contact + TrophyIM.getChatState(msg); 705 } 706 707 if( chatBox != null ) 708 chatBox.innerHTML = '<font style="font-weight:bold; color:grey; margin-left: 5px; float:right;">' + state + '</font>'; 709 700 710 return true; 701 711 }, … … 711 721 var state = msg.getElementsByTagName('inactive'); 712 722 713 if ( state.length > 0 ) { 723 if ( state.length > 0 ) 724 { 714 725 return' está inativo...'; 715 } else { 726 } 727 else 728 { 716 729 state = msg.getElementsByTagName('gone'); 717 if ( state.length > 0 ){ 730 if ( state.length > 0 ) 731 { 718 732 return ' saiu da conversa.'; 719 } else { 733 } 734 else 735 { 720 736 state = msg.getElementsByTagName('composing'); 721 if ( state.length > 0 ){ 737 if ( state.length > 0 ) 738 { 722 739 return ' está compondo...'; 723 } else { 740 } 741 else 742 { 724 743 state = msg.getElementsByTagName('paused'); 725 if ( state.length > 0 ){ 744 if ( state.length > 0 ) 745 { 726 746 return ' está parado...'; 727 747 } … … 729 749 } 730 750 } 751 731 752 return ''; 732 753 }, -
sandbox/jabberit_messenger/trophy_expresso/xsl/chatBox.xsl
r2721 r2725 11 11 <div> 12 12 <div id="{$idChatBox}" style="height:190px; width:370px; overflow-y:scroll;"></div> 13 <div id="{$jidTo}__chatState" style="height:15px; width:3 70px;"></div>13 <div id="{$jidTo}__chatState" style="height:15px; width:365px;"></div> 14 14 <div style="margin:2px;"> 15 15 <textarea id="{$jidTo}__sendBox" class="trophyimchatinput" style="padding-left: 78px; height:130px; width:360px;"></textarea>
Note: See TracChangeset
for help on using the changeset viewer.