Changeset 4614 for branches/2.2/expressoMail1_2/js
- Timestamp:
- 06/15/11 16:48:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/expressoMail1_2/js/sharemailbox.js
r4610 r4614 4 4 this.el; 5 5 this.alert = false; 6 } 7 8 cShareMailbox.prototype.get_available_users = function(context) 9 { 10 var handler_get_available_users = function(data) 11 { 12 select_available_users = document.getElementById('em_select_available_users'); 13 14 //Limpa o select 15 for(var i=0; i<select_available_users.options.length; i++) 16 { 17 select_available_users.options[i] = null; 18 i--; 19 } 20 21 if ((data) && (data.length > 0)) 22 { 23 // Necessario, pois o IE6 tem um bug que retira o primeiro options se o innerHTML estiver vazio. 24 select_available_users.innerHTML = '#' + data; 25 select_available_users.outerHTML = select_available_users.outerHTML; 26 27 select_available_users.disabled = false; 28 select_available_users_clone = document.getElementById('em_select_available_users').cloneNode(true); 29 document.getElementById('em_input_searchUser').value = ''; 30 } 31 } 32 cExecute ("$this.ldap_functions.get_available_users2&context="+context, handler_get_available_users); 6 this.context = ""; 7 } 8 9 cShareMailbox.prototype.get_available_users = function(context) 10 { 11 if( sharedFolders_users_auto_search.toString() === "true" ) 12 { 13 this.get_available_users2(context); 14 } 15 } 16 17 cShareMailbox.prototype.get_available_users2 = function() 18 { 19 var context = ""; 20 var cn = ""; 21 22 var handler_get_available_users = function(data) 23 { 24 select_available_users = document.getElementById('em_select_available_users'); 25 26 //Limpa o select 27 for(var i=0; i<select_available_users.options.length; i++) 28 { 29 select_available_users.options[i] = null; 30 i--; 31 } 32 33 if ((data) && (data.length > 0)) 34 { 35 // Necessario, pois o IE6 tem um bug que retira o primeiro options se o innerHTML estiver vazio. 36 select_available_users.innerHTML = '#' + data; 37 select_available_users.outerHTML = select_available_users.outerHTML; 38 39 select_available_users.disabled = false; 40 select_available_users_clone = document.getElementById('em_select_available_users').cloneNode(true); 41 document.getElementById('em_input_searchUser').value = ''; 42 } 43 } 44 45 if( arguments.length > 1 ) 46 { 47 context = arguments[0]; 48 cn = arguments[1]; 49 cExecute ("$this.ldap_functions.get_available_users2&context="+context+"&cn="+cn, handler_get_available_users); 50 } 51 else 52 { 53 context = arguments[0]; 54 cExecute ("$this.ldap_functions.get_available_users2&context="+context, handler_get_available_users); 55 } 56 33 57 } 34 58 … … 166 190 '<br/><br/>'+ 167 191 '<label>'+get_lang('Search user')+'<span style="margin-left:10px; color:red;" id="em_span_searching"> </span><br></label>'+ 168 '<input id="em_input_searchUser" size="30" autocomplete="off" onkeyup="javascript:sharemailbox.optionFinderTimeout(this )">'+192 '<input id="em_input_searchUser" size="30" autocomplete="off" onkeyup="javascript:sharemailbox.optionFinderTimeout(this, event)">'+ 169 193 '<div style="margin-top:17px;"><label>'+get_lang('Users')+':</label></div>'+ 170 194 '<select id="em_select_available_users" style="width:250px; height:150px" multiple></select></td>'+ … … 197 221 } 198 222 199 var handler_organizations = function(data){ 223 var handler_organizations = function(data) 224 { 200 225 var user_organization = Element('user_organization').value; 201 226 202 for(i = 0; i < data.length; i++) { 227 for(i = 0; i < data.length; i++) 228 { 203 229 Element('em_combo_org').options[i] = new Option(data[i].ou,data[i].dn); 204 230 if(data[i].ou.indexOf("dc=") != -1 || user_organization.toUpperCase() == data[i].ou.toUpperCase()) … … 299 325 300 326 var finderTimeout = ''; 301 cShareMailbox.prototype.optionFinderTimeout = function(obj) 302 { 303 clearTimeout(finderTimeout); 304 var oWait = document.getElementById("em_span_searching"); 305 oWait.innerHTML = get_lang('Searching')+"..."; 306 var finderTimeout = setTimeout("sharemailbox.optionFinder('"+obj.id+"')",500); 327 328 cShareMailbox.prototype.optionFinderTimeout = function(Obj, Event ) 329 { 330 var minNumChar = sharedFolders_min_num_characters; 331 var oWait = document.getElementById("em_span_searching"); 332 this.context = document.getElementById('em_combo_org').value; 333 334 if( ( parseInt(minNumChar) > 0 && minNumChar.toString() != "" ) && 335 sharedFolders_users_auto_search.toString() === "false" ) 336 { 337 var key = [8,27,37,38,39,40]; 338 var ev = Event; 339 var _inputSearch = Obj; 340 341 var cleanLabel = function(obj) 342 { 343 obj.innerHTML = ""; 344 } 345 346 var getUsers = function( _input, obj ) 347 { 348 var context = sharemailbox.context; 349 var cn = _input.value; 350 351 finderTimeout = setTimeout(function() 352 { 353 sharemailbox.get_available_users2( context, cn ); 354 }, 500); 355 356 cleanLabel(obj); 357 } 358 359 for( var i in key ) 360 { 361 if( ev.keyCode == key[i]) 362 { 363 return false; 364 } 365 } 366 367 if( _inputSearch.value.length < parseInt(minNumChar) ) 368 { 369 oWait.innerHTML = " ( Digite mais " + ( parseInt(minNumChar) - _inputSearch.value.length ) + " )"; 370 setTimeout(function(){cleanLabel(oWait);}, 2000); 371 } 372 else 373 { 374 oWait.innerHTML = " ( Buscando aguarde .... )"; 375 376 if( finderTimeout ) 377 clearTimeout(finderTimeout); 378 379 finderTimeout = setTimeout(function(){ getUsers( _inputSearch, oWait); }, 1000); 380 } 381 } 382 else 383 { 384 clearTimeout(finderTimeout); 385 oWait.innerHTML = get_lang('Searching')+"..."; 386 var finderTimeout = setTimeout("sharemailbox.optionFinder('"+Obj.id+"')",500); 387 } 307 388 } 308 389 … … 331 412 } 332 413 } 333 oWait.innerHTML = ' '; 414 415 oWait.innerHTML = ''; 334 416 } 335 417
Note: See TracChangeset
for help on using the changeset viewer.