From 7c9ab330430a9484ff918403e5d4a01899ffc49c Mon Sep 17 00:00:00 2001 From: ville rantanen Date: Thu, 25 Oct 2012 09:43:33 +0300 Subject: [PATCH] Symbolic link recursion option, added m key for displaying all medium sized images --- Qalbum.py | 16 ++++++++++++++++ galleryscript.js | 21 ++++++++++++++++++++- gallerystyle.css | 8 ++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/Qalbum.py b/Qalbum.py index db5d204..7b5ddbf 100755 --- a/Qalbum.py +++ b/Qalbum.py @@ -352,11 +352,23 @@ def sizestring(size): def traverse(path,crumbs,inputs,options): ''' The recursive main function to create the index.html and seek sub folders ''' + print(path) + if (not options.recurselink) and (os.path.islink(path)): + print('Not recursing, is a link') + return if len(crumbs)==1: header=getheader(path,'../'*(len(crumbs)-1),inputs[0][1]) else: header=getheader(path,'../'*(len(crumbs)-1)) + if not os.path.exists(os.path.join(path,'../'*(len(crumbs)-1),'galleryscript.js')): + print('Warning, no (relative path) galleryscript! '+os.path.join(path,'../'*(len(crumbs)-1),'galleryscript.js')) + #depth=0 + #while not os.path.exists(os.path.join(path,'../'*(depth),'galleryscript.js')): + # print(os.path.join(path,'../'*(depth))) + # depth+=1 + #header=getheader(path,'../'*(depth)) + print('Depth: '+str(len(crumbs))) pathlist=getpathlist(path,options) imagelist=getimagelist(path,options) @@ -412,6 +424,8 @@ def setupoptions(): parser.add_argument("--version",action='version', version=__version__) parser.add_argument("-r",action="store_true",dest="reverse",default=False, help="Reverse sort orded") + parser.add_argument("-L",action="store_false",dest="recurselink",default=True, + help="List, but do not recurse in to symbolic link folders") parser.add_argument("-s",type=str,dest="style", help="User defined CSS style file.") parser.add_argument("-t",action="store_true",dest="timesort",default=False, @@ -445,6 +459,8 @@ def setupdefaultoptions(options): options.link=False if 'recursive' not in options: options.recursive=True + if 'recurselink' not in options: + options.recurselink=True if 'reverse' not in options: options.reverse=False if 'style' not in options or options.style is None: diff --git a/galleryscript.js b/galleryscript.js index e511a06..c09a416 100644 --- a/galleryscript.js +++ b/galleryscript.js @@ -1152,7 +1152,7 @@ function getThumbStartEnd(n,maxThumb) { function allthumbs() { // Shows all the thumbnails in the current folder - thumbstr='

Images

'; + thumbstr='
'; for (i=0; i'; } @@ -1165,6 +1165,21 @@ function allthumbs() { return; } +function allmediums() { + // Shows all the medium sized in the current folder + thumbstr='
'; + for (i=0; i'; + } + thumbstr+='
'; + $('#thumbcontainer').html(thumbstr); + $('#imagecontainer').html(''); + $('#imagecontainer').css('height',0); + $('#desccontainer').hide(); + currentimage=-1; + return; +} + function subfoldersmalllist() { // Shows a small subfolder list pathstr='Subfolders: '; @@ -1561,6 +1576,10 @@ function keypressed(e) { if (unicode==70) { flipfullscreen(); } + // m: mediums + if (unicode==77) { + allmediums(); + } // o: originals if (unicode==79) { fliporiginals(); diff --git a/gallerystyle.css b/gallerystyle.css index 3dbf780..0af7350 100644 --- a/gallerystyle.css +++ b/gallerystyle.css @@ -20,6 +20,14 @@ body { background-color: white; cursor: pointer; } +.medium { + float: left; + margin-top: 0px; + padding-top: 2px; + padding-left: 8px; + padding-right: 8px; + cursor: pointer; +} .pathlink { word-wrap: break-word; display: table-cell;