@@ -379,6 +379,11 @@ FM.isItemDir = function(item) {
379379 return item . type == 'd' ;
380380}
381381
382+ FM . isItemLink = function ( item ) {
383+ return item . type == 'l' ;
384+ }
385+
386+
382387FM . getFileType = function ( name ) {
383388 var filetype = name . split ( '.' ) . pop ( ) . toLowerCase ( ) ;
384389 return filetype . length > 6 || name . indexOf ( '.' ) <= 0 ? '' : filetype ;
@@ -393,7 +398,7 @@ FM.sortItems = function(items, box) {
393398
394399 $ . each ( items , function ( i , o ) {
395400 if ( i > 0 ) { // i == 0 means first .. element in list
396- if ( FM . isItemFile ( o ) ) {
401+ if ( FM . isItemFile ( o ) || FM . isItemLink ( o ) ) {
397402 files . push ( o ) ;
398403 }
399404 else {
@@ -595,7 +600,7 @@ FM.toggleSubContextMenu = function(ref) {
595600FM . generate_listing = function ( reply , box ) {
596601 var tab = FM . getTabLetter ( box ) ;
597602 FM . IMAGES [ tab ] = [ ] ;
598-
603+
599604 var acc = [ ] ;
600605 if ( reply . length == 0 ) {
601606 reply = [ {
@@ -608,23 +613,23 @@ FM.generate_listing = function(reply, box) {
608613 date : ''
609614 } ] ;
610615 }
611-
616+
612617 var path_arr = FM [ 'TAB_' + tab + '_CURRENT_PATH' ] . split ( '/' ) ;
613618 path_arr = path_arr . filter ( function ( v ) { return v !== '' } ) ;
614619 path_arr . pop ( ) ;
615620 var back_path = '/' + path_arr . join ( '/' ) ;
616621 if ( back_path == FM . ROOT_DIR || path_arr . length < FM . ROOT_DIR . split ( '/' ) . length ) {
617622 back_path = '' ; //FM.ROOT_DIR;
618623 }
619-
624+
620625 reply = FM . sortItems ( reply , box ) ;
621626
622627 $ ( reply ) . each ( function ( i , o ) {
623628 var path = FM . formatPath ( FM [ 'TAB_' + tab + '_CURRENT_PATH' ] + '/' + o . name ) ;
624629 var cl_act = o . type == 'd' ? 'onClick="FM.open(\'' + path + '\', \'' + box + '\')"' : 'onClick="FM.openFile(\'' + path + '\', \'' + box + '\', this)"' ;
625630 //var cl_act = o.type == 'd' ? 'onDblClick="FM.open(\'' + path + '\', \'' + box + '\')"' : 'onDblClick="FM.openFile(\''+path+'\', \'' + box + '\', this)"';
626631 //var cl_act = '';
627-
632+
628633 if ( o . name == '' ) {
629634 path = FM . formatPath ( back_path ) ;
630635 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) {
641646
642647 var time = o . time . split ( '.' ) ;
643648 time = time [ 0 ] ;
644-
649+
645650 var psDate = new Date ( o . date ) ;
646651
647652 o . full_path = path ;
@@ -683,6 +688,9 @@ FM.generate_listing = function(reply, box) {
683688 if ( FM . isItemDir ( o ) ) {
684689 tpl . set ( ':ITEM_TYPE' , 'filetype-dir' ) ;
685690 }
691+ else if ( FM . isItemLink ( o ) ) {
692+ tpl . set ( ':ITEM_TYPE' , 'filetype-link' ) ;
693+ }
686694 else {
687695 tpl . set ( ':ITEM_TYPE' , 'filetype-' + o . filetype ) ;
688696 }
0 commit comments