]> source.dussan.org Git - nextcloud-server.git/commitdiff
fixed file size and date color calculation in JavaScript
authorJan-Christoph Borchardt <JanCBorchardt@fsfe.org>
Sat, 30 Jul 2011 13:31:11 +0000 (15:31 +0200)
committerJan-Christoph Borchardt <JanCBorchardt@fsfe.org>
Sat, 30 Jul 2011 13:31:11 +0000 (15:31 +0200)
files/css/files.css
files/js/filelist.js
files/templates/part.list.php

index 7d0471bc26b0760e4aa3a934f363077d001b3620..4aaca82f124c1471cd7433c178bc0957649b28d7 100644 (file)
@@ -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; }
index 862fb1797a6dc316556a20e3458bf3ac72460e91..359725cdc0d3de88260e976a2f8d703d91c57e53 100644 (file)
@@ -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>';
index 8f55440fe48dbc53c43e88bf360cb440fdf0f9f0..22edd9351cd43290b0c2bf332ce55cc6d9ecb262 100644 (file)
@@ -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">