Ignore:
Timestamp:
06/29/07 15:18:52 (17 years ago)
Author:
niltonneto
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/instant_messenger/js/im_functions.js

    r33 r36  
    2424      var handler_contacts = function(data) 
    2525      { 
    26             _this.array_users.splice(0,_this.array_users.length); 
    27             _this.array_users = data; 
    28             _this.mount_list(data); 
    29             _this.conf_VcardUser(data[0]); 
    30       } 
    31  
    32       if ( force || this.getWinContactsState() ) 
     26          if( (data.length) >= (_this.array_users.length) || (data.length - 1) > 0){ 
     27                  _this.array_users.splice(0,_this.array_users.length); 
     28              _this.array_users = data; 
     29                  _this.mount_list(data); 
     30                  _this.conf_VcardUser(data[0]); 
     31              } 
     32      } 
     33         
     34          if ( force || this.getWinContactsState() ) 
    3335         cIM.cExecute("$this.Ujabber.list_user",handler_contacts); 
    3436   } 
     
    7779   { 
    7880                // Manutencao 
    79         // 
    80         //   var div_manutencao = document.getElementById('contacts_im_window_body_inner'); 
    81         //       div_manutencao.innerHTML = '<p align="center"><img src='+img_manutencao_im.src+'></p>'; 
    82                 //       return false; 
    83                 // 
    84                 // 
     81        var div_manutencao = document.getElementById('contacts_im_window_body_inner'); 
     82            div_manutencao.innerHTML = '<p align="center"><img src='+img_manutencao_im.src+'></p>'; 
     83                    return false; 
    8584        } 
    8685 
     
    604603      im_menu_action.menu("_span_" + pElement, form_menu_button_right); 
    605604   } 
    606  
    607         /* 
    608          * url_encode 
    609          */ 
    610          
    611         function url_encode(str) 
    612     {  
     605    
     606  /* 
     607   * Integração com o Expresso, verifica se o usuário tem permissão no Módulo IM 
     608   */ 
     609    
     610   IM.prototype.UserPermission = function(uid, handler) 
     611   { 
     612                cIM.cExecute("$this.contacts_im.UserPermission",handler,"uid="+uid); 
     613   } 
     614 
     615  /* 
     616   *  Ação do botão onclick da lista de contatos; 
     617   */ 
     618 
     619   IM.prototype.action_button = function(pEv,pStatus,pJid,pReq) 
     620   { 
     621                var _this = this; 
     622                if(pEv.button > 1){ 
     623                        _this.menu_button_right(pJid,pReq); 
     624                        document.oncontextmenu = new Function("return false"); 
     625                }else{ 
     626                        if(pStatus == parseInt(1)) 
     627                                _this.open_chat(pJid); 
     628                } 
     629   } 
     630         
     631  /* 
     632   * Abre Conversa 
     633   */ 
     634 
     635   IM.prototype.open_chat = function(pJID) 
     636   { 
     637      func.byId(pJID).firstChild.src = img_chat_bubble.src; 
     638      im_win.open_chat(pJID); 
     639   } 
     640 
     641  /* 
     642   * url_encode 
     643   */ 
     644         
     645   function url_encode(str) 
     646   {  
    613647            var hex_chars = "0123456789ABCDEF";  
    614648            var noEncode = /^([a-zA-Z0-9\_\-\.])$/;  
     
    630664            }  
    631665            return strEncode;  
    632         }   
    633  
    634         /* 
    635          *  Ação do botão onclick da lista de contatos; 
    636          */ 
    637  
    638         IM.prototype.action_button = function(pEv,pStatus,pJid,pReq) 
    639         { 
    640                 var _this = this; 
    641                 if(pEv.button > 1){ 
    642                         _this.menu_button_right(pJid,pReq); 
    643                         document.oncontextmenu = new Function("return false"); 
    644                 }else{ 
    645                         if(pStatus == parseInt(1)) 
    646                                 _this.open_chat(pJid); 
    647                 } 
    648         } 
    649          
    650         /* 
    651          * Abre Conversa 
    652          */ 
    653  
    654         IM.prototype.open_chat = function(pJID) 
    655         { 
    656       func.byId(pJID).firstChild.src = img_chat_bubble.src; 
    657       im_win.open_chat(pJID); 
    658         } 
    659  
    660  
    661         String.prototype.rm_space = function() 
    662         { 
     666   }   
     667 
     668   String.prototype.rm_space = function() 
     669   { 
    663670        return this.replace(/( *)/g,""); 
    664         } 
     671   } 
    665672 
    666673// Build Object  
Note: See TracChangeset for help on using the changeset viewer.