|
Server : Apache/2.4.62 System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64 User : www ( 80) PHP Version : 8.3.8 Disable Function : NONE Directory : /domains/melanchton/old/ |
Upload File : |
/******************************************************************/
/* functions related to reading a directory of images and */
/* displaying them on a page */
/* author: RWB 2016.02.03 */
/******************************************************************/
//The following code does not work; commented out for later testing
////'use strict';
//function getFiles(dir){
// document.write(dir);
// document.write("<br>");
// var fso, fldr;
// document.write("created vars <br>");
// fso = new ActiveXObject("Scripting.FileSystemObject");
// document.write("created fso<br>");
// fldr = fso.GetFolder(dir);
// document.write("Got folder: " + fldr.Name);
//// var fso = new ActiveXObject("Scripting.FileSystemObject");
//// fileList = [];
//
//// var files = fso.readdirSync(dir);
// document.write("after readdirsync<br>");
//// for(var i in files){
//// if (!files.hasOwnProperty(i)) continue;
//// var name = dir+'/'+files[i];
//// if (!fs.statSync(name).isDirectory()){
////// fileList.push(name);
//// document.write(dir+'/'+files[i]);
//// }
// document.write("something<br>");
//// }
//// return fileList;
//}
/******************************************************************/
/* functions related to reading an arrray of images and */
/* displaying them on a page */
/* author: RWB 2016.03.09 */
/******************************************************************/
function displayPhotosOnPage(SrcFldr, SubFldr, strImages, strOrient, strCaption){
var k = 0; // counter for images
// create a table
document.write("<table>");
while (k < strImages.length) {
// start a row
document.write("<tr>");
for (j = 0; j < 3; j++) {
// displays 3 pictures in a row
// start a cell
document.write("<td align='center'>");
if (k < strImages.length) {
var strPhotoPath;
var imgToDisplay = new Image();
if (SubFldr.length > 0) {
strPhotoPath = "Images/" + SrcFldr + "/" + SubFldr + "/" + strImages[k];
}
else {
strPhotoPath = "Images/" + SrcFldr + "/" + strImages[k];
}
imgToDisplay.src = strPhotoPath;
document.write("<a href=");
document.write("javascript:CaricaFoto('" + strPhotoPath + "')");
document.write(" border='0'>");
document.write("<img src='" + strPhotoPath + "'");
if (strOrient[k] == "P") {
document.write(" height='240' width='180'");
}
else {
document.write(" height='180' width='240'");
}
document.write(" alt='" + strCaption[k] + "' border='0'>");
document.write("</a>");
document.write("<br>" + strCaption[k]);
k++;
}
else {
// if no picture, fill with non-breaking space
document.write(" ");
}
// close the cell
document.write("</td>");
} // end for j
// close the row
document.write("</tr>");
} // end while (k)
// close the table
document.write("</table>");
return;
}