Changeset 898


Ignore:
Timestamp:
05/21/09 15:54:42 (15 years ago)
Author:
alexandrecorreia
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/jabberit_messenger/templates/default/setup.js

    r697 r898  
    9393        } 
    9494         
    95         function setParticipantsExternal() 
    96         { 
    97                 if( arguments.length > 0 ) 
    98                 { 
    99                         var element = arguments[0]; 
    100                         var form = arguments[1].forms[0]; 
    101                         var value = false; 
    102                          
    103                         for(var i = 0; i < element.options.length; i++) 
    104                         { 
    105                                 if( element.options[i].selected == true && element.options[i].value == 'true') 
    106                                         value = true; 
    107                         } 
    108                          
    109                         for(var i = 0; i < form.elements.length; i++) 
    110                         { 
    111                                 switch(form.elements[i].type) 
    112                                 { 
    113                                         case 'text': 
    114                                         case 'button': 
    115                                                 form.elements[i].disabled = false;                       
    116                                                 if(!value) 
    117                                                         form.elements[i].disabled = true; 
    118  
    119                                                 break; 
    120                                 } 
    121                         } 
    122                          
    123                         _conn.go("$this.db_im.setUseParticipantsExternal", 
    124                                 function(data) 
    125                                 { 
    126                                         if(!data) 
    127                                                 alert('Error !'); 
    128                                 }, 
    129                                 "value=" + value); 
    130                 } 
    131         } 
    132  
    13395        function getInputs(pDocument) 
    13496        { 
     
    239201        } 
    240202 
    241         function setOrganizationsForGroups() 
     203        function setConfServerJabber() 
    242204        { 
    243205                var elementSel = document.getElementById('organizations_ldap_jabberit'); 
    244206                var Organization = ""; 
     207                var inputHostJabber = ltrim(document.getElementById('HostNameJabber').value); 
    245208                 
    246209                for(var i = 0; i < elementSel.options.length; i++) 
     
    250213                } 
    251214                 
     215                if( Organization && inputHostJabber ) 
     216                { 
     217                        _conn.go("$this.db_im.setHostJabber", 
     218                                         function(data) 
     219                                         { 
     220                                                var _params = { 
     221                                                                'lang1': jabberitGetLang('Organization'), 
     222                                                                'lang2': jabberitGetLang('Servers Jabber'), 
     223                                                                'lang3': jabberitGetLang('Delete')                                                               
     224                                                }; 
     225 
     226                                                var Table = document.getElementById('tableConfServersJabber'); 
     227                                                Table.parentNode.innerHTML = _xtools.parse( data, 'tableConfServersJabber.xsl', _params); 
     228 
     229                                                elementSel.options[0].selected = true; 
     230                                                document.getElementById('HostNameJabber').value = ""; 
     231                                                         
     232                                         },"organization="+Organization+"&hostJabber="+inputHostJabber); 
     233                } 
     234         
     235        } 
     236 
     237        function setOrganizationsForGroups() 
     238        { 
     239                var elementSel = document.getElementById('organizations_ldap_jabberit'); 
     240                var Organization = ""; 
     241                 
     242                for(var i = 0; i < elementSel.options.length; i++) 
     243                { 
     244                        if( elementSel.options[i].selected == true && elementSel.options[i].value != "-1" ) 
     245                                Organization = elementSel.options[i].value; 
     246                } 
     247                 
    252248                if( Organization ) 
    253249                { 
     
    256252                        var gidNumber = document.getElementById('gidNumber').value; 
    257253         
    258                          
    259254                        _conn.go("$this.db_im.setOuGroupsLocked", 
    260255                                         function(data) 
     
    275270        } 
    276271 
     272        function setParticipantsExternal() 
     273        { 
     274                if( arguments.length > 0 ) 
     275                { 
     276                        var element = arguments[0]; 
     277                        var form = arguments[1].forms[0]; 
     278                        var value = false; 
     279                         
     280                        for(var i = 0; i < element.options.length; i++) 
     281                        { 
     282                                if( element.options[i].selected == true && element.options[i].value == 'true') 
     283                                        value = true; 
     284                        } 
     285                         
     286                        for(var i = 0; i < form.elements.length; i++) 
     287                        { 
     288                                switch(form.elements[i].type) 
     289                                { 
     290                                        case 'text': 
     291                                        case 'button': 
     292                                                form.elements[i].disabled = false;                       
     293                                                if(!value) 
     294                                                        form.elements[i].disabled = true; 
     295 
     296                                                break; 
     297                                } 
     298                        } 
     299                         
     300                        _conn.go("$this.db_im.setUseParticipantsExternal", 
     301                                function(data) 
     302                                { 
     303                                        if(!data) 
     304                                                alert('Error !'); 
     305                                }, 
     306                                "value=" + value); 
     307                } 
     308        } 
     309 
     310        function removeHostsJabber() 
     311        { 
     312                if( arguments.length > 0 ) 
     313                { 
     314                        var idElement = arguments[0]; 
     315                        var elementTableTr = document.getElementById(idElement); 
     316                         
     317                        _conn.go("$this.db_im.removeHostsJabber", 
     318                                     function(data) 
     319                                     { 
     320                                        data = eval(data); 
     321                                        if( data ) 
     322                                                        elementTableTr.parentNode.removeChild(elementTableTr);                                           
     323                                     }, 
     324                                         "item="+idElement); 
     325                } 
     326        } 
     327 
    277328        function removeOrgGroupsLocked() 
    278329        { 
     
    312363                } 
    313364        } 
    314          
     365 
    315366        function removeParticipantsExternal() 
    316367        { 
     
    332383        function constructScript(){} 
    333384 
    334         constructScript.prototype.setPartExternal = setParticipantsExternal; 
    335         constructScript.prototype.removePartExternal = removeParticipantsExternal; 
    336         constructScript.prototype.removeOrg = removeOrgLdapAttributes; 
    337         constructScript.prototype.removeOrgGroupsLocked = removeOrgGroupsLocked; 
    338         constructScript.prototype.setOrgFgroups = setOrganizationsForGroups; 
    339         constructScript.prototype.setPartExternal = setParticipantsExternal;     
    340         constructScript.prototype.sendf = sendf; 
     385        constructScript.prototype.removeHostsJ                          = removeHostsJabber; 
     386        constructScript.prototype.removeOrg                             = removeOrgLdapAttributes; 
     387        constructScript.prototype.removeOrgGroupsLocked         = removeOrgGroupsLocked; 
     388        constructScript.prototype.removePartExternal            = removeParticipantsExternal; 
     389        constructScript.prototype.setConfServerJabber           = setConfServerJabber; 
     390        constructScript.prototype.setOrgFgroups                         = setOrganizationsForGroups; 
     391        constructScript.prototype.setPartExternal                       = setParticipantsExternal;       
     392        constructScript.prototype.sendf                                         = sendf; 
    341393         
    342394        window.constructScript = new constructScript; 
Note: See TracChangeset for help on using the changeset viewer.