symlinks fix

This commit is contained in:
Serghey Rodin 2015-11-03 18:52:38 +02:00
parent 03a6b6f34e
commit 4cf6641d0f
3 changed files with 15 additions and 6 deletions

View file

@ -111,6 +111,7 @@ ul.listing { list-style-type: none; padding: 18px 0 0; margin: -4px 0 0 -1px; b
/* .listing li .icon { background: url("/images/document.png") no-repeat scroll -2px 6px; float: left; margin-left: -17px; width: 13px; height: 24px; }*/
.listing li .icon { background: url("/images/flat_icons.png") no-repeat scroll -97px -100px; float: left; margin-left: -17px; width: 31px; height: 31px; margin-top: 1px; }
.listing li .icon.filetype-dir { background: url("/images/flat_icons.png") no-repeat scroll -24px -98px; }
.listing li .icon.filetype-link { background: url("/images/flat_icons.png") no-repeat scroll -97px -121px; }
.listing li .icon.filetype-tif,
.listing li .icon.filetype-gif,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before After
Before After

View file

@ -379,6 +379,11 @@ FM.isItemDir = function(item) {
return item.type == 'd';
}
FM.isItemLink = function(item) {
return item.type == 'l';
}
FM.getFileType = function(name) {
var filetype = name.split('.').pop().toLowerCase();
return filetype.length > 6 || name.indexOf('.') <= 0 ? '' : filetype;
@ -393,7 +398,7 @@ FM.sortItems = function(items, box) {
$.each(items, function(i, o) {
if (i > 0) { // i == 0 means first .. element in list
if (FM.isItemFile(o)) {
if (FM.isItemFile(o) || FM.isItemLink(o)) {
files.push(o);
}
else {
@ -595,7 +600,7 @@ FM.toggleSubContextMenu = function(ref) {
FM.generate_listing = function(reply, box) {
var tab = FM.getTabLetter(box);
FM.IMAGES[tab] = [];
var acc = [];
if (reply.length == 0) {
reply = [{
@ -608,7 +613,7 @@ FM.generate_listing = function(reply, box) {
date: ''
}];
}
var path_arr = FM['TAB_'+tab+'_CURRENT_PATH'].split('/');
path_arr = path_arr.filter(function(v){return v!==''});
path_arr.pop();
@ -616,7 +621,7 @@ FM.generate_listing = function(reply, box) {
if (back_path == FM.ROOT_DIR || path_arr.length < FM.ROOT_DIR.split('/').length) {
back_path = '';//FM.ROOT_DIR;
}
reply = FM.sortItems(reply, box);
$(reply).each(function(i, o) {
@ -624,7 +629,7 @@ FM.generate_listing = function(reply, box) {
var cl_act = o.type == 'd' ? 'onClick="FM.open(\'' + path + '\', \'' + box + '\')"' : 'onClick="FM.openFile(\''+path+'\', \'' + box + '\', this)"';
//var cl_act = o.type == 'd' ? 'onDblClick="FM.open(\'' + path + '\', \'' + box + '\')"' : 'onDblClick="FM.openFile(\''+path+'\', \'' + box + '\', this)"';
//var cl_act = '';
if (o.name == '') {
path = FM.formatPath(back_path);
cl_act = o.type == 'd' ? 'onClick="FM.open(\'' + path + '\', \'' + box + '\')"' : 'onClick="FM.openFile(\''+path+'\', \'' + box + '\', this)"';
@ -641,7 +646,7 @@ FM.generate_listing = function(reply, box) {
var time = o.time.split('.');
time = time[0];
var psDate = new Date(o.date);
o.full_path = path;
@ -683,6 +688,9 @@ FM.generate_listing = function(reply, box) {
if (FM.isItemDir(o)) {
tpl.set(':ITEM_TYPE', 'filetype-dir');
}
else if (FM.isItemLink(o)) {
tpl.set(':ITEM_TYPE', 'filetype-link');
}
else {
tpl.set(':ITEM_TYPE', 'filetype-' + o.filetype);
}