fixed color calculation again

This commit is contained in:
Jan-Christoph Borchardt 2011-07-30 15:42:34 +02:00
parent 103d45539d
commit b2f1d26d93
2 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@ FileList={
}else{ }else{
simpleSize='Pending'; simpleSize='Pending';
} }
sizeColor = Math.round(200-size/1024*1024*2); sizeColor = Math.round(200-size/(1024*1024)*2);
lastModifiedTime=Math.round(lastModified.getTime() / 1000); lastModifiedTime=Math.round(lastModified.getTime() / 1000);
modifiedColor=Math.round((Math.round((new Date()).getTime() / 1000)-lastModifiedTime)/60/60/24*14); modifiedColor=Math.round((Math.round((new Date()).getTime() / 1000)-lastModifiedTime)/60/60/24*14);
html+='<td class="filesize" title="'+humanFileSize(size)+'" style="color:rgb('+sizeColor+','+sizeColor+','+sizeColor+')">'+simpleSize+'</td>'; html+='<td class="filesize" title="'+humanFileSize(size)+'" style="color:rgb('+sizeColor+','+sizeColor+','+sizeColor+')">'+simpleSize+'</td>';

View File

@ -1,7 +1,7 @@
<span id="emptyfolder" <?php if(count($_['files'])) echo 'style="display:none;"';?>>Nothing in here. Upload something!</span> <span id="emptyfolder" <?php if(count($_['files'])) echo 'style="display:none;"';?>>Nothing in here. Upload something!</span>
<?php foreach($_['files'] as $file): <?php foreach($_['files'] as $file):
$simple_file_size = simple_file_size($file['size']); $simple_file_size = simple_file_size($file['size']);
$simple_size_color = intval(200-$file['size']/1024*1024*2); // the bigger the file, the darker the shade of grey; megabytes*2 $simple_size_color = intval(200-$file['size']/(1024*1024)*2); // the bigger the file, the darker the shade of grey; megabytes*2
if($simple_size_color<0) $simple_size_color = 0; if($simple_size_color<0) $simple_size_color = 0;
$relative_modified_date = relative_modified_date($file['mtime']); $relative_modified_date = relative_modified_date($file['mtime']);
$relative_date_color = round((time()-$file['mtime'])/60/60/24*14); // the older the file, the brighter the shade of grey; days*14 $relative_date_color = round((time()-$file['mtime'])/60/60/24*14); // the older the file, the brighter the shade of grey; days*14