Starting to work with configuration window

This commit is contained in:
ville rantanen
2012-03-05 15:08:22 +02:00
parent a622ddcba3
commit 726ae3e305
3 changed files with 59 additions and 8 deletions

View File

@@ -184,9 +184,8 @@ def filelinks(path,list):
strout+='<h2>Attachments</h1>' strout+='<h2>Attachments</h1>'
n=0 n=0
for i in list: for i in list:
nice=nicestring(i)
size=sizestring(os.path.getsize(os.path.join(path,i))) size=sizestring(os.path.getsize(os.path.join(path,i)))
strout+='<span class="attachmentbox" id="a'+str(n)+'"><a href="'+urllib.quote(i)+'">'+unicode(nice,encoding="utf8").encode('ascii', 'xmlcharrefreplace')+' ['+size+']</a></span>' strout+='<span class="attachmentbox" id="a'+str(n)+'"><a href="'+urllib.quote(i)+'">'+unicode(i,encoding="utf8").encode('ascii', 'xmlcharrefreplace')+' ['+size+']</a></span>'
n+=1 n+=1
strout+='</div>' strout+='</div>'
return strout return strout

View File

@@ -239,12 +239,10 @@ function subfolderdetaillist() {
ob=document.getElementById('pathcontainer'); 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>'; 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])+'\');" >';
} else { imgstr='<span class="pathbox" id="p'+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>'; 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) { if (pathlist.length==0) {
ob.innerHTML=''; ob.innerHTML='';
@@ -563,13 +561,21 @@ function keypressed(e) {
if (currentimage>(imagelist.length-1)) { currentimage=0; } if (currentimage>(imagelist.length-1)) { currentimage=0; }
showimage(currentimage); showimage(currentimage);
} }
// f: fullscreen
if (unicode==70) {
flipfullscreen();
}
// o: originals // o: originals
if (unicode==79) { if (unicode==79) {
fliporiginals(); fliporiginals();
} }
// f: fullscreen // s: setup
if (unicode==70) { if (unicode==83) {
flipfullscreen(); if (document.getElementById('setupcontainer')) {
usersetupclose();
} else {
usersetup();
}
} }
// x: mark image // x: mark image
if (unicode==88) { if (unicode==88) {
@@ -584,6 +590,43 @@ function keypressed(e) {
return; return;
} }
function usersetup() {
if (!document.getElementById('setupcontainer')) {
el=getsetupwindow();
document.body.appendChild(el);
el.scrollIntoView(true);
}
return
}
function usersetupclose() {
if (document.getElementById('setupcontainer')) {
var el=document.getElementById('setupcontainer')
el.parentNode.removeChild(el);
}
return
}
function getsetupwindow() {
/* Returns an object containing the long help text */
var el = document.createElement('div');
el.setAttribute("id", 'setupcontainer');
//el.setAttribute("class", 'result-help');
var str='<a href="javascript:void(0)" onclick="usersetupclose();">Close</a>';
/* Items to setup:
* var currentimage=-1; = offset
* var originals=false;
* var fullscreen=false;
* var slideshowinterval;
* sort name, time, namerev, timerev
*/
str+='<div class="headsmall">Configuration</div> '+
'Your query will be searched in file names. ';
if (location.protocol!='file:') {
str+='<li/>Example: <a href="'+top.location.origin+top.location.pathname+'?full=1" target="_BLANK">'+
top.location.origin+top.location.pathname+'?full=1</a>';
}
el.innerHTML=str;
return el
}
function notsupported() { function notsupported() {
// not supported devices (i.e. the javascript doesnt work properly ) // not supported devices (i.e. the javascript doesnt work properly )

View File

@@ -64,7 +64,7 @@ body {
} }
.attachmentbox { .attachmentbox {
float: left; float: left;
width: 150px; clear: both;
} }
.thumbimage { .thumbimage {
height:90px; height:90px;
@@ -146,6 +146,15 @@ body {
#preloadcontainer { #preloadcontainer {
display: none; display: none;
} }
#setupcontainer {
position: absolute;
top: 10px;
left: 10px;
padding: 10px 10px 10px 10px;
z-index:99;
background-color: white;
border: solid 1px black;
}
h1 { h1 {
font-size: large; font-size: large;
font-family: sans-serif; font-family: sans-serif;