Ignore:
Timestamp:
03/12/09 11:32:55 (15 years ago)
Author:
niltonneto
Message:

Fechamento das ocorrências referentes à versão 0.7.11

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/jabberit_messenger/js/load.js

    r624 r697  
    11(function() 
    22{ 
     3        var _autoStatusTime = 60000; // 1 minuto 
     4        var _autoStatus; 
    35        var _conn   = new JITConnector(path_jabberit); 
    46        var _xtools = new JITXTools(path_jabberit); 
    5         var _showhidden = new ShowHidden(1500); 
     7        var _showhidden = new ShowHidden(1000); 
    68        var myWindow      = ''; 
    79        var flagMouseOver = ''; 
    810        var flagOpenIM    = ''; 
    911        var flagOpenPopup = ''; 
     12        var flagAwayIM    = ''; 
    1013     
    1114        // Sniffer Browser 
     
    4043        var _ldap       = new JITLdap( _conn, _xtools, _window); 
    4144 
     45        function addContacts() 
     46        { 
     47                _ldap.add(); 
     48        } 
     49 
    4250        function addIcon() 
    4351        { 
     
    8492 
    8593                        var _menu; 
    86                                 _menu = top.document.createElement('span'); 
     94                                _menu = top.document.createElement('div'); 
    8795                                _menu.setAttribute('id','fast_menu_jabberit'); 
    8896                                _menu.style.backgroundColor = 'cecece'; 
     97                                _menu.style.border = '1px dashed #000'; 
    8998                                _menu.style.display = 'none'; 
    9099                                _menu.style.margin = '20px 5px 0px -15px'; 
    91100                                _menu.style.position = 'absolute'; 
    92101                                _menu.style.zIndex = '99999'; 
    93                                 _menu.style.border = '1px dashed #000'; 
     102                                _menu.onmouseout = function(){ _showhidden.hiddenObject(false); }; 
     103                                _menu.onmouseover = function(){ _showhidden.hiddenObject(true); }; 
    94104                                 
    95105                        divJabber.insertBefore(_menu, divJabber.firstChild); 
     
    124134                                                ['Add Contacts',addContacts], 
    125135                                                ['Help',helpJabberit], 
    126                                                 ['Preferences', preferences] 
     136                                                ['Preferences', preferences], 
     137                                                ['Change Status', subMenuChangeStatus] 
    127138                                        ]; 
    128139 
    129                                         var _style_text = 'cursor: pointer; padding:2px 2px 2px 15px; background: no-repeat url(' + jabberit_group_close.src + ');';                                     
     140                                        var _style_text = 'cursor: pointer; padding:2px 2px 2px 15px; border-bottom:1px solid #dedede; background: no-repeat url(' + jabberit_group_close.src + ');';                                    
    130141 
    131142                                        var _xml = _xtools.xml('menu'); 
     
    165176                                                ); 
    166177                                        } 
    167                                 } 
    168                         ); 
    169  
    170  
    171  
    172                 // 
    173                 } 
    174         } 
    175  
    176         function addContacts() 
    177         { 
    178                 _ldap.add(); 
     178                                }); 
     179                } 
     180        } 
     181 
     182        function autoStatus() 
     183        { 
     184                 
     185                if ( _autoStatus ) 
     186                        clearTimeout(_autoStatus); 
     187 
     188                var _div_status = document.getElementById('status_Jabber_Expresso'); 
     189                if ( _div_status ) 
     190                { 
     191                        var _status = _div_status.style.backgroundImage; 
     192                        _status = _status.substr(_status.lastIndexOf('/') + 1); 
     193                        _status = _status.substr(0, _status.indexOf('.')); 
     194                        if ( _status == 'xa' && _div_status.getAttribute('autoStatus') ) 
     195                        { 
     196                                _div_status.removeAttribute('autoStatus'); 
     197                                changeStatusJava("2"); 
     198                        } 
     199                } 
     200 
     201                var TimeStatus = flagAwayIM.split(':'); 
     202 
     203                if( TimeStatus[1] ) 
     204                        _autoStatus = setTimeout(autoStatusHandler, parseInt(TimeStatus[1])*_autoStatusTime); 
     205                else 
     206                        _autoStatus = setTimeout(autoStatusHandler, parseInt(_autoStatusTime)); 
     207        } 
     208 
     209        function autoStatusHandler() 
     210        { 
     211                var _div_status = document.getElementById('status_Jabber_Expresso'); 
     212                if ( _div_status ) 
     213                { 
     214                        var _status = _div_status.style.backgroundImage; 
     215                        _status = _status.substr(_status.lastIndexOf('/') + 1); 
     216                        _status = _status.substr(0, _status.indexOf('.')); 
     217                        if ( _status == 'available' ) 
     218                        { 
     219                                _div_status.setAttribute('autoStatus','true'); 
     220                                changeStatusJava("5"); 
     221                        } 
     222                } 
    179223        } 
    180224 
     
    190234                                element.innerHTML = "Nome do Contato .: "; 
    191235                } 
     236        } 
     237 
     238        function changeStatusJava() 
     239        { 
     240                if(arguments.length > 0 ) 
     241                { 
     242                        try 
     243                        { 
     244                                // If Layer; 
     245                                if( elementIframe = document.getElementById('iframe_applet_jabberit') ) 
     246                                { 
     247                                        if( !is_ie ) 
     248                                                elementIframe.contentDocument.applets[0].changeStatusfromExpresso(arguments[0]); 
     249                                        else 
     250                                                elementIframe.contentWindow.document.applets[0].changeStatusfromExpresso(arguments[0]); 
     251                                } 
     252                                else // If Pop-Up 
     253                                { 
     254                                        myWindow.document.applets[0].changeStatusfromExpresso(arguments[0]); 
     255                                } 
     256                        } 
     257                        catch(e) 
     258                        { 
     259                                if( confirm('Deseja conectar o IM ?') ) 
     260                                        showWindow(); 
     261                        } 
     262                }                
    192263        } 
    193264 
     
    225296                                                        var autoConnect = ''; 
    226297                                                        flagOpenIM = data; 
    227                                                          
     298 
    228299                                                        if( data.indexOf(';') != -1) 
    229300                                                        { 
    230301                                                                var temp = data.split(';'); 
    231302                                                                autoConnect = flagOpenIM = temp[0]; 
    232  
     303                                                                 
     304                                                                // Open as Pop-Up 
    233305                                                                flagOpenPopup = 'openWindowJabberitPopUp:false'; 
    234306                                                                 
     
    238310                                                                                flagOpenPopup = temp[1]; 
    239311                                                                } 
     312                                                                 
     313                                                                // Away 
     314                                                                flagAwayIM = 'flagAwayIM:5'; 
     315                                                                 
     316                                                                if( temp[2] ) 
     317                                                                { 
     318                                                                        flagAwayIM = temp[2]; 
     319                                                                } 
    240320                                                        } 
    241321                                                        else 
     
    243323                                                                autoConnect = flagOpenIM; 
    244324                                                        } 
    245          
     325                                                         
    246326                                                        if( autoConnect == 'openWindowJabberit:true' ) 
    247327                                                        { 
     
    401481                                _splash.style.zIndex = '99999'; 
    402482                                _splash.style.border = '2px outset #000'; 
     483                                _splash.onmouseout = function(){ _showhidden.hiddenObject(false); }; 
     484                                _splash.onmouseover = function(){ _showhidden.hiddenObject(true); }; 
    403485                         
    404486                                for(var i = 0; i < orgPartExternal.length; i++) 
     
    415497                { 
    416498                        var _win_preferences = _window.load('jabberit_preferences'); 
    417                                 _win_preferences.size(320,250); 
     499                                _win_preferences.size(400,310);                          
    418500                                _win_preferences.position(150,100); 
    419501                                _win_preferences.title('.:: Expresso - JMessenger '+jabberitGetLang('Preferences')+'::.'); 
     
    447529                                                   'lang7' : jabberitGetLang('Cancel'), 
    448530                                                   'lang8' : jabberitGetLang('Window'), 
    449                                                    'lang9' : jabberitGetLang('Open as Pop-Up Window'),                                              
     531                                                   'lang9' : jabberitGetLang('Open as Pop-Up Window'), 
     532                                                   'lang10' : jabberitGetLang('Away'), 
     533                                                   'lang11' : jabberitGetLang('Set status to away after'), 
     534                                                   'lang12' : jabberitGetLang('minutes'),                                                   
    450535                                                   'langYes': jabberitGetLang('Yes'), 
    451                                                    'langNo': jabberitGetLang('No')                                                                                         
     536                                                   'langNo' : jabberitGetLang('No')                                                                                         
    452537                                                  }; 
    453538                        _win_preferences.content(_xtools.parse(_xtools.xml('preferences_jabberit'), 'preferences_jabberit.xsl', _params)); 
     
    462547                        _win_preferences.size(320,250); 
    463548                } 
    464  
     549                 
    465550                // Element openWindowJabberit 
    466551                var value1 = flagOpenIM.split(':'); 
     
    472557                                element1.options[i].selected = true; 
    473558 
    474  
    475                 // Element userOfflineJabberit 
     559                 
     560                // Element openWindowJabberitPopUp 
    476561                var value2 = flagOpenPopup.split(':'); 
    477562                var element2 = document.getElementById(value2[0]); 
     
    481566                        if( element2.options[i].value == valueSelect2 ) 
    482567                                element2.options[i].selected = true; 
     568                                 
     569                // Element flagAwayIM 
     570                var value3 = flagAwayIM.split(':'); 
     571                var element3 = document.getElementById(value3[0]); 
     572                element3.value = value3[1]; 
    483573                 
    484574        } 
     
    521611                                flagOpenPopup = 'openWindowJabberitPopUp:' + elementOpenPop.options[i].value; 
    522612                        } 
    523                          
     613                 
     614                // Element flagAwayIM 
     615                var elementFlagIM = document.getElementById('flagAwayIM'); 
     616                 
     617                if( elementFlagIM.value.length > 0 && parseInt(elementFlagIM.value) > 0 ) 
     618                { 
     619                        flagAwayIM = 'flagAwayIM:' + elementFlagIM.value; 
     620                        value += '&preferences3=flagAwayIM:' + elementFlagIM.value; 
     621                } 
     622                else 
     623                { 
     624                        alert(jabberitGetLang('Enter a value greater than or equal to 1!')); 
     625                        return false; 
     626                } 
     627 
    524628                _conn.go('$this.db_im.setPreferences', 
    525629                                 function(data) 
     
    552656                var _win_contacts = _window.get('jabberit_contacts'); 
    553657                 
    554                 if( flagOpenPopup == 'openWindowJabberitPopUp:true' ) 
     658                if( flagOpenPopup === 'openWindowJabberitPopUp:true' ) 
    555659                { 
    556660                        openPopup();                                     
     
    575679        } 
    576680 
     681        function subMenuChangeStatus() 
     682        { 
     683                if(document.getElementById('subMenu_Change_Status_JabberIt') == null ) 
     684                { 
     685                        var _itens  = [ 
     686                                                                ['Online', 'loadscript.chstatusJava("2")', 'available_jabberit.src'], 
     687                                                                ['Free For Chat', 'loadscript.chstatusJava("1")', 'chat_jabberit.src'], 
     688                                                                ['Xa', 'loadscript.chstatusJava("3")','xa_jabberit.src'], 
     689                                                                ['Dnd', 'loadscript.chstatusJava("4")','dnd_jabberit.src'], 
     690                                                                ['Away', 'loadscript.chstatusJava("5")','away_jabberit.src'], 
     691                                                                ['Invisible', 'loadscript.chstatusJava("6")','invisible_jabberit.src'] 
     692                                                  ]; 
     693         
     694                        var _itensMenu = "<dl style='padding:1px !important; margin:2px 2px !important;font-size:8pt !important;background: #cecece;color: #000;'>"; 
     695                         
     696                        for(var i in _itens) 
     697                        { 
     698                                if( i == 5 ) 
     699                                        _itensMenu += "<dt onmouseover='elementOnMouseOver(this);' onmouseout='elementOnMouseOut(this, false);' style='cursor: pointer;' onclick=" + _itens[i][1] + ">"; 
     700                                else 
     701                                        _itensMenu += "<dt onmouseover='elementOnMouseOver(this);' onmouseout='elementOnMouseOut(this, false);' style='cursor: pointer;border-bottom:1px solid #dedede;' onclick=" + _itens[i][1] + ">"; 
     702                                _itensMenu += "<img src='" + eval(_itens[i][2]) + "' style='margin-right:3px;'/>" + jabberitGetLang(_itens[i][0]) + "</dt>"; 
     703                        } 
     704 
     705                        _itensMenu += "</dl>"; 
     706         
     707                        var _subMenu_div = document.createElement("div"); 
     708                                _subMenu_div.setAttribute('id','subMenu_Change_Status_JabberIt'); 
     709                                _subMenu_div.style.margin = '-10px 5px 0px 0px'; 
     710                                _subMenu_div.style.background = '#cecece'; 
     711                                _subMenu_div.style.border = '1px dashed #000'; 
     712                                _subMenu_div.style.float = 'left'; 
     713                                _subMenu_div.style.position = 'absolute'; 
     714                                _subMenu_div.style.left = '55px'; 
     715                                _subMenu_div.style.width = '120px'; 
     716                                _subMenu_div.style.zindex = '99999'; 
     717                                _subMenu_div.innerHTML = _itensMenu;  
     718         
     719                        var elementParent = document.getElementById('fast_menu_jabberit'); 
     720                        elementParent.appendChild(_subMenu_div); 
     721                } 
     722        } 
     723 
    577724        function Load() 
    578725        { 
    579726                addIcon(); 
    580727                getPreferences(); 
    581         } 
    582  
    583         Load.prototype.adIcon   = addIcon; 
    584         Load.prototype.cLabel   = changeLabel; 
    585         Load.prototype.closeW   = closeWindow; 
     728                 
     729                // AutoStatus Away               
     730                autoStatus(); 
     731                configEvents(document, 'onmousemove', autoStatus); 
     732                configEvents(document, 'onkeypress', autoStatus); 
     733        } 
     734 
     735        Load.prototype.adIcon           = addIcon; 
     736        Load.prototype.autoStatusIM     = autoStatus; 
     737        Load.prototype.chstatusJava     = changeStatusJava; 
     738        Load.prototype.closeW           = closeWindow; 
     739        Load.prototype.cLabel           = changeLabel; 
    586740        Load.prototype.getElement       = getElementStatus; 
    587741        Load.prototype.keyPress         = keyPressSearch; 
    588742        Load.prototype.openWinParExt = openWindowParticipantsExternal; 
    589         Load.prototype.search   = searchUser; 
    590         Load.prototype.setPrefe = setPreferences; 
    591         Load.prototype.show             = showDiv; 
    592         Load.prototype.showW    = showWindow; 
    593  
     743        Load.prototype.search           = searchUser; 
     744        Load.prototype.setPrefe         = setPreferences; 
     745        Load.prototype.show                     = showDiv; 
     746        Load.prototype.showW            = showWindow; 
     747         
    594748        window.loadscript = new Load; 
    595749 
    596750})(); 
     751 
     752// Functions OnMouseOver e OnMouseOut 
     753 
     754function elementOnMouseOut() 
     755{ 
     756        if( arguments.length > 0 ) 
     757        { 
     758                var _element = arguments[0]; 
     759                        _element.style.backgroundColor = ''; 
     760                        _element.style.border = ''; 
     761                        if( !arguments[1] ) 
     762                                _element.style.borderBottom = '1px solid #dedede'; 
     763        } 
     764} 
     765 
     766function elementOnMouseOver() 
     767{ 
     768        if( arguments.length > 0 ) 
     769        { 
     770                var _element = arguments[0]; 
     771                        _element.style.backgroundColor = 'white'; 
     772                        _element.style.border = '1px solid black'; 
     773        } 
     774} 
     775 
Note: See TracChangeset for help on using the changeset viewer.