Ignore:
Timestamp:
10/07/09 16:34:46 (15 years ago)
Author:
eduardoalex
Message:

Ticket #681 - Criada a função para delegar evento

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/calendar/templates/classic/js/edit_exmail.js

    r1267 r1500  
    2121var agt = navigator.userAgent.toLowerCase(); 
    2222var is_firefox_0 = agt.indexOf('firefox/1.0') != -1 && agt.indexOf('firefox/0.') ? true : false; 
    23   
     23 
     24function optionFinderTimeout(obj) 
     25{ 
     26        clearTimeout(finderTimeout);     
     27        var oWait = document.getElementById("cal_span_searching"); 
     28        oWait.innerHTML = document.getElementById("txt_searching").value + '...'; 
     29        var finderTimeout = setTimeout("optionFinder('"+obj.id+"')",500); 
     30} 
     31function optionFinder(id) { 
     32        var oWait = document.getElementById("cal_span_searching"); 
     33        var oText = document.getElementById(id);                         
     34        var select_available_users_tmp = document.getElementById('user_list_in') 
     35        for(var i = 0;i < select_available_users_tmp.options.length; i++) 
     36                select_available_users_tmp.options[i--] = null; 
     37 
     38        var RegExp_name = new RegExp("\\b"+oText.value, "i"); 
     39 
     40        for(i = 0; i < select_available_users_clone.length; i++){ 
     41                if (RegExp_name.test(select_available_users_clone[i].text) || select_available_users_clone[i].value =="-1") 
     42                { 
     43                        sel = select_available_users_tmp.options; 
     44                        option = new Option(select_available_users_clone[i].text,select_available_users_clone[i].value); 
     45                        if( select_available_users_clone[i].value == "-1") option.disabled = true; 
     46                        sel[sel.length] = option; 
     47                } 
     48        }        
     49        oWait.innerHTML = '&nbsp;'; 
     50}        
     51         
     52/* 
     53        Semelhante a função get_avaiable_users, porém trás apenas usuários, ignorando os grupos... 
     54*/ 
     55function get_available_only_users(path,context,type) { 
     56        var handler_get_available_users2 = function(data) 
     57        {        
     58                select_available_users = document.getElementById('user_list_in'); 
     59                 
     60                for(var i=0; i<select_available_users.options.length; i++){ 
     61                        select_available_users.options[i] = null; 
     62                        i--; 
     63                } 
     64                var options = '###'; 
     65                if (data) { 
     66                         
     67                        options += '<option  value="-1" disabled>------------------- '+document.getElementById("txt_users").value+' ------------------ </option>' + data; 
     68                         
     69                        if(is_firefox_0) 
     70                                fixBugInnerSelect(select_available_users,options); 
     71                        else 
     72                                select_available_users.innerHTML = options; 
     73 
     74                        select_available_users.outerHTML = select_available_users.outerHTML; 
     75                        select_available_users.disabled = false; 
     76                        select_available_users_clone = document.getElementById('user_list_in').cloneNode(true); 
     77                        document.getElementById('cal_input_searchUser').value = ''; 
     78                } 
     79        }        
     80 
     81        document.getElementById('combo_org').value = context; 
     82        cExecute (path+'.ldap_functions.get_available_users2&valueAsUidNum=1&context='+context+'&type='+type, handler_get_available_users2);     
     83} 
     84 
    2485function get_available_users(filter,autoSearch) 
    2586//function get_available_users(path,context,type) 
     
    210271        loadScript(path+"/js/common_functions.js"); 
    211272        loadScript(path+"/js/QuickCatalogSearch.js"); 
    212         loadScript("calendar/templates/classic/js/over_fn_exmail.js"); 
     273        loadScript("calendar/templates/default/js/over_fn_exmail.js"); 
    213274        if(!contacts) 
    214275                cExecute (path+'.db_functions.get_dropdown_contacts', save_contacts); 
     
    389450        } 
    390451}; 
     452 
Note: See TracChangeset for help on using the changeset viewer.