Changeset 2537 for trunk/phpgwapi


Ignore:
Timestamp:
04/14/10 16:46:42 (14 years ago)
Author:
amuller
Message:

Ticket #1036 - implementação do packer do js

Location:
trunk/phpgwapi
Files:
1 added
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpgwapi/inc/class.javascript.inc.php

    r2169 r2537  
    132132                                                                foreach($files as $file => $ignored) 
    133133                                                                { 
    134                                                                         $links .= '<script type="text/javascript" src="' 
    135                                                                         . $GLOBALS['phpgw_info']['server']['webserver_url'] 
    136                                                                         . "/$app/js/$pkg/$file" . '.js">' 
    137                                                                         . "</script>\n"; 
     134                                                                        if ($GLOBALS['phpgw_info']['server']['jspacker'] == "True") 
     135                                                                        { 
     136                                                                                require_once('class.JavaScriptPacker.php'); 
     137                                                                                $script = file_get_contents(PHPGW_INCLUDE_ROOT .SEP .$app .SEP .'js' .SEP . $pkg .SEP. $file . '.js'); 
     138                                                                                $packer = new JavaScriptPacker($script, 'Normal', true, false); 
     139                                                                                $packed = $packer->pack(); 
     140                                                                                $links .= "<script>".$packed."</script>\n"; 
     141                                                                        } 
     142                                                                        else 
     143                                                                        { 
     144                                                                                $links .= '<script type="text/javascript" src="' 
     145                                                                                        . $GLOBALS['phpgw_info']['server']['webserver_url'] 
     146                                                                                        . "/$app/js/$pkg/$file" . '">' 
     147                                                                                        . "</script>\n"; 
     148                                                                        } 
    138149                                                                } 
    139150                                                        } 
  • trunk/phpgwapi/js/expressoAjax/expressoAjax.js

    r2521 r2537  
    2323        { 
    2424                is_ie = false; 
    25                 is_ie5 = false 
     25                is_ie5 = false; 
    2626                is_moz1_6 = false; 
    2727                is_mozilla = false; 
     
    4949                this.expurgatedCache = new Array(); // Data to purge from cache 
    5050 
    51         } 
     51        }; 
    5252        cConnector.prototype.verify_session = function(data) { 
    5353                if(data && data.nosession){ 
     
    6565                else 
    6666                        return true; 
    67         } 
     67        }; 
    6868        cConnector.prototype.buildBar = function() 
    6969                { 
     
    105105                                } 
    106106                        } 
    107         } 
     107        }; 
    108108//------------------------------------ BEGIN: Functions for Connector HTTPRequest  -------------------------------------------------// 
    109109        // Serialize Data Method 
     
    148148                                                                showMessage(Element('cc_msg_err_serialize_data_unknown').value); 
    149149                                                                break; 
    150                                                 } 
     150                                                }; 
    151151                                        } 
    152152 
     
    177177                                        showMessage(Element('cc_msg_err_serialize_data_unknown').value); 
    178178                                        return null; 
    179                         } 
     179                        }; 
    180180 
    181181                        return str_data; 
    182                 } 
     182                }; 
    183183 
    184184                return f(data); 
    185         } 
     185        }; 
    186186 
    187187 
     
    210210 
    211211                        return nClose; 
    212                 } 
     212                }; 
    213213 
    214214                var f = function (str) 
     
    281281                                        var data = str.charAt(2) == '1' ? true : false; 
    282282                                        break; 
    283                         } 
     283                        }; 
    284284                        return data; 
    285                 } 
     285                }; 
    286286 
    287287                return f(str); 
    288         } 
     288        }; 
    289289 
    290290        //Create XMLHTTP object Method 
     
    311311                                { 
    312312                                        this.oxmlhttp = null; 
    313                                 } 
    314                         } 
    315                 } 
    316  
    317         } 
     313                                }; 
     314                        }; 
     315                }; 
     316 
     317        }; 
    318318 
    319319        // Request Constructor Connector 
     
    377377 
    378378                                                default: 
    379                                         } 
     379                                        }; 
    380380                                } 
    381381                        } 
     
    387387                                // View Exception in Javascript Console 
    388388                                throw(e); 
    389                         } 
    390  
    391                 } 
     389                        }; 
     390 
     391                }; 
    392392 
    393393                try 
     
    423423                        // View Exception in Javascript Console 
    424424                        throw(e); 
    425                 } 
     425                }; 
    426426 
    427427                return true; 
    428         } 
     428        }; 
    429429        // Cancel Request Connector 
    430430        cConnector.prototype.cancelRequest = function (){ 
     
    435435                this.requests[this.tid].abort(); 
    436436                this.hideProgressBar(); 
    437         } 
     437        }; 
    438438//------------------------------------  END: Functions for Connector HTTPRequest  -------------------------------------------------// 
    439439 
     
    444444                div.style.visibility = 'hidden'; 
    445445                this.isVisibleBar = false; 
    446         } 
     446        }; 
    447447 
    448448        cConnector.prototype.showProgressBar = function(){ 
     
    451451 
    452452                this.isVisibleBar = true; 
    453         } 
     453        }; 
    454454 
    455455        cConnector.prototype.loadAllScripts = function(scripts) { 
     
    457457                        this.loadScript(scripts[i]); 
    458458                } 
    459         } 
     459        }; 
    460460 
    461461        cConnector.prototype.loadScript = function(scriptPath)  { 
     
    483483                head.appendChild(script); 
    484484                return; 
    485         } 
     485        }; 
    486486//------------------------------------  END: Functions for Progress Bar  -------------------------------------------------// 
    487487        // Default Controller File 
     
    500500                else 
    501501                        return false; 
    502         } 
     502        }; 
    503503        cConnector.prototype.purgeCache= function(){ 
    504504                if (typeof(preferences) == "undefined" || preferences.use_cache != 'True') 
     
    513513                        catch (e) { }; 
    514514                } 
    515         } 
     515        }; 
    516516        cConnector.prototype.cacheNextRequest = function(expiration){ 
    517517                if (typeof(expiration) == 'undefined') 
    518518                        expiration=0; 
    519519                this.cacheRequest=expiration; 
    520         } 
     520        }; 
    521521 
    522522        cConnector.prototype.addToCache = function(id,data){ 
     
    544544                                break; 
    545545                } 
    546         } 
     546        }; 
    547547 
    548548        //      Function executes AJAX 
     
    573573                id = url; 
    574574                expresso.connector.newRequest(id, url, method, handler, params); 
    575         } 
     575        }; 
    576576 
    577577// This function executes submit values to Controller (POST) 
     
    621621                        handlerExecuteForm(data); 
    622622                        handlerExecuteForm = null; 
    623                 } 
     623                }; 
    624624                divUpload.innerHTML= "<iframe onload=\"cExecute('expressoMail1_2.functions.getReturnExecuteForm',"+form_handler+");\"  style='display:"+(debug_controller ? "" : "none")+";width:"+(debug_controller ? 400 : 0)+";height:"+(debug_controller ? 400 : 0)+";' name='uploadFile'></iframe>"; 
    625625                form.action = URL_SERVER + "/controller.php"; 
     
    630630                        el.parentNode.removeChild(el); 
    631631                } 
    632         } 
     632        }; 
    633633 
    634634 
     
    652652                        return false; 
    653653            } 
    654         } 
     654        }; 
    655655 
    656656function expressoAjax(){ 
    657657        this.connector = new cConnector(); 
    658658 
    659 } 
     659}; 
    660660expressoAjax.prototype.require = function (module){ 
    661661        expresso.connector.loadScript(module); 
    662 } 
     662}; 
    663663var expresso = new expressoAjax(); 
  • trunk/phpgwapi/js/wz_dragdrop/wz_dragdrop.js

    r2439 r2537  
    12891289                { 
    12901290                        var d_t0 = (new Date()).getTime(); 
    1291                         while ((new Date()).getTime()-d_t0 < 0x99); 
     1291                        while ((new Date()).getTime()-d_t0 < 0x99) { } 
    12921292                } 
    12931293                if (!(d_ai = d_a[d_i]).indexOf('c:')) dd.cursor = d_ai.substring(2); 
Note: See TracChangeset for help on using the changeset viewer.