Ignore:
Timestamp:
04/26/10 16:03:33 (14 years ago)
Author:
rodsouza
Message:

Ticket #1009 - Organizando javascript e criando cache dos mesmos.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpgwapi/js/tools/xconnector.js

    r2601 r2628  
    100100                                                                } 
    101101 
     102                                                                if ( _THREADS[ _ID ]._CACHE ) 
     103                                                                        this._CACHED[ _ID ] = _data; 
     104 
    102105                                                                delete _THREADS[ _ID ]; 
    103106 
     
    105108                                                                        try 
    106109                                                                        { 
    107                                                                                 if ( this._cache ) 
    108                                                                                 { 
    109                                                                                         this._CACHED[ _ID ] = _data; 
    110                                                                                         this._cache = false; 
    111                                                                                 } 
    112  
    113110                                                                                _request( _data ); 
    114111                                                                        } 
     
    228225                        '_MODE'         : 'TEXT', // [XML | TEXT] 
    229226                        '_TYPE'         : null, // [4 for request | 3 for stream] 
    230                         '_XHR'          : null  // [4 for request | 3 for stream] 
     227                        '_XHR'          : null, // [4 for request | 3 for stream] 
     228                        '_CACHE'        : ( ( _argv.cache && _argv.cache === true ) ? true : false ) 
    231229                }; 
    232230 
    233231                if ( _argv.mode && ( _argv.mode == 'XML' || _argv.mode == 'TEXT' ) ) 
    234                         _THREADS[ _ID ] = _argv.mode; 
     232                        _THREADS[ _ID ]._MODE = _argv.mode; 
    235233 
    236234                if ( _argv.handler ) 
     
    256254                        } 
    257255 
    258                 if ( this._cache && this._CACHED[ _ID ] ) 
    259                 { 
    260                         this._cache = false; 
     256                if ( _THREADS[ _ID ]._CACHE && this._CACHED[ _ID ] ) 
     257                { 
    261258                        if ( _THREADS[ _ID ]._HANDLER.request ) 
    262259                                _THREADS[ _ID ]._HANDLER.request( this._CACHED[ _ID ] ); 
     
    302299                this._CONTROLLER  = ''; 
    303300 
    304                 this._cache = false; 
    305  
    306301                this._CACHED = [ ]; 
    307302 
     
    333328        Connector.prototype.cache = function( ) 
    334329        { 
    335                 _cache = true; 
    336  
    337                 if ( arguments.length == 1 && arguments[ 0 ].constructor == Boolean ) 
    338                         _cache = arguments[ 0 ]; 
    339  
    340                 this._cache = _cache; 
    341  
    342330                return this; 
    343331        }; 
Note: See TracChangeset for help on using the changeset viewer.