Changeset 7625


Ignore:
Timestamp:
12/07/12 15:00:05 (7 years ago)
Author:
angelo
Message:

Ticket #3197 - Reduzir tempo de carregamento do modulo Expresso Mail - controle de suporte a minificacao e filtros

Location:
trunk/expressoMail1_2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/assetic.php

    r7585 r7625  
    55use Assetic\Asset\GlobAsset; 
    66use Assetic\Filter\Yui; 
     7use Assetic\FilterManager; 
     8use Assetic\Filter; 
    79use Assetic\Cache\FilesystemCache; 
    810 
     
    2426    } 
    2527); 
    26 $compressor = new Yui\JsCompressorFilter('../prototype/library/yuicompressor/yuicompressor.jar'); 
    27     $plugins = new AssetCache(new AssetCollection(array( 
    28                 new FileAsset('../prototype/plugins/json2/json2.js'), 
    29                 new FileAsset('../prototype/plugins/ejs/ejs.js'), 
    30                 new FileAsset('../prototype/plugins/scrollto/jquery.scrollTo.js'), 
    31                 new FileAsset('../prototype/plugins/timepicker/jquery-ui-timepicker-addon.js'), 
    32                 new FileAsset('../prototype/plugins/timepicker/localization/jquery-ui-timepicker-pt-BR.js'), 
    33                 new FileAsset('../prototype/plugins/jquery/i18n/jquery.ui.datepicker-pt-BR.js'), 
    34                 new FileAsset('../prototype/plugins/lazy/jquery.lazy.js'), 
    35                 //new FileAsset('../prototype/plugins/datejs/date-pt-BR.js'), 
    36                 new FileAsset('../prototype/plugins/datejs/sugarpak.js'), 
    37                 new FileAsset('../prototype/plugins/datejs/parser.js'), 
    38                 new FileAsset('../prototype/plugins/block/jquery.blockUI.js'), 
    39                 new FileAsset('../prototype/plugins/jq-raty/js/jquery.raty.min.js'), 
    40                 new FileAsset('../prototype/plugins/jquery.jrating/jRating.jquery.js'), 
    41                 new FileAsset('../prototype/plugins/watermark/jquery.watermarkinput.js'), 
    42                 new FileAsset('../prototype/plugins/fileupload/jquery.iframe-transport.js'), 
    43                 new FileAsset('../prototype/modules/calendar/js/desktop.notification.js'), 
    44                 new FileAsset('../prototype/plugins/qtip/jquery.qtip-1.0.0-rc3.min.js'),      
    45                 //new FileAsset('../prototype/modules/calendar/js/timezone.js'), 
    46                 new FileAsset('../prototype/plugins/dateFormat/dateFormat.js'), 
    47                 //new FileAsset('../prototype/modules/calendar/js/calendar.codecs.js'), 
    48                 //new FileAsset('../prototype/modules/calendar/js/calendar.alarms.js'), 
    49                 //new FileAsset('../prototype/modules/calendar/js/helpers.js'), 
    50                 new FileAsset('../prototype/modules/calendar/js/calendar.date.js'), 
    51                 new FileAsset('../prototype/plugins/treeview/jquery.treeview.js'), 
    52                 new FileAsset('../prototype/plugins/treeview/lib/jquery.cookie.js'),     
    53                 new FileAsset('../prototype/plugins/scrollto/jquery.scrollTo.js'), 
    54                 new FileAsset('../prototype/plugins/jqgrid/js/i18n/grid.locale-pt-br.js'), 
    55                 new FileAsset('../prototype/plugins/jqgrid/js/jquery.jqGrid.min.js'), 
    56                 new FileAsset('../prototype/modules/mail/js/foldertree.js'), 
    57                 new FileAsset('../prototype/plugins/zebradialog/javascript/zebra_dialog.js'), 
    58                 new FileAsset('../prototype/plugins/alphanumeric/jquery.alphanumeric.js'), 
    59                 new FileAsset('../prototype/plugins/freeow/jquery.freeow.js') 
    60             ), array($compressor) 
    61         ),new FilesystemCache('/tmp') 
    62     ); 
    63 echo $plugins->dump(); 
    6428 
    65     $scripts = new AssetCache(new AssetCollection(array( 
    66                 new FileAsset('js/modal/modal.js'), 
    67                 new FileAsset('js/base64.js'), 
    68                 new FileAsset('js/QuickCatalogSearch.js'), 
    69                 new FileAsset('js/common_functions.js'), 
    70                 new FileAsset('js/abas.js'), 
    71                 new FileAsset('js/draw_api.js'), 
    72                 new FileAsset('js/main.js'), 
    73                 new FileAsset('../prototype/modules/mail/js/followupflag.js'), 
    74                 new FileAsset('js/messages_controller.js'), 
    75                 new FileAsset('js/doiMenuData.js'), 
    76                 new FileAsset('js/rich_text_editor.js'), 
    77                 new FileAsset('../prototype/modules/filters/filters.js'), 
    78                 new FileAsset('../prototype/modules/mail/js/label.js'), 
    79                 new FileAsset('js/init.js') 
    80             ) 
    81         ),new FilesystemCache('/tmp') 
    82     ); 
    83 echo $scripts->dump(); 
     29$javaVersion = shell_exec("java -version 2>&1"); 
     30$filterManager = new FilterManager(); 
     31 
     32$plugins = new AssetCollection(array( 
     33        new FileAsset('../prototype/plugins/json2/json2.js'), 
     34        new FileAsset('../prototype/plugins/ejs/ejs.js'), 
     35        new FileAsset('../prototype/plugins/scrollto/jquery.scrollTo.js'), 
     36        new FileAsset('../prototype/plugins/timepicker/jquery-ui-timepicker-addon.js'), 
     37        new FileAsset('../prototype/plugins/timepicker/localization/jquery-ui-timepicker-pt-BR.js'), 
     38        new FileAsset('../prototype/plugins/jquery/i18n/jquery.ui.datepicker-pt-BR.js'), 
     39        new FileAsset('../prototype/plugins/datejs/sugarpak.js'), 
     40        new FileAsset('../prototype/plugins/datejs/parser.js'), 
     41        new FileAsset('../prototype/plugins/block/jquery.blockUI.js'), 
     42        new FileAsset('../prototype/plugins/jq-raty/js/jquery.raty.min.js'), 
     43        new FileAsset('../prototype/plugins/jquery.jrating/jRating.jquery.js'), 
     44        new FileAsset('../prototype/plugins/watermark/jquery.watermarkinput.js'), 
     45        new FileAsset('../prototype/plugins/fileupload/jquery.iframe-transport.js'), 
     46        new FileAsset('../prototype/modules/calendar/js/desktop.notification.js'), 
     47        new FileAsset('../prototype/plugins/qtip/jquery.qtip-1.0.0-rc3.min.js'),      
     48        new FileAsset('../prototype/plugins/dateFormat/dateFormat.js'), 
     49        new FileAsset('../prototype/modules/calendar/js/calendar.date.js'), 
     50        new FileAsset('../prototype/plugins/treeview/jquery.treeview.js'), 
     51        new FileAsset('../prototype/plugins/treeview/lib/jquery.cookie.js'),     
     52        new FileAsset('../prototype/plugins/scrollto/jquery.scrollTo.js'), 
     53        new FileAsset('../prototype/plugins/jqgrid/js/i18n/grid.locale-pt-br.js'), 
     54        new FileAsset('../prototype/plugins/jqgrid/js/jquery.jqGrid.min.js'), 
     55        new FileAsset('../prototype/modules/mail/js/foldertree.js'), 
     56        new FileAsset('../prototype/plugins/zebradialog/javascript/zebra_dialog.js'), 
     57        new FileAsset('../prototype/plugins/alphanumeric/jquery.alphanumeric.js'), 
     58        new FileAsset('../prototype/plugins/freeow/jquery.freeow.js') 
     59    ) 
     60); 
     61 
     62/*Se o servidor possuir a jvm então minifique os arquivos*/ 
     63if (strpos($javaVersion,"java version") !== false){ 
     64    $filterManager->set('yui_js', new Yui\JsCompressorFilter('../prototype/library/yuicompressor/yuicompressor.jar'));     
     65    $plugins->ensureFilter($filterManager->get('yui_js'));     
     66} 
     67 
     68$pluginsCache = new AssetCache($plugins,new FilesystemCache('/tmp')); 
     69echo $pluginsCache->dump(); 
     70 
     71$scripts = new AssetCollection(array( 
     72    new FileAsset('js/modal/modal.js'), 
     73    new FileAsset('js/base64.js'), 
     74    new FileAsset('js/QuickCatalogSearch.js'), 
     75    new FileAsset('js/common_functions.js'), 
     76    new FileAsset('js/abas.js'), 
     77    new FileAsset('js/draw_api.js'), 
     78    new FileAsset('js/main.js'), 
     79    new FileAsset('../prototype/modules/mail/js/followupflag.js'), 
     80    new FileAsset('js/messages_controller.js'), 
     81    new FileAsset('js/doiMenuData.js'), 
     82    new FileAsset('js/rich_text_editor.js'), 
     83    new FileAsset('../prototype/modules/filters/filters.js'), 
     84    new FileAsset('../prototype/modules/mail/js/label.js'), 
     85    new FileAsset('js/init.js') 
     86)); 
     87 
     88if (strpos($javaVersion,"java version") !== false){ 
     89    //$filterManager->set('yui_js', new Yui\JsCompressorFilter('../prototype/library/yuicompressor/yuicompressor.jar'));     
     90    //$scripts->ensureFilter($filterManager->get('yui_js'));     
     91} 
     92 
     93$scriptsCache = new AssetCache($scripts,new FilesystemCache('/tmp')); 
     94echo $scriptsCache->dump(); 
    8495?> 
  • trunk/expressoMail1_2/index.php

    r7587 r7625  
    5656                <script type="text/javascript" src="../prototype/plugins/contextmenu/jquery.contextMenu.js"></script> 
    5757                <script type="text/javascript" src="../prototype/plugins/mask/jquery.maskedinput.js"></script> 
     58                <script type="text/javascript" src="../prototype/plugins/lazy/jquery.lazy.js"></script> 
    5859                '; 
    5960 
Note: See TracChangeset for help on using the changeset viewer.