Skip to content
Snippets Groups Projects
Commit 40281789 authored by Robin Appelman's avatar Robin Appelman
Browse files

fix serveral styling issues on uploaded files

parent ab81128e
No related branches found
No related tags found
No related merge requests found
......@@ -5,8 +5,26 @@ FileList={
addFile:function(name,size,lastModified,loading){
var img=(loading)?'img/loading.gif':'img/file.png';
var html='<tr data-file="'+name+'" data-type="file">';
html+='<td class="filename"><input type="checkbox" /><a class="name" style="background-image:url('+img+')" href="download.php?file='+$('#dir').val()+'/'+name+'">'+name+'</a></td>';
html+='<td class="filesize">'+size+'</td>';
if(name.indexOf('.')!=-1){
var basename=name.substr(0,name.indexOf('.'));
var extention=name.substr(name.indexOf('.'));
}else{
var basename=name;
var extention=false;
}
html+='<td class="filename"><input type="checkbox" />';
html+='<a class="name" style="background-image:url('+img+')" href="download.php?file='+$('#dir').val()+'/'+name+'"><span class="nametext">'+basename
if(extention){
html+='<span class="extention">'+extention+'</span>';
}
html+='</span></a></td>';
if(size!='Pending'){
simpleSize=simpleFileSize(size);
}else{
simpleSize='Pending';
}
sizeColor = Math.round(200-Math.pow((size/(1024*1024)),2));
html+='<td class="filesize" title="'+humanFileSize(size)+'" style="color:rgb('+sizeColor+','+sizeColor+','+sizeColor+')">'+simpleSize+'</td>';
html+='<td class="date">'+lastModified+'</td>';
html+='</tr>';
FileList.insertElement(name,'file',$(html));
......
......@@ -157,7 +157,7 @@ $(document).ready(function() {
var uploadTime=formatDate(date);
for(var i=0;i<files.length;i++){
if(files[i].size>0){
var size=simpleFileSize(files[i].size);
var size=files[i].size;
}else{
var size='Pending';
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment