Changeset 3068 for branches/2.2/expressoMail1_2/js/common_functions.js
- Timestamp:
- 07/19/10 15:14:22 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/expressoMail1_2/js/common_functions.js
r3064 r3068 505 505 { 506 506 connector.loadScript("QuickCatalogSearch"); 507 if (typeof(QuickCatalogSearch) == 'undefined'){ 508 setTimeout('emQuickSearch("'+emailList+'", "'+field+'", "'+ID+'")',500); 509 return false; 510 } 507 511 QuickCatalogSearch.showList(data, quickSearchKeyBegin, quickSearchKeyEnd); 508 512 } … … 510 514 { 511 515 connector.loadScript("QuickSearchUser"); 516 if (typeof(QuickSearchUser) == 'undefined'){ 517 setTimeout('emQuickSearch("'+emailList+'", "'+field+'", "'+ID+'")',500); 518 return false; 519 } 512 520 QuickSearchUser.showList(data); 513 521 } … … 548 556 function folderbox(){ 549 557 connector.loadScript("TreeS"); 558 if (typeof(ttree) == 'undefined'){ 559 setTimeout('folderbox()',500); 560 return false; 561 } 550 562 ttree.make_Window(); 551 563 } … … 554 566 connector.loadScript("filter"); 555 567 connector.loadScript("filters"); 568 if (typeof(filters) == 'undefined') 569 { 570 setTimeout('filterbox()',500); 571 return false; 572 } 556 573 filters.Forms(); 557 574 } … … 566 583 } 567 584 connector.loadScript("sharemailbox"); 585 if (typeof(sharemailbox) == 'undefined') 586 { 587 setTimeout('sharebox()',500); 588 return false; 589 } 568 590 sharemailbox.makeWindow(options); 569 591 } … … 576 598 577 599 function search_emails(value){ 600 connector.loadScript("TreeS"); 578 601 connector.loadScript("search"); 602 if (typeof(EsearchE) == 'undefined' || typeof(ttree) == 'undefined'){ 603 setTimeout('search_emails("'+value+'")',500); 604 return false; 605 } 579 606 EsearchE.showForms(value); 580 607 } … … 589 616 590 617 function url_encode(str){ 591 var hex_chars = "0123456789ABCDEF"; 592 var noEncode = /^([a-zA-Z0-9\_\-\.])$/; 593 var n, strCode, hex1, hex2, strEncode = ""; 594 595 for(n = 0; n < str.length; n++) { 596 if (noEncode.test(str.charAt(n))) { 597 strEncode += str.charAt(n); 598 } else { 599 strCode = str.charCodeAt(n); 600 hex1 = hex_chars.charAt(Math.floor(strCode / 16)); 601 hex2 = hex_chars.charAt(strCode % 16); 602 strEncode += "%" + (hex1 + hex2); 603 } 604 } 605 return strEncode; 606 } 607 608 function url_decode(str) { 609 610 var n, strCode, strDecode = ""; 611 for (n = 0; n < str.length; n++) { 612 if (str.charAt(n) == "%") { 613 strCode = str.charAt(n + 1) + str.charAt(n + 2); 614 strDecode += String.fromCharCode(parseInt(strCode, 16)); 615 n += 2; 616 } else { 617 strDecode += str.charAt(n); 618 } 619 } 620 return strDecode; 621 } 618 var hex_chars = "0123456789ABCDEF"; 619 var noEncode = /^([a-zA-Z0-9\_\-\.])$/; 620 var n, strCode, hex1, hex2, strEncode = ""; 621 622 for(n = 0; n < str.length; n++) { 623 if (noEncode.test(str.charAt(n))) { 624 strEncode += str.charAt(n); 625 } else { 626 strCode = str.charCodeAt(n); 627 hex1 = hex_chars.charAt(Math.floor(strCode / 16)); 628 hex2 = hex_chars.charAt(strCode % 16); 629 strEncode += "%" + (hex1 + hex2); 630 } 631 } 632 return strEncode; 633 } 634 635 function url_decode(str) { 636 637 var n, strCode, strDecode = ""; 638 for (n = 0; n < str.length; n++) { 639 if (str.charAt(n) == "%") { 640 strCode = str.charAt(n + 1) + str.charAt(n + 2); 641 strDecode += String.fromCharCode(parseInt(strCode, 16)); 642 n += 2; 643 } else { 644 strDecode += str.charAt(n); 645 } 646 } 647 return strDecode; 648 } 622 649 623 650 function Element (el) {
Note: See TracChangeset
for help on using the changeset viewer.