Changeset 2626


Ignore:
Timestamp:
04/23/10 15:57:20 (14 years ago)
Author:
alexandrecorreia
Message:

Ticket #986 - Correcao para compatibilizar o carregamento do script para o IE.

Location:
sandbox/jabberit_messenger/trophy_expresso
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • sandbox/jabberit_messenger/trophy_expresso/js/loadIM.js

    r2621 r2626  
    3232                 
    3333                        if ( !e ) 
    34                                 var e = window.event; 
     34                                e = window.event; 
    3535 
    3636                        var _X = e.clientX + document.body.scrollLeft - document.body.clientLeft; 
     
    4343                                return false; 
    4444                        }; 
    45          
    46                         if ( ( e.which && e.which > 1 ) || ( e.button && e.button > 1 ) ) 
    47                         { 
    48                                 optionsItensContact( jid, index, coord ); 
    49                         } 
    50                         else 
    51                         { 
    52                                 if ( e.target.id ) 
     45                         
     46                        if( e.button ) 
     47                        { 
     48                                if( e.button > 1 ) 
     49                                        optionsItensContact( jid, index, coord ); 
     50                                else 
    5351                                        TrophyIM.rosterClick(jid); 
     52                        }        
     53                        else if( e.which ) 
     54                        { 
     55                                if( e.which > 1 ) 
     56                                        optionsItensContact( jid, index, coord ); 
     57                                else 
     58                                        if( e.target.id ) 
     59                                                TrophyIM.rosterClick(jid); 
    5460                        } 
    5561                } 
     
    159165                { 
    160166                        var element = arguments[0]; 
    161                          
     167 
    162168                        if( showhidden == null ) 
    163169                                showhidden = new ShowHidden(300); 
     
    173179                        for( var i in _options ) 
    174180                        { 
    175                                 _itens += '<img src="'+arrow_right.src+'"/>'; 
    176                                 _itens += '<span style="cursor:pointer; margin:3px;" onclick='+_options[i][1]+'>'; 
    177                                 _itens += _options[i][0] + '</span><br/>'; 
     181                                if( typeof(_options) == "object" ) 
     182                                { 
     183                                        _itens += '<img src="'+arrow_right.src+'"/>'; 
     184                                        _itens += '<span style="cursor:pointer; margin:3px;" onclick='+_options[i][1]+'>'; 
     185                                        _itens += _options[i][0] + '</span><br/>'; 
     186                                } 
    178187                        } 
    179188                         
    180189                        var _optionsItens = document.createElement("div"); 
    181                                 _optionsItens.setAttribute("style", "margin: 20px 0px 0px -4px;"); 
     190                                _optionsItens.style.marginTop   = "19px"; 
     191                                _optionsItens.style.marginLeft  = "-8px"; 
    182192                                _optionsItens.className         = "x-menu"; 
    183193                                _optionsItens.style.zIndex      = '999999'; 
     
    226236                { 
    227237                        var _element = arguments[0]; 
    228                                 _element.style.background = "url('"+path_jabberit+"templates/default/images/arrow_right.gif')no-repeat center left"; 
     238                                _element.style.background = "url('"+path_jabberit+"templates/default/images/arrow_right.gif') no-repeat center left"; 
    229239                                _element.onclick = function(){ groupsVisible(_element);}; 
    230240                                 
     
    234244                                while( _elementNext ) 
    235245                                {        
    236                                         _elementNext.style.display = "none"; 
     246                                        if( _elementNext.nodeType == 1 ) 
     247                                                _elementNext.style.display = "none"; 
     248                                         
    237249                                        _elementNext = _elementNext.nextSibling; 
    238250                                } 
     
    245257                { 
    246258                        var _element = arguments[0]; 
    247                                 _element.style.background = "url('"+path_jabberit+"templates/default/images/arrow_down.gif')no-repeat center left"; 
     259                                _element.style.background = "url('"+path_jabberit+"templates/default/images/arrow_down.gif') no-repeat center left"; 
    248260                                _element.onclick = function(){ groupsHidden(_element);}; 
    249261 
     
    253265                                while( _elementNext ) 
    254266                                {        
    255                                         _elementNext.style.display = "block"; 
     267                                        if( _elementNext.nodeType == 1 ) 
     268                                                _elementNext.style.display = "block"; 
     269 
    256270                                        _elementNext = _elementNext.nextSibling; 
    257271                                } 
     
    383397                        for( var i in _options ) 
    384398                        { 
    385                                 _itens += '<img src="'+arrow_right.src+'"/>'; 
    386                                 _itens += '<span style="cursor:pointer;margin:3px;font-weight:normal;" onclick='+_options[i][1]+'>'; 
    387                                 _itens += _options[i][0] + '</span><br/>'; 
     399                                if( typeof(_options[i]) == "object") 
     400                                { 
     401                                        _itens += '<img src="'+arrow_right.src+'"/>'; 
     402                                        _itens += '<span style="cursor:pointer;margin:3px;font-weight:normal;" onclick='+_options[i][1]+'>'; 
     403                                        _itens += _options[i][0] + '</span><br/>'; 
     404                                } 
    388405                        } 
    389406                         
     
    581598                                               ['Ocupado', 'dnd', '<img src="'+path_jabberit+'templates/default/images/dnd.gif" />'], 
    582599                                               ['Desconectado', 'unavailable', '<img src="'+path_jabberit+'templates/default/images/unavailable.gif" />'], 
    583                                                ['Mensagem de Status...', 'status', '<img src="'+path_jabberit+'templates/default/images/message_normal.gif" />']                                                 
     600                                               ['Mensagem de Status...', 'status', '<img src="'+path_jabberit+'templates/default/images/message_normal.gif" />'],                                                
    584601                                          ]; 
    585602                         
     
    588605                        for( var i in _status ) 
    589606                        { 
    590                                 _itens += '<span style="cursor:pointer;" onclick="TrophyIM.setPresence(\''+_status[i][1]+'\'); loadIM.setStatusJabber(\''+_status[i][0]+'\',\''+_status[i][1]+'\');">'; 
    591                                 _itens += _status[i][2]+ "<span style='margin:3px;'>" + _status[i][0] + "</span></span><br/>"; 
     607                                if( typeof( _status[i]) == "object" ) 
     608                                { 
     609                                        _itens += '<span style="cursor:pointer;" onclick="TrophyIM.setPresence(\''+_status[i][1]+'\'); loadIM.setStatusJabber(\''+_status[i][0]+'\',\''+_status[i][1]+'\');">'; 
     610                                        _itens += _status[i][2]+ "<span style='margin:3px;'>" + _status[i][0] + "</span></span><br/>"; 
     611                                } 
    592612                        } 
    593613                         
    594614                        var _statusItens = document.createElement("div"); 
    595                                 _statusItens.setAttribute("style", "margin: 62px 0px 0px 76px;"); 
    596                                 _statusItens.className          = "x-menu"; 
    597                                 _statusItens.style.zIndex       = '99999'; 
    598                                 _statusItens.innerHTML          = _itens;   
    599                                 _statusItens.onclick            = function(){ showhidden.hiddenObject(false); }; 
     615                                _statusItens.style.marginTop    = "65px"; 
     616                                _statusItens.style.marginLeft   = "67px"; 
     617                                _statusItens.className                  = "x-menu"; 
     618                                _statusItens.style.zIndex               = '99999'; 
     619                                _statusItens.innerHTML                  = _itens;   
     620                                _statusItens.onclick                    = function(){ showhidden.hiddenObject(false); }; 
    600621                                                                                   
    601622                                showhidden.action('onmouseover', 'onmouseout', _statusItens); 
     
    621642                                var _text       = arguments[0]; 
    622643                                var _img        = arguments[1]; 
    623                                  
    624                                 getElement('statusJabberImg').setAttribute("style", "background-image: url('"+path_jabberit+"templates/default/images/"+_img+".gif'); margin-left: 13px;width:15px; height:15px;"); 
    625                                 getElement('statusJabberText').innerHTML = _text; 
     644                                                                                                                                         
     645                                getElement('statusJabberText').innerHTML                = _text; 
     646                                getElement('statusJabberImg').style.background  = "url('"+path_jabberit+"templates/default/images/"+_img+".gif')"; 
    626647                                getElement('status_jabber_expresso').style.background = "url('"+path_jabberit+"templates/default/images/"+_img+".gif') no-repeat"; 
    627648                        } 
  • sandbox/jabberit_messenger/trophy_expresso/js/trophyim.js

    r2620 r2626  
    11371137                                        } 
    11381138                                         
    1139                                         itensJid.style.background       = "url('"+path_jabberit+"templates/default/images/" + presence + ".gif')no-repeat center left"; 
     1139                                        itensJid.style.background       = "url('"+path_jabberit+"templates/default/images/" + presence + ".gif') no-repeat center left"; 
    11401140                                } 
    11411141                        } 
  • sandbox/jabberit_messenger/trophy_expresso/xsl/chatBox.xsl

    r2577 r2626  
    1212                                <div id="{$idChatBox}" style="height:190px; width:370px; overflow-y:scroll;"></div> 
    1313                                <div style="margin:2px;"> 
    14                                         <textarea id="{$jidTo}__sendBox" class="trophyimchatinput" style="padding-right: 78px; height:130px; width:360px;"></textarea> 
    15                                         <div id="{$jidTo}__photo" style="position:relative;margin:-126px 0 0 290px;width:60px ;height:80px ;background-image:url('{$path_jabberit}templates/default/images/photo.png');" /> 
    16                                         <div style="margin: 7px 5px 5px 295px;"> 
     14                                        <textarea id="{$jidTo}__sendBox" class="trophyimchatinput" style="padding-left: 78px; height:130px; width:360px;"></textarea> 
     15                                        <div id="{$jidTo}__photo" style="position:relative;margin:-126px 0 0 10px;width:60px ;height:80px ;background-image:url('{$path_jabberit}templates/default/images/photo.png');" /> 
     16                                        <div style="margin: 7px 5px 5px 10px;"> 
    1717                                                <input type="button" value="Send" onclick="TrophyIM.sendMessage('{$jidTo}')"/> 
    1818                                        </div> 
  • sandbox/jabberit_messenger/trophy_expresso/xsl/contactsList.xsl

    r2511 r2626  
    1111                 
    1212                <fieldset style="margin:2px; border:1px dotted #000000; height: 90px;"> 
    13                         <div id="{$idUser}__photo" style="margin:0px; width:60px; height:80px; background-image:url('{$path_jabberit}/templates/default/images/photo.png');"/> 
    14                         <div style="position: absolute; margin-top: -19px; margin-left: 75px; cursor: pointer;" onclick="loadIM.setPresence(this);"> 
    15                                 <div id="statusJabberImg" style="background-image: url('{$path_jabberit}/templates/default/images/available.gif'); margin-left: 13px;width:15px; height:15px;"></div> 
    16                                 <div id="statusJabberText" style="margin-top: -13px; margin-left: 30px;"> Disponível </div> 
    17                                 <div style="background-image: url('{$path_jabberit}/templates/default/images/arrow_down.gif'); margin-top: -8px; margin-left: 0px; width:15px; height:15px;"/>  
    18                         </div> 
    19                          
    20                         <div style="position: absolute; margin-top: -50px; margin-left: 75px;"> 
     13                        <div id="{$idUser}__photo" style="position: absolute; left: 5px; top: 5px; width:60px; height:80px; background-image:url('{$path_jabberit}/templates/default/images/photo.png');"/> 
     14 
     15                        <div style="position: absolute; left: 80px; top: 10px;"> <xsl:value-of select="$full_name"/> </div> 
     16 
     17                        <div style="position: absolute; top: 30px; left: 80px;"> 
    2118                                <button style="width:35px;" alt="Adicionar Contatos" title="Adicionar Contatos" onclick="loadIM.addContact();"> 
    2219                                        <img src="{$path_jabberit}/templates/default/images/users.png"/> 
    2320                                </button> 
    24                         </div>   
    25                         <div style="positon: absolute; margin-top: -75px; margin-left: 75px;"> <xsl:value-of select="$full_name"/> </div> 
     21                        </div> 
     22 
     23                        <div style="position: absolute; left: 80px; top: 55px; cursor: pointer;" onclick="loadIM.setPresence(this);"> 
     24                                <div id="statusJabberImg" style="background: url('{$path_jabberit}/templates/default/images/available.gif'); margin-left: 13px;width:15px; height:15px;"></div> 
     25                                <div id="statusJabberText" style="margin-top: -13px; margin-left: 30px;"> Disponível </div> 
     26                                <div style="background-image: url('{$path_jabberit}/templates/default/images/arrow_down.gif'); margin-top: -13px; margin-left: 0px; width:15px; height:15px;"/>  
     27                        </div> 
     28 
    2629                </fieldset> 
    2730                                 
  • sandbox/jabberit_messenger/trophy_expresso/xsl/groups.xsl

    r2471 r2626  
    99 
    1010                        <div style="margin-bottom: 3px;"> 
    11                                 <span  onclick="loadIM.groupsHidden(this);" style="background: url('{$path_jabberit}/templates/default/images/arrow_down.gif')no-repeat center left; font-weight:bold; padding-left: 16px; cursor: pointer;"> 
     11                                <span  onclick="loadIM.groupsHidden(this);" style="background: url('{$path_jabberit}/templates/default/images/arrow_down.gif') no-repeat center left; font-weight:bold; padding-left: 16px; cursor: pointer;"> 
    1212                                        <xsl:value-of select="$nameGroup"/> 
    1313                                </span> 
  • sandbox/jabberit_messenger/trophy_expresso/xsl/itensGroup.xsl

    r2577 r2626  
    1616        <xsl:template match="itens_group"> 
    1717 
    18                         <div id="{$id}" subscription="{$subscription}" onmousedown="loadIM.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;"> 
     18                        <div id="{$id}" subscription="{$subscription}" onmousedown="loadIM.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;"> 
    1919                                <xsl:value-of select="$nameContact"/> 
    2020                        </div> 
    21                         <span id="span_show_{$id}" style="margin:2px 0px 0px 10px; font-size: 8pt; font-style:italic; display:{$statusDisplay}; color:{$statusColor};"><xsl:value-of select="$status"/></span> 
     21                        <span id="span_show_{$id}" style="margin:2px 0px 0px 10px; font-size: 10px; font-style:italic; display:{$statusDisplay}; color:{$statusColor};"><xsl:value-of select="$status"/></span> 
    2222                         
    2323        </xsl:template> 
Note: See TracChangeset for help on using the changeset viewer.