//size column
if(size!=t('files', 'Pending')){
- simpleSize=simpleFileSize(size);
+ simpleSize = humanFileSize(size);
}else{
simpleSize=t('files', 'Pending');
}
var lastModifiedTime = Math.round(lastModified.getTime() / 1000);
td = $('<td></td>').attr({
"class": "filesize",
- "title": humanFileSize(size),
"style": 'color:rgb('+sizeColor+','+sizeColor+','+sizeColor+')'
}).text(simpleSize);
tr.append(td);
for(var i=0;i<selectedFolders.length;i++){
totalSize+=selectedFolders[i].size;
};
- simpleSize=simpleFileSize(totalSize);
- $('#headerSize').text(simpleSize);
- $('#headerSize').attr('title',humanFileSize(totalSize));
+ $('#headerSize').text(humanFileSize(totalSize));
var selection='';
if(selectedFolders.length>0){
if(selectedFolders.length==1){
<?php endif; ?>
</span>
</th>
- <th id="headerSize"><?php p($l->t('Size (MB)')); ?></th>
+ <th id="headerSize"><?php p($l->t('Size')); ?></th>
<th id="headerDate">
<span id="modified"><?php p($l->t( 'Modified' )); ?></span>
<?php if ($_['permissions'] & OCP\PERMISSION_DELETE): ?>
} else {
$totalfiles++;
}
- $simple_file_size = OCP\simple_file_size($file['size']);
// the bigger the file, the darker the shade of grey; megabytes*2
$simple_size_color = intval(160-$file['size']/(1024*1024)*2);
if($simple_size_color<0) $simple_size_color = 0;
</a>
</td>
<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) ?>)">
- <?php print_unescaped($simple_file_size); ?>
+ <?php print_unescaped(OCP\human_file_size($file['size'])); ?>
</td>
<td class="date">
<span class="modified"
} ?>
</span></td>
<td class="filesize">
- <?php print_unescaped(OCP\simple_file_size($totalsize)); ?>
+ <?php print_unescaped(OCP\human_file_size($totalsize)); ?>
</td>
<td></td>
</tr>
$('.selectedActions a').tipsy({gravity:'s', fade:true, live:true});
$('a.delete').tipsy({gravity: 'e', 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});
$('input').tipsy({gravity:'w', fade:true});
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){
if(typeof date=='number'){
date=new Date(date);
}
-/**
- * @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.
* @param $options the options
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 '< 0.1';
- }
- if ($mbytes > 1000) {
- return '> 1000';
- } else {
- return number_format($mbytes, 1);
- }
-}
-
function relative_modified_date($timestamp) {
$l=OC_L10N::get('lib');
$timediff = time() - $timestamp;