adding different lists of folders

This commit is contained in:
ville rantanen
2011-12-02 16:00:50 +02:00
parent b59a476612
commit 3b46d8c8eb
3 changed files with 37 additions and 6 deletions

View File

@@ -146,7 +146,7 @@ def imagescript(path,list):
def imagelinks(path,list): def imagelinks(path,list):
''' Returns the HTML string of images ''' ''' Returns the HTML string of images '''
strout='<div id="thumbcontainer">' strout='<div id="thumbcontainer"><noscript>'
strout+='<h1>Images</h1>' strout+='<h1>Images</h1>'
descriptions=getdescriptions(path,list) descriptions=getdescriptions(path,list)
n=0 n=0
@@ -155,7 +155,7 @@ def imagelinks(path,list):
desc=doublequotes.sub('',unicode(descriptions[n],encoding="utf8").encode('ascii', 'xmlcharrefreplace')) desc=doublequotes.sub('',unicode(descriptions[n],encoding="utf8").encode('ascii', 'xmlcharrefreplace'))
strout+='<span class="imagebox thumbbox" id="n'+str(n)+'"><a href="'+urllib.quote(i)+'"><img class="thumbimage" "title="'+desc+'" src="_tn/tn_'+urllib.quote(i)+'.jpg"><br/>'+unicode(nice,encoding="utf8").encode('ascii', 'xmlcharrefreplace')+'</a></span>' strout+='<span class="imagebox thumbbox" id="n'+str(n)+'"><a href="'+urllib.quote(i)+'"><img class="thumbimage" "title="'+desc+'" src="_tn/tn_'+urllib.quote(i)+'.jpg"><br/>'+unicode(nice,encoding="utf8").encode('ascii', 'xmlcharrefreplace')+'</a></span>'
n+=1 n+=1
strout+='</div>' strout+='</noscript></div>'
return strout return strout
def filescript(path,list): def filescript(path,list):

View File

@@ -32,7 +32,7 @@ function setup() {
if (notsupported()) { if (notsupported()) {
return; return;
} }
hidethumbs(); //hidethumbs();
document.onkeydown=keypressed; document.onkeydown=keypressed;
var req=request(); var req=request();
if (req!=-1) { if (req!=-1) {
@@ -162,7 +162,8 @@ function allthumbs() {
function subfoldersmalllist() { function subfoldersmalllist() {
// Shows a small subfolder list // Shows a small subfolder list
ob=document.getElementById('pathcontainer'); ob=document.getElementById('pathcontainer');
pathstr='<span id="pathsmalllink">Subfolders: '; pathstr='<span class="pathsmalllink">Subfolders: ';
pathstr+='<span class="pathsmalllink">(<a href="javascript:void(0);" onclick="subfoldersmalllist();">text</a> <a href="javascript:void(0);" onclick="subfolderbiglist();">icon</a> <a href="javascript:void(0);" onclick="subfolderdetaillist();">list</a>)</span> ';
for (p=0; p<pathlist.length; p++) { for (p=0; p<pathlist.length; p++) {
pathstr+='<a href="'+encodeURI(pathlist[p][0])+'/index.html">'+nicestring(pathlist[p][0])+'</a>('+String(pathlist[p][1])+')/ '; pathstr+='<a href="'+encodeURI(pathlist[p][0])+'/index.html">'+nicestring(pathlist[p][0])+'</a>('+String(pathlist[p][1])+')/ ';
} }
@@ -175,7 +176,7 @@ function subfoldersmalllist() {
function subfolderbiglist() { function subfolderbiglist() {
// Shows a subfolder list with thumbnails // Shows a subfolder list with thumbnails
ob=document.getElementById('pathcontainer'); ob=document.getElementById('pathcontainer');
pathstr='<h2>Subfolders:</h2>'; pathstr='<h2>Subfolders: <span class="pathsmalllink">(<a href="javascript:void(0);" onclick="subfoldersmalllist();">text</a> <a href="javascript:void(0);" onclick="subfolderbiglist();">icon</a> <a href="javascript:void(0);" onclick="subfolderdetaillist();">list</a>)</span></h2>';
for (p=0; p<pathlist.length; p++) { for (p=0; p<pathlist.length; p++) {
if (pathimage[p].length>0) { if (pathimage[p].length>0) {
imgstr='<span class="pathbox" id="p'+p+'" style="background-image:url(\''+encodeURI(pathimage[p])+'\');">'; imgstr='<span class="pathbox" id="p'+p+'" style="background-image:url(\''+encodeURI(pathimage[p])+'\');">';
@@ -187,6 +188,23 @@ function subfolderbiglist() {
} else { ob.innerHTML=pathstr; } } else { ob.innerHTML=pathstr; }
return; return;
} }
function subfolderdetaillist() {
// Shows a subfolder list with thumbnails
ob=document.getElementById('pathcontainer');
pathstr='<h2>Subfolders: <span class="pathsmalllink">(<a href="javascript:void(0);" onclick="subfoldersmalllist();">text</a> <a href="javascript:void(0);" onclick="subfolderbiglist();">icon</a> <a href="javascript:void(0);" onclick="subfolderdetaillist();">list</a>)</span></h2>';
for (p=0; p<pathlist.length; p++) {
if (pathimage[p].length>0) {
imgstr='<span class="pathbox" id="p'+p+'" style="background-image:url(\''+encodeURI(pathimage[p])+'\');" >';
} else { imgstr='<span class="pathbox" id="p'+p+'">'; }
pathstr+='<div class="pathdetailrow"><a title="'+pathlist[p][0]+'" href="'+encodeURI(pathlist[p][0])+'/index.html">'+imgstr+'</span><span class="pathdetaillink"><span class="pathdetaillinktext">'+(pathlist[p][0])+' ('+String(pathlist[p][1])+')</span></span></a></div>';
}
if (pathlist.length==0) {
ob.innerHTML='';
} else { ob.innerHTML=pathstr; }
return;
}
function sortlist(property) { function sortlist(property) {
// sorts the image list based on time or name, or reverse sort // sorts the image list based on time or name, or reverse sort
var templist=[] var templist=[]

View File

@@ -33,7 +33,20 @@ body {
opacity: 0.8; opacity: 0.8;
display: block; display: block;
} }
#pathsmalllink { .pathdetailrow {
float:left;
clear:both;
margin-bottom:1px;
}
.pathdetaillink {
white-space:nowrap;
overflow:hidden;
line-height:80px;
}
.pathdetaillinktext {
background-color: white;
}
.pathsmalllink {
font-size: x-small; font-size: x-small;
} }
.thumbbox { .thumbbox {