Changeset 1641 for branches/2.0/calendar/templates/classic/js
- Timestamp:
- 11/13/09 14:12:08 (15 years ago)
- Location:
- branches/2.0/calendar/templates/classic/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/calendar/templates/classic/js/edit.js
r1267 r1641 7 7 var select_in = document.getElementById('user_list'); 8 8 var select_out = document.getElementById('user_list_in'); 9 var users_out = select_out .cloneNode(true);9 var users_out = select_out ? select_out.cloneNode(true) : ''; 10 10 var finderTimeout = ''; 11 11 … … 50 50 select_in.options[i--] = null; 51 51 } 52 52 53 53 function submitValues(alert_msg){ 54 54 var typeField = document.getElementById('cal[type]'); -
branches/2.0/calendar/templates/classic/js/edit_exmail.js
r1267 r1641 21 21 var agt = navigator.userAgent.toLowerCase(); 22 22 var is_firefox_0 = agt.indexOf('firefox/1.0') != -1 && agt.indexOf('firefox/0.') ? true : false; 23 24 function get_available_users(filter,autoSearch) 25 //function get_available_users(path,context,type) 26 { 27 text= document.getElementById("cal_input_searchUser"); 28 29 var handler_get_available_users = function(data) 30 { 31 select_available_users = document.getElementById('user_list_in'); 23 24 var handler_get_available_users = function(data) 25 { 26 select_available_users = Element('user_list_in'); 27 28 for(var i=0; i<select_available_users.options.length; i++){ 29 select_available_users.options[i] = null; 30 i--; 31 } 32 var options = '###'; 33 if (data) { 34 if(data.groups && data.groups.length > 0) { 35 data.groups = '<option value="-1" disabled>------------------- '+Element("txt_groups").value+' ------------------ </option>' + data.groups; 36 } 37 if(data.users && data.users.length > 0) { 38 data.users = '<option value="-1" disabled>------------------- '+Element("txt_users").value+' ------------------ </option>' + data.users; 39 } 40 options += data.groups && data.groups.length > 0 ? data.groups : ''; 41 options += data.users && data.users.length > 0 ? data.users : ''; 32 42 33 for(var i=0; i<select_available_users.options.length; i++){ 34 select_available_users.options[i] = null; 35 i--; 36 } 37 var options = '###'; 38 if (data) { 39 if(data.groups && data.groups.length > 0) { 40 data.groups = '<option value="-1" disabled>------------------- '+document.getElementById("txt_groups").value+' ------------------ </option>' + data.groups; 41 } 42 43 if(data.users && data.users.length > 0) { 44 data.users = '<option value="-1" disabled>------------------- '+document.getElementById("txt_users").value+' ------------------ </option>' + data.users; 45 } 46 options += data.groups && data.groups.length > 0 ? data.groups : ''; 47 options += data.users && data.users.length > 0 ? data.users : ''; 48 49 if(is_firefox_0) 50 fixBugInnerSelect(select_available_users,options); 51 else 52 select_available_users.innerHTML = options; 53 54 select_available_users.outerHTML = select_available_users.outerHTML; 55 select_available_users.disabled = false; 56 select_available_users_clone = document.getElementById('user_list_in').cloneNode(true); 57 //document.getElementById('cal_input_searchUser').value = ''; 58 } 59 } 60 context = document.getElementById('combo_org').value; 61 cExecute ('expressoMail1_2'+'.ldap_functions.search_users&filter='+filter+'&context='+context+'&type=search', handler_get_available_users); 62 63 if((autoSearch == 'True') && (!text.value)){ 64 var search = " "; 65 get_available_users(search); 66 } 67 //cExecute (path+'.ldap_functions.get_available_users&context='+context+'&type='+type, handler_get_available_users); 68 } 69 70 function optionFinderTimeout(obj,numMin){ 71 var oWait = document.getElementById("cal_span_searching"); 72 clearTimeout(finderTimeout); 73 if (obj.value.length >= numMin){ 74 oWait.innerHTML = 'Buscando...'; 75 finderTimeout = setTimeout("optionFinder('"+obj.id+"','"+numMin+"')",500); 76 }else { 77 oWait.innerHTML = 'Mínimo de '+numMin+' letras para pesquisa'; 78 var select_available_users_tmp = document.getElementById('user_list_in'); 79 for(var i = 0;i < select_available_users_tmp.options.length; i++) 80 select_available_users_tmp.options[i--] = null; 81 } 82 } 83 84 function optionFinder(id,numMin){ 85 86 var oWait = document.getElementById("cal_span_searching"); 87 var oText = document.getElementById(id); 43 if(is_firefox_0) 44 fixBugInnerSelect(select_available_users,options); 45 else 46 select_available_users.innerHTML = options; 47 48 select_available_users.outerHTML = select_available_users.outerHTML; 49 select_available_users.disabled = false; 50 select_available_users_clone = Element('user_list_in').cloneNode(true); 51 } 52 } 53 54 function get_available_users(module,context,type, autoSearch){ 55 Element('cal_input_searchUser').value = ''; 56 if(autoSearch != 'True'){ 57 return true; 58 } 59 var context = document.getElementById('combo_org').value; 60 cExecute (module+'.ldap_functions.get_available_users&context='+context+'&type='+type, handler_get_available_users); 61 } 62 63 function optionFinderTimeout(obj, numMin, type, autoSearch){ 64 var oWait = Element("cal_span_searching"); 65 oWait.innerHTML = 'Buscando...'; 66 clearTimeout(finderTimeout); 67 68 if(autoSearch == "True"){ 69 finderTimeout = setTimeout("optionFinderLocal('"+obj.id+"')",500); 70 } 71 else if (obj.value.length >= numMin){ 72 finderTimeout = setTimeout("optionFinderLdap('"+obj.id+"','"+numMin+"','"+type+"')",500); 73 }else { 74 oWait.innerHTML = 'Mínimo de '+numMin+' letras para pesquisa'; 75 var select_available_users_tmp = document.getElementById('user_list_in'); 76 for(var i = 0;i < select_available_users_tmp.options.length; i++) 77 select_available_users_tmp.options[i--] = null; 78 } 79 } 80 // Pesquisa Javascript 81 function optionFinderLocal(id){ 82 var oText = Element(id); 83 var oWait = Element("cal_span_searching"); 84 var select_available_users_tmp = Element('user_list_in'); 85 for(var i = 0;i < select_available_users_tmp.options.length; i++) 86 select_available_users_tmp.options[i--] = null; 87 var RegExp_name = new RegExp("\\b"+oText.value, "i"); 88 89 for(i = 0; i < select_available_users_clone.length; i++){ 90 if (RegExp_name.test(select_available_users_clone[i].text) || select_available_users_clone[i].value =="-1") 91 { 92 sel = select_available_users_tmp.options; 93 option = new Option(select_available_users_clone[i].text,select_available_users_clone[i].value); 94 if( select_available_users_clone[i].value == "-1") option.disabled = true; 95 sel[sel.length] = option; 96 } 97 } 98 oWait.innerHTML = ' '; 99 } 100 101 // Pesquisa LDAP 102 function optionFinderLdap(id,numMin, type){ 103 var oWait = Element("cal_span_searching"); 104 var oText = Element(id); 88 105 89 106 if (oText.value.length < numMin) { … … 94 111 } 95 112 96 if (oText.value.length >= numMin) { 97 get_available_users(oText.value); 98 99 var select_available_users_tmp = document.getElementById('user_list_in'); 100 for(var i = 0;i < select_available_users_tmp.options.length; i++) 101 select_available_users_tmp.options[i--] = null; 102 var RegExp_name = new RegExp("\\b"+oText.value, "i"); 103 113 if (oText.value.length >= numMin){ 114 var context = document.getElementById('combo_org').value; 115 cExecute ('expressoMail1_2.ldap_functions.search_users&context='+(context)+'&type='+(type == '' ? 'list' : 'search')+'&filter='+oText.value, handler_get_available_users); 104 116 oWait.innerHTML = ' '; 105 117 } 106 118 } 107 function autoOptionFinder(){108 var oWait = document.getElementById("cal_span_searching");109 var oText = document.getElementById(id);110 var select_available_users_tmp = document.getElementById('user_list_in');111 for(var i = 0;i < select_available_users_tmp.options.length; i++)112 select_available_users_tmp.options[i--] = null;113 var RegExp_name = new RegExp("\\b ", "i");114 oWait.innerHTML = ' ';115 }116 119 117 120 function add_user()
Note: See TracChangeset
for help on using the changeset viewer.