Changeset 3068


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

Ticket #1145 - Reativando o carregamento de script sob demanda

Location:
branches/2.2/expressoMail1_2
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/expressoMail1_2/index.php

    r3053 r3068  
    168168        if ($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_local_messages'])  
    169169                echo "<script src='js/gears_init.js'></script>"; 
    170         echo $obj -> getFilesJs("js/abas.js," . 
    171                                                         "js/doiMenuData.js," . 
     170        echo '<script src="../phpgwapi/js/dftree/dftree.js"></script>'; 
     171        echo $obj -> getFilesJs(                        "js/abas.js," . 
     172                                                        "js/main.js," . 
    172173                                                        "js/drag_area.js," . 
    173174                                                        "js/draw_api.js," . 
    174175                                                        "js/DropDownContacts.js," . 
    175                                                         "js/InfoContact.js," . 
    176                                                         "js/main.js," . 
    177                                                         "js/local_messages.js," . 
    178                                                         "js/messages_controller.js," . 
    179                                                         "js/rich_text_editor.js," . 
    180 //                                                      "js/mail_sync.js," . 
    181                                                         "js/wfolders.js,", 
     176                                                        "js/doiMenuData.js," . 
     177                                                        "js/connector.js," . 
    182178                                                        $GLOBALS['phpgw_info']['flags']['update_version']); 
     179        echo '<script type="text/javascript">init();</script>'; 
    183180 
    184181        if ($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_shortcuts']) 
     
    199196</body> 
    200197</html> 
    201 <script src="js/connector.js?<?=$update_version?>" type="text/javascript"></script> 
    202 <script src="../phpgwapi/js/dftree/dftree.js?<?=$update_version?>" type="text/javascript"></script> 
    203 <script language="Javascript">connector.updateVersion = "<?=$update_version?>";init();</script> 
     198<script type="text/javascript">connector.updateVersion = "<?=$update_version?>";</script> 
    204199<!-----Expresso Mail - Version Updated:<?=$update_version?>--------> 
  • branches/2.2/expressoMail1_2/js/abas.js

    r3018 r3068  
    6767                        if(ID){ 
    6868                                connector.loadScript("rich_text_editor"); 
     69                                if(typeof(RichTextEditor) == 'undefined'){ 
     70                                        setTimeout('alernate_border(\''+ID+'\');',500); 
     71                                        return false; 
     72                                } 
    6973                                RichTextEditor.loadEditor(ID); 
    7074                        } 
  • 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) { 
  • branches/2.2/expressoMail1_2/js/connector.js

    r3018 r3068  
    451451 
    452452        cConnector.prototype.loadAllScripts = function(scripts) {        
    453                 for(var i = 0; i < scripts.length; i++){ 
    454                         this.loadScript(scripts[i]); 
     453        for(var i = 0; i < scripts.length; i++){ 
     454                this.loadScript(scripts[i]); 
    455455                } 
    456456        } 
     
    464464                script.id = 'uploadscript_'+scriptPath; 
    465465                script.type = 'text/javascript'; 
    466                  
    467466                if(is_ie) { 
    468                  
    469467                        this.oxmlhttp.open("GET", "js/"+scriptPath+".js?"+this.updateVersion, false); 
    470             this.oxmlhttp.setRequestHeader('Content-Type','text/plain'); 
     468                        this.oxmlhttp.setRequestHeader('Content-Type','text/plain'); 
    471469                        this.oxmlhttp.send(null); 
    472470                        if(this.oxmlhttp.status != 0 && this.oxmlhttp.status != 200 ||  this.oxmlhttp.status == 0 && this.oxmlhttp.responseText.length == 0) 
    473471                                throw new Error("Error " + this.oxmlhttp.status + "("+this.oxmlhttp.statusText+") when loading script file '"+scriptPath+"'"); 
    474                         script.text = this.oxmlhttp.responseText;                                
     472                        script.text = this.oxmlhttp.responseText; 
    475473                } 
    476474                else { 
     
    479477 
    480478                head.appendChild(script); 
    481                 return;  
     479                return; 
    482480        } 
    483481//------------------------------------  END: Functions for Progress Bar  -------------------------------------------------// 
  • branches/2.2/expressoMail1_2/js/draw_api.js

    r3064 r3068  
    778778                Element('msg_number').value = ''; 
    779779        } 
    780  
    781         if(!is_ie) { 
    782                 var scripts = new Array("ccQuickAdd", 
    783                                         "color_palette", 
    784                                         "filter", 
    785                                         "filters", 
    786                                         "html2xhtml", 
    787                                         "preferences", 
    788                                         "QuickCatalogSearch", 
    789                                         "QuickSearchUser", 
    790                                         "rich_text_editor", 
    791                                         "sharemailbox", 
    792                                         "search", 
    793                                         "TreeS", 
    794                                         "TreeShow"); 
    795  
    796                 connector.loadAllScripts(scripts); 
    797         } 
     780        var scripts = new Array("InfoContact", 
     781                                "messages_controller", 
     782                                "local_messages"); 
     783        connector.loadAllScripts(scripts); 
    798784} 
    799785 
     
    20242010} 
    20252011function draw_new_message(border_ID){ 
     2012        connector.loadScript("rich_text_editor"); 
     2013        connector.loadScript("color_palette"); 
     2014        if(typeof(RichTextEditor) == 'undefined' || typeof(ColorPalette) == 'undefined'){ 
     2015                setTimeout('draw_new_message(\''+border_ID+'\');',500); 
     2016                return false; 
     2017        } 
     2018 
    20262019        var ID = create_border("",border_ID); 
    20272020        if (ID == false) 
     
    25712564        table_message.appendChild(tbody_message); 
    25722565        form.appendChild(table_message); 
    2573         connector.loadScript("rich_text_editor"); 
    25742566        RichTextEditor.loadEditor(ID); 
    25752567////////////////////////////////////////////////////////////////////////////////////////////////////// 
  • branches/2.2/expressoMail1_2/js/mail_sync.js

    r1969 r3068  
    1111         */ 
    1212        function mail_sync() { 
     13                if (typeof(google) == 'undefined') 
     14                        return false; 
    1315//              this.dbGears = null; 
    1416//              this.localServer = null; 
Note: See TracChangeset for help on using the changeset viewer.