Ignore:
Timestamp:
03/18/11 18:18:12 (13 years ago)
Author:
alexandrecorreia
Message:

Ticket #1648 - Correcao( codigo ) e melhoria( laytou/informacao ) no upload de arquivos para o servidor.

File:
1 edited

Legend:

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

    r3679 r3879  
    9898                         
    9999                        var pArgs = unserialize(data); 
    100                                 pArgs.lang_add_file             = get_lang("Add file"); 
    101100                                pArgs.lang_click_here   = get_lang("Click here"); 
    102101                                pArgs.lang_more_files   = get_lang("More files"); 
     
    104103                                pArgs.height                    = 210; 
    105104                                pArgs.path_filemanager  = path_filemanager; 
    106                                 pArgs.width                     = 450; 
     105                                pArgs.width                     = 500; 
    107106                 
    108107                        var _html = Xtools.parse( Xtools.xml("upload_files"), "upload.xsl", pArgs ); 
     
    233232 
    234233 
    235 function setRestricted(name){ 
     234function setRestricted(name) 
     235{ 
    236236        var continue_set = confirm(get_lang('This property will change the visibility of all users that have access to this file, continue?')); 
    237         if (continue_set) 
    238                 cExecute_('./index.php?menuaction=filemanager.vfs_functions.setRestricted&file='+base64_encode(name)+'&path='+base64_encode(currentPath),handler.restricted); 
    239 } 
    240  
    241 function presetComments(el){ 
     237         
     238        if ( continue_set ) 
     239        { 
     240                cExecute_('./index.php?menuaction=filemanager.vfs_functions.setRestricted&file=' 
     241                                + base64_encode(name)+'&path='+base64_encode(currentPath),handler.restricted); 
     242        } 
     243} 
     244 
     245function presetComments(el) 
     246{ 
    242247        if (permissions['edit'] == 0){ 
    243248                el.blur(); 
     
    247252} 
    248253 
    249 function setComments(el){ 
    250         if (el.value == oldValue) return; 
     254function setComments(el) 
     255{ 
     256        if ( el.value == oldValue ) 
     257                return; 
     258         
    251259        var filename = base64_encode(el.id); 
    252         cExecute_('./index.php?menuaction=filemanager.vfs_functions.editComment&file='+filename+'&comment='+base64_encode(el.value),handler.updateComment); 
     260         
     261        cExecute_('./index.php?menuaction=filemanager.vfs_functions.editComment&file=' 
     262                                + filename+'&comment='+base64_encode(el.value), handler.updateComment); 
    253263} 
    254264 
     
    320330                         width                  : 250, 
    321331                         height                 : 290, 
    322                          top                    : 100, 
    323                          left                   : 400, 
     332                         top                            : 100, 
     333                         left                           : 400, 
    324334                         draggable              : true, 
    325                          visible                : "display", 
     335                         visible                        : "display", 
    326336                         resizable              : true, 
    327337                         zindex                 : zIndex++, 
    328338                         title                  : "Expresso FileManager - " + get_lang('View'), 
    329                          closeAction    : "remove", 
     339                         closeAction            : "remove", 
    330340                         content                : Xtools.parse(Xtools.xml("view_config"), "view.xsl", pTools)    
    331341                }; 
     
    369379        if (size < kbyte) 
    370380        { 
    371                 return size + 'B'; 
     381                return size + ' B'; 
    372382        } 
    373383        else if (size < mbyte) 
    374384        { 
    375                 return parseInt(size/kbyte) + 'KB'; 
     385                return parseInt(size/kbyte) + ' KB'; 
    376386        } 
    377387        else if (size < gbyte) 
    378388        { 
    379389                if ( size/mbyte > 100) 
    380                         return (size/mbyte).toFixed(0) + 'MB'; 
     390                        return (size/mbyte).toFixed(0) + ' MB'; 
    381391                else 
    382                         return (size/mbyte).toFixed(1) + 'MB'; 
     392                        return (size/mbyte).toFixed(1) + ' MB'; 
    383393        } 
    384394        else 
    385395        { 
    386                 return (size/gbyte).toFixed(1) + 'GB'; 
     396                return (size/gbyte).toFixed(1) + ' GB'; 
    387397        } 
    388398} 
     
    391401{ 
    392402        var newElement = document.createElement('div'); 
    393                 newElement.innerHTML  = '<input maxlength="255" name="upload_file[]" type="file" style="margin-right:5px;" />' + 
    394                                                                 '<input name="upload_comment[]" type="text" style="margin-right:2px;" />' + 
    395                                                                 '<span style="color:red; cursor:pointer;" onclick="removeInput(this);">'+get_lang('delete')+'</span>'; 
     403                newElement.innerHTML  = '<div></div>' + 
     404                                                                        '<input maxlength="255" name="upload_file[]" type="file" style="margin-right:5px;" />' + 
     405                                                                        '<input name="upload_comment[]" type="text" style="margin-right:2px;" />' + 
     406                                                                        '<span style="color:red; cursor:pointer;" onclick="removeInput(this);">'+get_lang('delete')+'</span>'; 
    396407         
    397408        document.getElementById('uploadOption').parentNode.appendChild(newElement); 
     
    447458{ 
    448459        var _formUp                     = document.getElementById('form_up'); 
    449         var _uploadFiles        = document.getElementsByTagName('input'); 
     460        var _uploadFiles                = document.getElementsByTagName('input'); 
    450461        var _flagSend           = true; 
    451462         
     
    463474         
    464475        if( _flagSend ) 
    465         { 
    466                 cExecuteForm_( _formUp ,handler.upload); 
    467         } 
     476                cExecuteForm_( _formUp , handler.upload ); 
    468477        else 
    469478                write_msg(get_lang("No file(s) to send") + "!"); 
    470  
    471         close_window(); 
    472 } 
     479} 
Note: See TracChangeset for help on using the changeset viewer.