';
+ var form = '
';
self.showModal( form );
};
this.multiDelete = function() {
- var elements = $('#filetable tr.active');
+ var elements = $('#filetable tr.selectedItem');
var filenames = [];
for(var i=0;typeof(elements[i])!='undefined';filenames.push(elements[i++].getAttribute('data-filename')));
$.ajax({
@@ -627,27 +620,32 @@ function IFM() {
this.task_update = function(progress, id) {
$('#'+id+' .progress-bar').css('width', progress+'%').attr('aria-valuenow', progress);
};
- this.selectItem = function( direction ) {
- var highlightedItem = $('.highlightedItem');
- if( ! highlightedItem.length ) {
- $('#filetable tbody tr:first-child').addClass( 'highlightedItem' );
- } else {
- var newItem = ( direction=="next" ? highlightedItem.next() : highlightedItem.prev() );
+ this.highlightItem = function( param ) {
+ if( param.jquery ) {
+ param.addClass( 'highlightedItem' ).siblings().removeClass( 'highlightedItem' );
+ } else {
+ var highlightedItem = $('.highlightedItem');
+ if( ! highlightedItem.length ) {
+ $('#filetable tbody tr:first-child').addClass( 'highlightedItem' );
+ } else {
+ var newItem = ( param=="next" ? highlightedItem.next() : highlightedItem.prev() );
- if( newItem.is( 'tr' ) ) {
- highlightedItem.removeClass( 'highlightedItem' );
- newItem.addClass( 'highlightedItem' );
- newItem.find( 'a' ).first().focus();
- if( ! this.isElementInViewport( newItem ) ) {
- var scrollOffset = ( direction=="next" ? ( highlightedItem.offset().top - 15 ) : ( highlightedItem.offset().top - ( window.innerHeight || document.documentElement.clientHeight ) + highlightedItem.height() + 15 ) );
- $('html, body').animate({
- scrollTop: scrollOffset
- }, 500
- );
+ if( newItem.is( 'tr' ) ) {
+ highlightedItem.removeClass( 'highlightedItem' );
+ newItem.addClass( 'highlightedItem' );
+ newItem.find( 'a' ).first().focus();
+ if( ! this.isElementInViewport( newItem ) ) {
+ var scrollOffset = 0;
+ if( param=="next" )
+ scrollOffset = highlightedItem.offset().top - 15;
+ else
+ scrollOffset = highlightedItem.offset().top - ( window.innerHeight || document.documentElement.clientHeight ) + highlightedItem.height() + 15;
+ $('html, body').animate( { scrollTop: scrollOffset }, 500 );
+ }
}
}
}
- }
+ };
this.isElementInViewport = function isElementInViewport (el) {
if (typeof jQuery === "function" && el instanceof jQuery) {
el = el[0];
@@ -685,7 +683,7 @@ function IFM() {
switch( e.key ) {
case 'Delete':
- if( $('#filetable tr.active').length > 0 ) {
+ if( $('#filetable tr.selectedItem').length > 0 ) {
e.preventDefault();
self.multiDeleteDialog();
} else {
@@ -734,11 +732,11 @@ function IFM() {
break;
case 'ArrowDown':
e.preventDefault();
- self.selectItem('next');
+ self.highlightItem('next');
break;
case 'ArrowUp':
e.preventDefault();
- self.selectItem('prev');
+ self.highlightItem('prev');
break;
case 'Escape':
if( $(':focus').is( '.clickable-row td:first-child a:first-child' ) && $('.highlightedItem').length ) {
@@ -750,7 +748,8 @@ function IFM() {
if( $(':focus').is( '.clickable-row td:first-child a:first-child' ) ) {
e.preventDefault();
var item = $('.highlightedItem');
- if( item.is( 'tr' ) ) item.toggleClass( 'active' );
+ if( item.is( 'tr' ) )
+ item.toggleClass( 'selectedItem' );
}
break;
}
diff --git a/src/main.php b/src/main.php
index f881499..eee05b7 100644
--- a/src/main.php
+++ b/src/main.php
@@ -10,6 +10,9 @@
* main
*/
+error_reporting( E_ALL );
+ini_set( 'display_errors', ON );
+
class IFM {
const VERSION = '2.3.1';
@@ -92,7 +95,7 @@ class IFM {
if( IFMConfig::download == 1 ) print '
| ';
if( IFMConfig::showlastmodified == 1 ) print '
last modified | ';
if( IFMConfig::showfilesize == 1 ) print '
size | ';
- if( IFMConfig::showrights > 0 ) print '
permissions | ';
+ if( IFMConfig::showpermissions > 0 ) print '
permissions | ';
if( IFMConfig::showowner == 1 && function_exists( "posix_getpwuid" ) ) print '
owner | ';
if( IFMConfig::showgroup == 1 && function_exists( "posix_getgrgid" ) ) print '
group | ';
if( in_array( 1, array( IFMConfig::edit, IFMConfig::rename, IFMConfig::delete, IFMConfig::zipnload, IFMConfig::extract ) ) ) print '
| ';
@@ -211,11 +214,11 @@ class IFM {
elseif($item["filesize"]>1024)$item["filesize"] = round( ( $item["filesize"]/1024 ), 2 ) . " KB";
else $item["filesize"] = $item["filesize"] . " Byte";
}
- if( IFMConfig::showrights > 0 ) {
- if( IFMConfig::showrights == 1 ) $item["fileperms"] = substr( decoct( fileperms( $result ) ), -3 );
- elseif( IFMConfig::showrights == 2 ) $item["fileperms"] = $this->filePermsDecode( fileperms( $result ) );
+ if( IFMConfig::showpermissions > 0 ) {
+ if( IFMConfig::showpermissions == 1 ) $item["fileperms"] = substr( decoct( fileperms( $result ) ), -3 );
+ elseif( IFMConfig::showpermissions == 2 ) $item["fileperms"] = $this->filePermsDecode( fileperms( $result ) );
if( $item["fileperms"] == "" ) $item["fileperms"] = " ";
- $item["filepermmode"] = ( IFMConfig::showrights == 1 ) ? "short" : "long";
+ $item["filepermmode"] = ( IFMConfig::showpermissions == 1 ) ? "short" : "long";
}
if( IFMConfig::showowner == 1 ) {
if ( function_exists( "posix_getpwuid" ) && fileowner($result) !== false ) {
diff --git a/src/style.css b/src/style.css
index 3631102..e21c05b 100644
--- a/src/style.css
+++ b/src/style.css
@@ -26,11 +26,10 @@ div#content { width: 100%; height: 350px; }
input[name=newperms] { width: 7em; }
#filetable tr th.buttons { min-width: 95px; }
-#filetable tr.clickable-row.active td { background-color: lightblue; }
-#filetable tbody tr.highlightedItem td { border-top: 1px solid #555 !important; border-bottom: 1px solid #555 !important; }
-#filetable tbody tr.highlightedItem td:first-child { border-left: 1px solid #555; }
-#filetable tbody tr.highlightedItem td:last-child { border-right: 1px solid #555; }
+#filetable tbody tr.highlightedItem { box-shadow: 0px 0px 10px 2px #337ab7; }
#filetable tbody tr.highlightedItem td:first-child a { outline: none; }
+#filetable tbody tr.selectedItem { background-color: #337ab7; color: #FFF; }
+#filetable tbody tr.selectedItem * a { color: #FFF; }
#navbar { max-width: 100%; }