Skip to content
Snippets Groups Projects
Commit d265b602 authored by rswindell's avatar rswindell
Browse files

Initial JavaScript for dynamic HTML indexes for FTP server (in progress).

parent 093e7832
No related branches found
No related tags found
No related merge requests found
// JavaScript HTML Index for Synchronet FTP Server
// $id$
var title=system.name + " FTP Server: " + curdir;
write("<HTML>\r\n");
write("<HEAD>\r\n");
write("<STYLE>\r\n");
write("<!--\r\n");
// write("* {font-family: Arial,Helvetica,sans-serif}\r\n");
// write("a {color: green}\r\n");
write("-->\r\n");
write("</STYLE>\r\n");
// Title
write("<TITLE>");
write(title);
write("</TITLE>\r\n");
write("<META NAME='GENERATOR' content='" + system.version + "'>\r\n");
write("</HEAD>\r\n");
write("<BODY bgcolor=gray text=white link=white vlink=silver alink=yellow>\r\n");
write("<FONT FACE=Arial,Helvetica,sans-serif>\r\n");
write("<H1><I><FONT COLOR=lime>" + title + "</FONT></I></H1>\r\n");
if(libname!="")
write("<H3>Library: "+libdesc+"</H3>\r\n");
if(dirname!="")
write("<H3>Directory: "+dirdesc+"</H3>\r\n");
if(file.length) {
var total_bytes=0;
write("<TABLE BORDER='1' WIDTH='100%'>\r\n");
write("");
write("<TH ALIGN=LEFT><font size=-1>File");
write("<TH ALIGN=RIGHT><font size=-1>Size");
write("<TH><font size=-1>Description");
write("<TH><font size=-1>Date/Time");
write("<TH ALIGN=LEFT><font size=-1>Uploader");
write("<TH ALIGN=RIGHT><font size=-1>Count");
write("\r\n");
var mon=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
for(i in file) {
total_bytes+=file[i].size;
var d=new Date(file[i].time*1000);
write("<TR bgcolor=gray>\r\n");
write("<TD><A HREF=" + file[i].link + ">" + file[i].name +"</A>");
write("<TD align=right> <font color=black>" + file[i].size);
write("<TD>" + file[i].description);
write("<TD> <font color=black> <TT>" + format("%02d-%s-%d %02d:%02d"
,d.getDate()
,mon[d.getMonth()]
,d.getFullYear()
,d.getHours()
,d.getMinutes()
) + "</tt>");
var uploader=file[i].uploader;
if (uploader == "-> ADDFILES <-")
uploader="Sysop";
write("<TD>" + uploader);
write("<TD align=right> <font color=black>" + file[i].times_downloaded);
write("\r\n");
}
write("</TABLE>\r\n");
write(format("%lu bytes in %lu files", total_bytes, file.length));
write("<BR>\r\n");
}
if(dir.length)
write(dir.length + " sub-directories:<br>\r\n");
for(i in dir) {
write("<A HREF=" + dir[i].link + ">" + dir[i].name +"</A>");
write(" " + dir[i].description + "<BR>\r\n");
}
write("<BR><font size='-2'>Dynamically generated by ");
write("<A HREF=http://www.synchro.net>" + system.version + "</A>");
write(" on " + Date() + "</font>\r\n");
write("</BODY>\r\n");
write("</HTML>\r\n");
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment