finally remove the file size obfuscation as it had more disadvantages. I was wrong, sorry.

This commit is contained in:
Jan-Christoph Borchardt 2013-07-18 22:15:26 +02:00
parent 279a71acb3
commit 48948ccf5f
7 changed files with 5 additions and 48 deletions

View File

@ -47,7 +47,7 @@ var FileList={
//size column //size column
if(size!=t('files', 'Pending')){ if(size!=t('files', 'Pending')){
simpleSize=simpleFileSize(size); simpleSize = humanFileSize(size);
}else{ }else{
simpleSize=t('files', 'Pending'); simpleSize=t('files', 'Pending');
} }
@ -55,7 +55,6 @@ var FileList={
var lastModifiedTime = Math.round(lastModified.getTime() / 1000); var lastModifiedTime = Math.round(lastModified.getTime() / 1000);
td = $('<td></td>').attr({ td = $('<td></td>').attr({
"class": "filesize", "class": "filesize",
"title": humanFileSize(size),
"style": 'color:rgb('+sizeColor+','+sizeColor+','+sizeColor+')' "style": 'color:rgb('+sizeColor+','+sizeColor+','+sizeColor+')'
}).text(simpleSize); }).text(simpleSize);
tr.append(td); tr.append(td);

View File

@ -756,9 +756,7 @@ function procesSelection(){
for(var i=0;i<selectedFolders.length;i++){ for(var i=0;i<selectedFolders.length;i++){
totalSize+=selectedFolders[i].size; totalSize+=selectedFolders[i].size;
}; };
simpleSize=simpleFileSize(totalSize); $('#headerSize').text(humanFileSize(totalSize));
$('#headerSize').text(simpleSize);
$('#headerSize').attr('title',humanFileSize(totalSize));
var selection=''; var selection='';
if(selectedFolders.length>0){ if(selectedFolders.length>0){
if(selectedFolders.length==1){ if(selectedFolders.length==1){

View File

@ -77,7 +77,7 @@
<?php endif; ?> <?php endif; ?>
</span> </span>
</th> </th>
<th id="headerSize"><?php p($l->t('Size (MB)')); ?></th> <th id="headerSize"><?php p($l->t('Size')); ?></th>
<th id="headerDate"> <th id="headerDate">
<span id="modified"><?php p($l->t( 'Modified' )); ?></span> <span id="modified"><?php p($l->t( 'Modified' )); ?></span>
<?php if ($_['permissions'] & OCP\PERMISSION_DELETE): ?> <?php if ($_['permissions'] & OCP\PERMISSION_DELETE): ?>

View File

@ -9,7 +9,6 @@ $totalsize = 0; ?>
} else { } else {
$totalfiles++; $totalfiles++;
} }
$simple_file_size = OCP\simple_file_size($file['size']);
// the bigger the file, the darker the shade of grey; megabytes*2 // the bigger the file, the darker the shade of grey; megabytes*2
$simple_size_color = intval(160-$file['size']/(1024*1024)*2); $simple_size_color = intval(160-$file['size']/(1024*1024)*2);
if($simple_size_color<0) $simple_size_color = 0; if($simple_size_color<0) $simple_size_color = 0;
@ -52,9 +51,8 @@ $totalsize = 0; ?>
</a> </a>
</td> </td>
<td class="filesize" <td class="filesize"
title="<?php p(OCP\human_file_size($file['size'])); ?>"
style="color:rgb(<?php p($simple_size_color.','.$simple_size_color.','.$simple_size_color) ?>)"> style="color:rgb(<?php p($simple_size_color.','.$simple_size_color.','.$simple_size_color) ?>)">
<?php print_unescaped($simple_file_size); ?> <?php print_unescaped(OCP\human_file_size($file['size'])); ?>
</td> </td>
<td class="date"> <td class="date">
<span class="modified" <span class="modified"
@ -91,7 +89,7 @@ $totalsize = 0; ?>
} ?> } ?>
</span></td> </span></td>
<td class="filesize"> <td class="filesize">
<?php print_unescaped(OCP\simple_file_size($totalsize)); ?> <?php print_unescaped(OCP\human_file_size($totalsize)); ?>
</td> </td>
<td></td> <td></td>
</tr> </tr>

View File

@ -666,8 +666,6 @@ $(document).ready(function(){
$('.selectedActions a').tipsy({gravity:'s', fade:true, live:true}); $('.selectedActions a').tipsy({gravity:'s', fade:true, live:true});
$('a.delete').tipsy({gravity: 'e', fade:true, live:true}); $('a.delete').tipsy({gravity: 'e', fade:true, live:true});
$('a.action').tipsy({gravity:'s', fade:true, live:true}); $('a.action').tipsy({gravity:'s', fade:true, live:true});
$('#headerSize').tipsy({gravity:'s', fade:true, live:true});
$('td.filesize').tipsy({gravity:'s', fade:true, live:true});
$('td .modified').tipsy({gravity:'s', fade:true, live:true}); $('td .modified').tipsy({gravity:'s', fade:true, live:true});
$('input').tipsy({gravity:'w', fade:true}); $('input').tipsy({gravity:'w', fade:true});
@ -697,14 +695,6 @@ function humanFileSize(size) {
return relativeSize + ' ' + readableFormat; return relativeSize + ' ' + readableFormat;
} }
function simpleFileSize(bytes) {
var mbytes = Math.round(bytes/(1024*1024/10))/10;
if(bytes == 0) { return '0'; }
else if(mbytes < 0.1) { return '< 0.1'; }
else if(mbytes > 1000) { return '> 1000'; }
else { return mbytes.toFixed(1); }
}
function formatDate(date){ function formatDate(date){
if(typeof date=='number'){ if(typeof date=='number'){
date=new Date(date); date=new Date(date);

View File

@ -76,16 +76,6 @@ function relative_modified_date($timestamp) {
} }
/**
* @brief Return a human readable outout for a file size.
* @param $byte size of a file in byte
* @returns human readable interpretation of a file size
*/
function simple_file_size($bytes) {
return(\simple_file_size($bytes));
}
/** /**
* @brief Generate html code for an options block. * @brief Generate html code for an options block.
* @param $options the options * @param $options the options

View File

@ -84,24 +84,6 @@ function human_file_size( $bytes ) {
return OC_Helper::humanFileSize( $bytes ); return OC_Helper::humanFileSize( $bytes );
} }
function simple_file_size($bytes) {
if ($bytes < 0) {
return '?';
}
$mbytes = round($bytes / (1024 * 1024), 1);
if ($bytes == 0) {
return '0';
}
if ($mbytes < 0.1) {
return '&lt; 0.1';
}
if ($mbytes > 1000) {
return '&gt; 1000';
} else {
return number_format($mbytes, 1);
}
}
function relative_modified_date($timestamp) { function relative_modified_date($timestamp) {
$l=OC_L10N::get('lib'); $l=OC_L10N::get('lib');
$timediff = time() - $timestamp; $timediff = time() - $timestamp;