Ignore:
Timestamp:
02/15/12 10:21:28 (12 years ago)
Author:
acoutinho
Message:

Ticket #2434 - Correcoes e melhorias na visualizacao de anexos e participantes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/prototype/modules/calendar/js/helpers.js

    r5514 r5515  
     1function formatBytes(bytes) { 
     2        if (bytes >= 1000000000) { 
     3                return (bytes / 1000000000).toFixed(2) + ' GB'; 
     4        } 
     5        if (bytes >= 1000000) { 
     6                return (bytes / 1000000).toFixed(2) + ' MB'; 
     7        } 
     8        if (bytes >= 1000) { 
     9                return (bytes / 1000).toFixed(2) + ' KB'; 
     10        } 
     11        return bytes + ' B'; 
     12}; 
     13 
    114function validDateEvent(){ 
    215        var start_date = $(".new-event-win.active .start-date").val(); 
     
    241254                                checked = true; 
    242255                                $(this).parents('li').find('.button.edit').click(); 
    243                                 //$('.qtip-active .button.save .ui-button-text').html('Aplicar a todos') 
    244256                        } 
    245                          
    246                         checked = true; 
    247                         $(this).parents('li').find('.button.edit').click(); 
    248257                }).removeClass('new'); 
    249258         
     
    890899                                if(file.name.length > 10) 
    891900                                        attach.fileName = file.name.substr(0, 6) + file.name.substr(file.name.length-4, file.name.length); 
    892                                 attach.fileSize = file.size; 
     901                                attach.fileSize = formatBytes(file.size); 
    893902                                if(file.size > 30000000) 
    894903                                        attach.error = 'Tamanho de arquivo nao permitido!!' 
     
    941950                } 
    942951        }); 
    943                 $('.attachments-list .button').button(); 
    944                  
    945                  
    946                  
     952        $('.attachments-list .button').button(); 
     953                         
    947954        $('#fileupload').bind('fileuploadstart', function () { 
    948955                var widget = $(this), 
     
    972979                ('0' + date.getUTCSeconds()).slice(-2); 
    973980        }, 
    974         formatBytes = function (bytes) { 
     981       /* formatBytes = function (bytes) { 
    975982            if (bytes >= 1000000000) { 
    976983                return (bytes / 1000000000).toFixed(2) + ' GB'; 
     
    983990            } 
    984991            return bytes + ' B'; 
    985         }, 
     992        },*/ 
    986993        formatPercentage = function (floatValue) { 
    987994            return (floatValue * 100).toFixed(2) + ' %'; 
Note: See TracChangeset for help on using the changeset viewer.