summaryrefslogtreecommitdiffstats
path: root/files
diff options
context:
space:
mode:
Diffstat (limited to 'files')
-rw-r--r--files/css/files.css14
-rw-r--r--files/js/filelist.js2
-rw-r--r--files/js/files.js16
-rw-r--r--files/templates/index.php4
-rw-r--r--files/templates/part.list.php16
5 files changed, 29 insertions, 23 deletions
diff --git a/files/css/files.css b/files/css/files.css
index 702ddefc19c..9e0361327db 100644
--- a/files/css/files.css
+++ b/files/css/files.css
@@ -35,12 +35,12 @@
}
#file_upload_filename {
- background-image:url(../../img/mimetypes/file.png);
+ background-image:url(../img/file.png); font-weight:bold;
}
#file_upload_start {opacity:0;filter: alpha(opacity = 0);}
#file_newfolder_name {
- background-image:url(../../img/places/folder.png); font-weight: bold;
+ background-image:url(../img/folder.png); font-weight:bold;
width: 14em;
}
@@ -65,11 +65,6 @@
width: 3em;
}
-form input[type="button"], form input[type="text"]{
- /* this is a dirty wurgaround, Jan needs to fix it in global css*/
- font-size: 0.9em;
-}
-
#file_upload_target {
display: none;
}
@@ -80,6 +75,9 @@ table {
width: 90%;
}
+tbody tr:hover, tbody tr:active { background-color:#eee; }
+tbody a { color:#000; }
+
table td.filesize, table td.date
{
width: 5em;
@@ -111,4 +109,4 @@ table td.filename a
display: -moz-inline-box; /* fallback for older firefox versions*/
display: inline-block;
background-image:url('../img/drop-arrow.png');
-} \ No newline at end of file
+}
diff --git a/files/js/filelist.js b/files/js/filelist.js
index 089a34581de..2d00c642333 100644
--- a/files/js/filelist.js
+++ b/files/js/filelist.js
@@ -15,7 +15,7 @@ FileList={
addDir:function(name,size,lastModified){
var html='<tr data-file="'+name+'" data-type="dir">';
html+='<td class="selection"><input type="checkbox" /></td>';
- html+='<td class="filename"><a style="background-image:url(img/folder.png)" href="index.php?dir='+$('#dir').val()+'/'+name+'">'+name+'</a></td>';
+ html+='<td class="filename"><a style="background-image:url(img/folder.png)" href="index.php?dir='+$('#dir').val()+'/'+name+'"><strong>'+name+'</strong></a></td>';
html+='<td class="filesize">'+size+'</td>';
html+='<td class="date">'+lastModified+'</td>';
html+='<td class="fileaction"><a href="" title="+" class="dropArrow"></a></td>';
diff --git a/files/js/files.js b/files/js/files.js
index 45931b9bae3..2434fceff43 100644
--- a/files/js/files.js
+++ b/files/js/files.js
@@ -1,8 +1,6 @@
$(document).ready(function() {
$('#file_action_panel').attr('activeAction', false);
- $('#file_newfolder_name').css('width', '14em');
- $('#file_newfolder_submit').css('width', '3em');
-
+
// Sets browser table behaviour :
$('.browser tr').hover(
function() {
@@ -130,7 +128,7 @@ $(document).ready(function() {
$('#file_upload_submit').click(function(){
var name=$('#file_upload_filename').val();
if($('#file_upload_start')[0].files[0] && $('#file_upload_start')[0].files[0].size>0){
- var size=humanFileSize($('#file_upload_start')[0].files[0].size);
+ var size=simpleFileSize($('#file_upload_start')[0].files[0].size);
}else{
var size='Pending';
}
@@ -207,8 +205,16 @@ function humanFileSize(bytes){
return bytes+' GB';
}
+function simpleFileSize(bytes) {
+ mbytes = Math.round(bytes/(1024*1024),1);
+ 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){
var monthNames = [ "January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December" ];
return monthNames[date.getMonth()]+' '+date.getDate()+', '+date.getFullYear()+', '+((date.getHours()<10)?'0':'')+date.getHours()+':'+date.getMinutes();
-} \ No newline at end of file
+}
diff --git a/files/templates/index.php b/files/templates/index.php
index 6eaa380506d..b9f8c02c93b 100644
--- a/files/templates/index.php
+++ b/files/templates/index.php
@@ -5,7 +5,7 @@
<input type="hidden" class="max_human_file_size" value="(max <?php echo $_["uploadMaxHumanFilesize"]; ?>)">
<input type="hidden" name="dir" value="<?php echo $_["dir"] ?>" id="dir">
<div id='file_upload_wrapper'>
- <input class="prettybutton" id='file_upload_filename' value="Upload (max <?php echo $_["uploadMaxHumanFilesize"];?>)"/>
+ <input class="prettybutton" id='file_upload_filename' value="Upload (max. <?php echo $_["uploadMaxHumanFilesize"];?>)"/>
<input class="prettybutton" type="file" id="file_upload_start" name='file'/>
</div>&nbsp;
<input class="prettybutton" type="button" id="file_upload_submit" name="file_upload_submit" value="OK" />
@@ -32,7 +32,7 @@
<tr>
<th><input type="checkbox" id="select_all" /></th>
<th><?php echo $l->t( 'Name' ); ?></th>
- <th><?php echo $l->t( 'Size' ); ?></th>
+ <th><?php echo $l->t( 'Size (MB)' ); ?></th>
<th><?php echo $l->t( 'Modified' ); ?></th>
<th></th>
</tr>
diff --git a/files/templates/part.list.php b/files/templates/part.list.php
index 16d9d92c040..c7028c3c88c 100644
--- a/files/templates/part.list.php
+++ b/files/templates/part.list.php
@@ -1,9 +1,11 @@
- <?php foreach($_["files"] as $file): ?>
- <tr data-file='<?php echo $file['name'];?>' data-type='<?php echo ($file["type"] == "dir")?'dir':'file'?>' data-mime='<?php echo $file["mime"]?>'>
+ <?php foreach($_['files'] as $file):
+ $simple_file_size = simple_file_size($file['size']);
+ $simple_size_color = 200-intval(pow($simple_file_size,3)); ?>
+ <tr data-file="<?php echo $file['name'];?>" data-type="<?php echo ($file['type'] == 'dir')?'dir':'file'?>" data-mime="<?php echo $file['mime']?>">
<td class="selection"><input type="checkbox" /></td>
- <td class="filename"><a style="background-image:url(<?php if($file["type"] == "dir") echo mimetype_icon("dir"); else echo mimetype_icon($file["mime"]); ?>)" href="<?php if($file["type"] == "dir") echo link_to("files", "index.php?dir=".$file["directory"]."/".$file["name"]); else echo link_to("files", "download.php?file=".$file["directory"]."/".$file["name"]); ?>" title=""><?php echo htmlspecialchars($file["name"]); ?></a></td>
- <td class="filesize"><?php echo human_file_size($file["size"]); ?></td>
- <td class="date"><?php echo $file["date"]; ?></td>
- <td class="fileaction"><a href="" title="+" class='dropArrow'></a></td>
+ <td class="filename"><a style="background-image:url(<?php if($file['type'] == 'dir') echo mimetype_icon('dir'); else echo mimetype_icon($file['mime']); ?>)" href="<?php if($file['type'] == 'dir') echo link_to('files', 'index.php?dir='.$file['directory'].'/'.$file['name']); else echo link_to('files', 'download.php?file='.$file['directory'].'/'.$file['name']); ?>" title=""><?php if($file['type'] == 'dir') echo "<strong>"; echo htmlspecialchars($file['name']); if($file['type'] == 'dir') echo "</strong>"; ?></a></td>
+ <td class="filesize" title="<?php echo human_file_size($file['size']); ?>" style="color:rgb(<?php echo $simple_size_color.','.$simple_size_color.','.$simple_size_color ?>)"><?php echo $simple_file_size; ?></td>
+ <td class="date"><?php echo $file['date']; ?></td>
+ <td class="fileaction"><a href="" title="+" class="dropArrow"></a></td>
</tr>
- <?php endforeach; ?> \ No newline at end of file
+ <?php endforeach; ?>