Changeset 2971 for trunk


Ignore:
Timestamp:
06/25/10 17:59:42 (14 years ago)
Author:
alexandrecorreia
Message:

Ticket #1116 - Melhorar a visualizacao/avisos de novos contatos e pedidos de autorizacao no modulo.

Location:
trunk/jmessenger
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/jmessenger/js/AddUser.js

    r2961 r2971  
    1010                                var jidFrom             = loadscript.getUserCurrent().jid; 
    1111                                var jidTo               = arguments[0]; 
    12                                 var indexTo             = arguments[1]; 
    1312                                var group               = ""; 
    1413                                var name                = jidTo.substring(0, jidTo.indexOf('@')); 
     
    3029                                        group = ""; 
    3130                                 
    32                                 // Remove Element html; 
    33                                 loadscript.removeElement( getElement('itenContact_' + jidTo + '_' + indexTo) ); 
    34                                 loadscript.removeElement( getElement('span_show_itenContact_' + jidTo + '_' + indexTo) ); 
    35                                 TrophyIM.rosterObj.removeContact(jidTo); 
     31                                // Remove Element 
     32                                if( getElement('itenContact_' + jidTo ) ) 
     33                                { 
     34                                        loadscript.removeElement( getElement('itenContact_' + jidTo ) ); 
     35                                        loadscript.removeElement( getElement('span_show_itenContact_' + jidTo ) ); 
     36                                } 
     37 
     38                                TrophyIM.rosterObj.removeContact( jidTo ); 
    3639                        } 
    3740                        else 
  • trunk/jmessenger/js/trophyim.js

    r2966 r2971  
    345345    log : function(level, msg) 
    346346    { 
    347         if (TrophyIM.logging_div && level >= TROPHYIM_LOGLEVEL) { 
    348             while(TrophyIM.logging_div.childNodes.length > TROPHYIM_LOG_LINES) { 
    349                 TrophyIM.logging_div.removeChild( 
    350                 TrophyIM.logging_div.firstChild); 
     347        if (TrophyIM.logging_div && level >= TROPHYIM_LOGLEVEL) 
     348        { 
     349            while(TrophyIM.logging_div.childNodes.length > TROPHYIM_LOG_LINES) 
     350            { 
     351                TrophyIM.logging_div.removeChild( TrophyIM.logging_div.firstChild ); 
    351352            } 
     353             
    352354            var msg_div = document.createElement('div'); 
    353355            msg_div.className = 'trophyimlogitem'; 
    354356            msg_div.appendChild(document.createTextNode(msg)); 
     357             
    355358            TrophyIM.logging_div.appendChild(msg_div); 
    356359            TrophyIM.logging_div.scrollTop = TrophyIM.logging_div.scrollHeight; 
     
    589592                                                group_array[group_array.length] = groups[g].firstChild.nodeValue; 
    590593                                } 
    591  
     594                                 
    592595                                if( getAttribute('ask') ) 
    593596                                        TrophyIM.rosterObj.addContact(getAttribute('jid'), getAttribute('ask'), getAttribute('name'), group_array); 
     
    966969     */ 
    967970     
    968     renameContact : function( jid, index ) 
     971    renameContact : function( jid ) 
    969972    { 
    970973        // Name 
     
    984987        TrophyIM.addContact( jidTo, name, group ); 
    985988         
    986         document.getElementById('itenContact_' + jid + '_' + index).innerHTML = name; 
     989        document.getElementById('itenContact_' + jid ).innerHTML = name; 
    987990    }, 
    988991     
     
    992995     */ 
    993996 
    994     renameGroup : function( jid, index) 
     997    renameGroup : function( jid ) 
    995998    { 
    996999        var group               = TrophyIM.rosterObj.roster[jid].contact.groups[0]; 
     
    10351038     */ 
    10361039     
    1037     removeContact : function(jidTo, indexTo) 
     1040    removeContact : function( jidTo ) 
    10381041    { 
    10391042        var divItenContact       = null; 
    10401043        var spanShow             = null; 
    10411044         
    1042         if( ( divItenContact = document.getElementById('itenContact_' + jidTo + '_' + indexTo ))) 
     1045        if( ( divItenContact = document.getElementById('itenContact_' + jidTo ))) 
    10431046        {        
    1044                 spanShow = document.getElementById('span_show_itenContact_' + jidTo + '_' + indexTo ) 
     1047                spanShow = document.getElementById('span_show_itenContact_' + jidTo ) 
    10451048                 
    10461049                spanShow.parentNode.removeChild(spanShow); 
     
    11851188                                var group               = arguments[1]; 
    11861189                                var element             = arguments[2]; 
    1187                                 var index               = arguments[3]; 
    11881190                                var showOffline = loadscript.getShowContactsOffline(); 
    11891191                                 
     
    11931195                                var statusColor         = "black"; 
    11941196                                var statusDisplay       = "none"; 
     1197                                 
     1198                                var _resource   = ""; 
    11951199                                 
    11961200                                // Set Presence  
     
    12371241                                                                statusColor     = "orange"; 
    12381242                                                                 
    1239                                                                 if ( TrophyIM.controll.notificationNewUsers == 0 )  
     1243                                                                if ( TrophyIM.controll.notificationNewUsers == 0 ) 
    12401244                                                                { 
    1241                                                                         loadscript.teste_new(); 
     1245                                                                        loadscript.enabledNotificationNewUsers(); 
    12421246                                                                        TrophyIM.controll.notificationNewUsers++; 
    12431247                                                                } 
     
    12621266                                                                statusColor     = "orange";      
    12631267                                                                 
    1264                                                                 if ( TrophyIM.controll.notificationNewUsers == 0 )  
     1268                                                                if ( TrophyIM.controll.notificationNewUsers == 0 ) 
    12651269                                                                { 
    1266                                                                         loadscript.teste_new(); 
     1270                                                                        loadscript.enabledNotificationNewUsers(); 
    12671271                                                                        TrophyIM.controll.notificationNewUsers++; 
    12681272                                                                } 
     
    12781282                                }; 
    12791283 
    1280                                 var itensJid    = document.getElementById( "itenContact_" + objContact.contact.jid + "_" + index ); 
     1284                                var itensJid    = document.getElementById( "itenContact_" + objContact.contact.jid ); 
    12811285 
    12821286                                if( itensJid == null ) 
     
    12991303                                        { 
    13001304                                                divDisplay              : "block",  
    1301                                                 id                              : 'itenContact_' + objContact.contact.jid + '_' + index , 
    1302                                                 index                   : ((index == 0 ) ? "0" : index), 
     1305                                                id                              : 'itenContact_' + objContact.contact.jid , 
    13031306                                                jid                             : objContact.contact.jid, 
    13041307                                                nameContact     : nameContact, 
     
    13081311                                                status                  : status, 
    13091312                                                statusColor             : "black", 
    1310                                                 subscription    : objContact.contact.subscription 
     1313                                                subscription    : objContact.contact.subscription, 
     1314                                                resource                : _resource 
    13111315                                        } 
    13121316                                         
     
    13431347                                        _subscription( objContact ); 
    13441348                                         
    1345                                         with ( document.getElementById('span_show_' + 'itenContact_' + objContact.contact.jid + '_' + index ) ) 
     1349                                        // Set subscription 
     1350                                        itensJid.setAttribute('subscription', objContact.contact.subscription ); 
     1351                                         
     1352                                        with ( document.getElementById('span_show_' + 'itenContact_' + objContact.contact.jid ) ) 
    13461353                                        { 
    13471354                                                if( presence == "unavailable" && !showOffline ) 
     
    13611368                                         
    13621369                                        if( presence == "unavailable" && !showOffline ) 
     1370                                        { 
    13631371                                                itensJid.style.display = "none"; 
     1372                                        } 
    13641373                                        else 
    13651374                                        { 
     
    13761385                                if( !objContact.presence && !showOffline ) 
    13771386                                { 
    1378                                         with ( document.getElementById('span_show_' + 'itenContact_' + objContact.contact.jid + '_' + index )) 
     1387                                        with ( document.getElementById('span_show_' + 'itenContact_' + objContact.contact.jid )) 
    13791388                                        { 
    13801389                                                style.display   = "none"; 
    13811390                                        } 
    13821391 
    1383                                         with ( document.getElementById('itenContact_' + objContact.contact.jid + '_' + index ) ) 
     1392                                        with ( document.getElementById('itenContact_' + objContact.contact.jid ) ) 
    13841393                                        { 
    13851394                                                style.display   = "none"; 
     
    14011410                                                for( var j = 0; j < groups.length; j++ ) 
    14021411                                                { 
    1403                                                         addItem( TrophyIM.rosterObj.roster[users[i]], groups[j], element, j ); 
     1412                                                        addItem( TrophyIM.rosterObj.roster[users[i]], groups[j], element ); 
    14041413                                                } 
    14051414                                        } 
    14061415                                        else 
    14071416                                        { 
    1408                                                 addItem( TrophyIM.rosterObj.roster[users[i]], "Geral", element, 0 ); 
     1417                                                addItem( TrophyIM.rosterObj.roster[users[i]], "Geral", element ); 
    14091418                                        } 
    14101419                                } 
    14111420                                else 
    14121421                                { 
    1413                                         addItem( TrophyIM.rosterObj.roster[users[i]], "Geral", element, 0 ); 
     1422                                        addItem( TrophyIM.rosterObj.roster[users[i]], "Geral", element ); 
    14141423                                } 
    14151424                        } 
     
    18431852                this.addContact(barejid, 'not-in-roster'); 
    18441853            } 
     1854             
    18451855            var presence = 
    18461856                        { 
    1847                 resource:resource, priority:priority, show:show, status:status 
     1857                resource        : resource, 
     1858                priority        : priority, 
     1859                show            : show, 
     1860                status          : status 
    18481861            } 
    18491862             
     
    18521865                this.roster[jid_lower]['presence'] = {}; 
    18531866            } 
     1867             
    18541868            this.roster[jid_lower]['presence'][resource] = presence; 
    18551869        } 
  • trunk/jmessenger/xsl/itensGroup.xsl

    r2896 r2971  
    55        <xsl:param name="divDisplay" /> 
    66        <xsl:param name="id" /> 
    7         <xsl:param name="index" /> 
    87        <xsl:param name="jid"/> 
    98        <xsl:param name="nameContact" /> 
     
    1413        <xsl:param name="statusColor" /> 
    1514        <xsl:param name="subscription" /> 
     15        <xsl:param name="resource" /> 
    1616         
    1717        <xsl:template match="itens_group"> 
    1818 
    19                         <div id="{$id}" subscription="{$subscription}" onmousedown="loadscript.actionButton(event,'{$jid}','{$index}');" style="background: url('{$path_jabberit}templates/default/images/{$presence}.gif') no-repeat center left; padding-left: 20px; margin:2px 0px 0px 10px; cursor:pointer; font-weight:normal; display:{$divDisplay};"> 
     19                        <div id="{$id}" subscription="{$subscription}" resource="{$resource}" onmousedown="loadscript.actionButton(event,'{$jid}' );" style="background: url('{$path_jabberit}templates/default/images/{$presence}.gif') no-repeat center left; padding-left: 20px; margin:2px 0px 0px 10px; cursor:pointer; font-weight:normal; display:{$divDisplay};"> 
    2020                                <xsl:value-of select="$nameContact"/> 
    2121                        </div> 
  • trunk/jmessenger/xsl/notificationNewUsers.xsl

    r2969 r2971  
    1919                                        <xsl:for-each select="user"> 
    2020                                                <xsl:sort select="jid"/> 
    21                                                 <tr> 
    22                                                         <td align="left" style="width: 60%;"><xsl:value-of select="jid" /></td> 
    23                                                         <td align="center" style="width: 20%;"><a style="cursor:pointer;" onclick="alert('{jid}' + '{index}');"><xsl:value-of select="$lang_3"/></a></td> 
    24                                                         <td align="center" style="width: 20%;"><a style="cursor:pointer;" onclick="alert('{jid}' + '{index}');"><xsl:value-of select="$lang_4"/></a></td> 
     21                                                <tr id="itenContactNotification_{jid}" subscription="{status}"> 
     22                                                        <td align="left" style="width: 60%;"> 
     23                                                                <xsl:value-of select="jid" /> 
     24                                                        </td> 
     25                                                         
     26                                                        <td align="center" style="width: 20%;"> 
     27                                                                <div style="cursor:pointer; color:green;" onclick="loadscript.setAutorization('{jid}');"> 
     28                                                                        <xsl:value-of select="$lang_3"/> 
     29                                                                </div> 
     30                                                        </td> 
     31                                                         
     32                                                        <td align="center" style="width: 20%;"> 
     33                                                                <div style="cursor:pointer; color:red;" onclick="alert('{jid}');"> 
     34                                                                        <xsl:value-of select="$lang_4"/> 
     35                                                                </div> 
     36                                                        </td> 
     37                                                         
    2538                                                </tr> 
    2639                                        </xsl:for-each> 
Note: See TracChangeset for help on using the changeset viewer.