1
0
mirror of https://github.com/misterunknown/ifm.git synced 2025-08-30 10:59:49 +02:00

added image preview

This commit is contained in:
Marco Dickert
2017-02-16 15:40:24 +01:00
parent 6670fd9dad
commit 31d30b8729
3 changed files with 20 additions and 2 deletions

11
ifm.php
View File

@@ -282,6 +282,8 @@ class IFM {
a { cursor: pointer !important; }
img.imgpreview { max-width: 100%; }
div#content { width: 100%; height: 350px; }
input[name=newperms] { width: 7em; }
@@ -489,7 +491,9 @@ function IFM() {
multisel += '>';
}
if(data[i].type=="file") {
newrow += '<td>'+multisel+'<a href="'+ifm.pathCombine(ifm.currentDir,data[i].name)+'"><span class="'+data[i].icon+'"></span> '+data[i].name+'</a></td>';
newrow += '<td>'+multisel+'<a href="'+self.pathCombine(ifm.currentDir,data[i].name)+'" ';
if( data[i].icon.indexOf( 'file-image' ) !== -1 ) newrow += 'data-toggle="tooltip" title="<img src=\''+self.pathCombine(self.currentDir,data[i].name)+'\' class=\'imgpreview\'>"';
newrow += '><span class="'+data[i].icon+'"></span> '+data[i].name+'</a></td>';
} else {
newrow += '<td>'+multisel+'<a onclick="ifm.changeDirectory(\''+data[i].name+'\')"><span class="'+data[i].icon+'"></span> ';
if( data[i].name == ".." ) newrow += "[ up ]";
@@ -559,6 +563,11 @@ function IFM() {
$("input[name=multisel]").on("change", function(){ ifm.handleMultiSelect(); });
}
// todo: bootstrap-fancybox for images
$('a[data-toggle="tooltip"]').tooltip({
animated: 'fade',
placement: 'right',
html: true
});
};
this.changeDirectory = function( newdir, options={ absolute: false, pushState: true } ) {