Ignore:
Timestamp:
03/22/11 10:24:51 (13 years ago)
Author:
alexandrecorreia
Message:

Ticket #1657 - Correcao de layout para exibicao do historico do arquivo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/filemanager/js/draw_api.js

    r3885 r3886  
    2121                loadXtools(); 
    2222 
    23                 var response =  unserialize(data); 
     23                var response    =  unserialize(data); 
    2424                var _xml                = Xtools.xml('file'); 
    2525                var _historyFile        = _xml.documentElement;  
    2626 
    27                 for( var i = 0; i < response.length; i++ ) 
    28                 { 
    29                         var _info = _historyFile.appendChild(  _xml.createElement("info") ); 
    30                          
    31                         var     _created = _xml.createElement('created');  
    32                                 _created.appendChild( _xml.createTextNode(response[i]['created']) ); 
    33                                 _info.appendChild( _created ); 
    34                          
    35                         var     _version = _xml.createElement('version'); 
    36                                 _version.appendChild( _xml.createTextNode(response[i]['version']) ); 
    37                                 _info.appendChild(_version); 
    38                          
    39                         var     _who = _xml.createElement('who'); 
    40                                 _who.appendChild( _xml.createTextNode(response[i]['who']) ); 
    41                                 _info.appendChild( _who ); 
    42                          
    43                         var _operation  = _xml.createElement('operation'); 
    44                                 _operation.appendChild( _xml.createTextNode( response[i]['operation']) ); 
    45                                 _info.appendChild( _operation ); 
    46                 } 
    47  
    48                 var pArgs =  
    49                 { 
    50                         'lang_created'  : get_lang("Created"), 
    51                         'lang_operation'        : get_lang("Operation"), 
    52                         'lang_version'  : get_lang("Version"), 
    53                         'lang_who'              : get_lang("Who"), 
    54                         'lang_history'  : get_lang("File history"), 
    55                         'height'                                : 300, 
    56                         'path_filemanager'      : path_filemanager, 
    57                         'width'                         : 450                    
    58                 }; 
    59                  
    60                 var code = Xtools.parse( _historyFile, "historyFile.xsl", pArgs ); 
    61                  
    62                 draw_window( code , 450, 300 ); 
     27                if( typeof(response)  == "object" ) 
     28                {        
     29                        for( var i = 0; i < response.length; i++ ) 
     30                        { 
     31                                var _info = _historyFile.appendChild(  _xml.createElement("info") ); 
     32 
     33                                var     _created = _xml.createElement('created');  
     34                                        _created.appendChild( _xml.createTextNode(response[i]['created']) ); 
     35                                        _info.appendChild( _created ); 
     36 
     37                                var     _version = _xml.createElement('version'); 
     38                                        _version.appendChild( _xml.createTextNode(response[i]['version']) ); 
     39                                        _info.appendChild(_version); 
     40 
     41                                var     _who = _xml.createElement('who'); 
     42                                        _who.appendChild( _xml.createTextNode(response[i]['who']) ); 
     43                                        _info.appendChild( _who ); 
     44 
     45                                var _operation  = _xml.createElement('operation'); 
     46                                        _operation.appendChild( _xml.createTextNode( response[i]['operation']) ); 
     47                                        _info.appendChild( _operation ); 
     48                        } 
     49 
     50                        var pArgs =  
     51                        { 
     52                                'lang_created'  : get_lang("Created"), 
     53                                'lang_operation'        : get_lang("Operation"), 
     54                                'lang_version'  : get_lang("Version"), 
     55                                'lang_who'              : get_lang("Who"), 
     56                                'lang_history'  : get_lang("File history"), 
     57                                'height'                                : 300, 
     58                                'path_filemanager'      : path_filemanager, 
     59                                'width'                         : 450                    
     60                        }; 
     61 
     62                        var code = Xtools.parse( _historyFile, "historyFile.xsl", pArgs ); 
     63 
     64                        draw_window( code , 450, 300 ); 
     65                } 
     66                else 
     67                        alert( data ); 
    6368        }; 
    6469         
Note: See TracChangeset for help on using the changeset viewer.