Ignore:
Timestamp:
07/19/10 15:14:22 (14 years ago)
Author:
amuller
Message:

Ticket #1145 - Reativando o carregamento de script sob demanda

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/expressoMail1_2/js/common_functions.js

    r3064 r3068  
    505505                        { 
    506506                                connector.loadScript("QuickCatalogSearch"); 
     507                                if (typeof(QuickCatalogSearch) == 'undefined'){ 
     508                                        setTimeout('emQuickSearch("'+emailList+'", "'+field+'", "'+ID+'")',500); 
     509                                        return false; 
     510                                } 
    507511                                QuickCatalogSearch.showList(data, quickSearchKeyBegin, quickSearchKeyEnd); 
    508512                        } 
     
    510514                        { 
    511515                                connector.loadScript("QuickSearchUser"); 
     516                                if (typeof(QuickSearchUser) == 'undefined'){ 
     517                                        setTimeout('emQuickSearch("'+emailList+'", "'+field+'", "'+ID+'")',500); 
     518                                        return false; 
     519                                } 
    512520                                QuickSearchUser.showList(data); 
    513521                        } 
     
    548556function folderbox(){ 
    549557        connector.loadScript("TreeS"); 
     558        if (typeof(ttree) == 'undefined'){ 
     559                setTimeout('folderbox()',500); 
     560                return false; 
     561        } 
    550562        ttree.make_Window(); 
    551563} 
     
    554566        connector.loadScript("filter"); 
    555567        connector.loadScript("filters"); 
     568        if (typeof(filters) == 'undefined') 
     569        { 
     570                 setTimeout('filterbox()',500); 
     571                 return false; 
     572        } 
    556573        filters.Forms(); 
    557574} 
     
    566583                } 
    567584                connector.loadScript("sharemailbox"); 
     585                if (typeof(sharemailbox) == 'undefined') 
     586                { 
     587                        setTimeout('sharebox()',500); 
     588                        return false; 
     589                } 
    568590                sharemailbox.makeWindow(options); 
    569591        } 
     
    576598 
    577599function search_emails(value){ 
     600        connector.loadScript("TreeS"); 
    578601        connector.loadScript("search"); 
     602        if (typeof(EsearchE) == 'undefined' || typeof(ttree) == 'undefined'){ 
     603                setTimeout('search_emails("'+value+'")',500); 
     604                return false; 
     605        } 
    579606        EsearchE.showForms(value); 
    580607} 
     
    589616 
    590617function 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 
     635function 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} 
    622649 
    623650function Element (el) { 
Note: See TracChangeset for help on using the changeset viewer.