diff options
author | Jan-Christoph Borchardt <JanCBorchardt@fsfe.org> | 2011-07-30 15:31:11 +0200 |
---|---|---|
committer | Jan-Christoph Borchardt <JanCBorchardt@fsfe.org> | 2011-07-30 15:31:11 +0200 |
commit | 103d45539d4db6b5c646df46acd487a05c121290 (patch) | |
tree | 57fa16d6fd648c63f8b0ff686a95f0819167d531 /files | |
parent | 9714bab6533a0c8b7be0990b77063df7037bc0a1 (diff) | |
download | nextcloud-server-103d45539d4db6b5c646df46acd487a05c121290.tar.gz nextcloud-server-103d45539d4db6b5c646df46acd487a05c121290.zip |
fixed file size and date color calculation in JavaScript
Diffstat (limited to 'files')
-rw-r--r-- | files/css/files.css | 2 | ||||
-rw-r--r-- | files/js/filelist.js | 4 | ||||
-rw-r--r-- | files/templates/part.list.php | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/files/css/files.css b/files/css/files.css index 7d0471bc26b..4aaca82f124 100644 --- a/files/css/files.css +++ b/files/css/files.css @@ -23,7 +23,7 @@ span.extention, td.date { color:#999; } div.crumb { float:left; display:block; background:no-repeat right 0; padding:8px 1.5em 0 1em; height:28px; /*36-8*/ } div.crumb:last-child { font-weight:bold; } table tr.mouseOver td { background-color:#eee; } -table th { height:2em; padding-left:.5em; color:#999; } +table th { height:2em; padding:0 .5em; color:#999; } table th .name { float:left; margin-left:.5em; } table th.multiselect { background:#ddd; color:#000; font-weight:bold; } table th, table td { border-bottom:1px solid #ddd; text-align:left; font-weight:normal; } diff --git a/files/js/filelist.js b/files/js/filelist.js index 862fb1797a6..359725cdc0d 100644 --- a/files/js/filelist.js +++ b/files/js/filelist.js @@ -23,9 +23,9 @@ FileList={ }else{ simpleSize='Pending'; } - sizeColor = Math.round(200-Math.pow((size/(1024*1024)),2)); + sizeColor = Math.round(200-size/1024*1024*2); lastModifiedTime=Math.round(lastModified.getTime() / 1000); - modifiedColor=Math.round((Math.round((new Date()).getTime() / 1000)-lastModifiedTime)/60/60/24*5); + 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="date" title="'+formatDate(lastModified)+'" style="color:rgb('+modifiedColor+','+modifiedColor+','+modifiedColor+')">'+relative_modified_date(lastModified.getTime() / 1000)+'</td>'; html+='</tr>'; diff --git a/files/templates/part.list.php b/files/templates/part.list.php index 8f55440fe48..22edd9351cd 100644 --- a/files/templates/part.list.php +++ b/files/templates/part.list.php @@ -1,10 +1,10 @@ <span id="emptyfolder" <?php if(count($_['files'])) echo 'style="display:none;"';?>>Nothing in here. Upload something!</span> <?php foreach($_['files'] as $file): $simple_file_size = simple_file_size($file['size']); - $simple_size_color = 200-intval($file['size']/(1024*1024)*2); // the bigger the file, the darker the shade of grey + $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; $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 + $relative_date_color = round((time()-$file['mtime'])/60/60/24*14); // the older the file, the brighter the shade of grey; days*14 if($relative_date_color>200) $relative_date_color = 200; ?> <tr data-file="<?php echo $file['name'];?>" data-type="<?php echo ($file['type'] == 'dir')?'dir':'file'?>" data-mime="<?php echo $file['mime']?>" data-size='<?php echo $file['size'];?>'> <td class="filename"> |