Commit 76d36aa4 authored by nightfox's avatar nightfox
Browse files

Digital Distortion Archive Viewer - Allows users to list files inside of...

Digital Distortion Archive Viewer - Allows users to list files inside of archives & view text files, download individual files, etc.  Allows recursive listing of archives inside of archives (accomplishes that by extracting the archive to a temporary directory in the node directory, which will be removed when exiting the archive viewer).
parent d9acbf30
[BEHAVIOR]
interfaceStyle=Lightbar
;interfaceStyle=Traditional
; Input timeout: 5 minutes
inputTimeoutMS=300000
; Maximum archive file size. By default, this value is in bytes; however,
; kilobytes, megabytes, or gigabytes can be specified by putting any
; of the following characters at the end:
; K: Kilobytes
; M: Megabytes
; G: Gigabytes
maxArcFileSize=1G
; Maximum text file size. 5M = 5 megabytes
maxTextFileSize=5M
[COLORS]
; The "Archive:" text
archiveFilenameHdrText=nwh
; Archive filename
archiveFilename=ngh
; The column header line above the file list
headerLine=nyh
; The line between the header line and the file list
headerSeparatorLine=nkh
; File numbers
fileNums=nmh
; File information columns
fileSize=nw
fileDate=ng
fileTime=nr
filename=nc
; For subdirectories
subdir=ngh
; For lightbar mode, highlighted filenames will have this color:
highlightedFile=n4wh4
\ No newline at end of file
This diff is collapsed.
/* This is a cleanup script for Digital Distortion Archive Viewer.
* This script cleans up temporary files & directories from the
* node directory used by Digital Distortion Archive Viewer.
*
* Author: Eric Oulashin (AKA Nightfox)
* BBS: Digital Distortion
* BBS address: digdist.bbsindex.com
*
* Date User Description
* 2009-09-03 Eric Oulashin Created (copied from my logout script).
* Updated deltree() to use the OS's
* recursive delete command because (at
* least in Windows), file_remove() won't
* delete files that have the read-only
* attribute set.
* 2009-09-04 Eric Oulashin Updated deltree() to prevent accidentally
* wiping out a root directory.
* 2009-09-09 Eric Oulashin Updated deltree() to create a boolean variable
* only once which stores whether or not the
* script is running in Windows.
* 2009-09-10 Eric Oulashin Updated deltree() to return true after the
* directory is removed.
*/
load("sbbsdefs.js");
// Remove the Digital Distortion Archive Viewer work directory and
// batch download directory.
deltree(system.node_dir + "DDArcViewerTemp");
deltree(system.node_dir + "DDArcViewer_BatchDL");
// Remove DDArcViewer_DLList.txt - This is the batch download
// queue list file that would be used by the archive viewer if
// possible.
file_remove(system.node_dir + "DDArcViewer_DLList.txt");
// This function recursively removes a directory and all of its contents. Returns
// whether or not the directory was removed.
//
// Parameters:
// pDir: The directory to remove (with trailing slash).
//
// Return value: Boolean - Whether or not the directory was removed.
function deltree(pDir)
{
if ((pDir == null) || (pDir == undefined))
return false;
if (typeof(pDir) != "string")
return false;
if (pDir.length == 0)
return false;
// Make sure pDir actually specifies a directory.
if (!file_isdir(pDir))
return false;
// Don't wipe out a root directory.
if ((pDir == "/") || (pDir == "\\") || (/:\\$/.test(pDir)) || (/:\/$/.test(pDir)) || (/:$/.test(pDir)))
return false;
// If we're on Windows, then use the "RD /S /Q" command to delete
// the directory. Otherwise, assume *nix and use "rm -rf" to
// delete the directory.
if (deltree.inWindows == undefined)
deltree.inWindows = (/^WIN/.test(system.platform.toUpperCase()));
if (deltree.inWindows)
system.exec("RD " + withoutTrailingSlash(pDir) + " /s /q");
else
system.exec("rm -rf " + withoutTrailingSlash(pDir));
// The directory should be gone, so we should return true. I'd like to verify that the
// directory really is gone, but file_exists() seems to return false for directories,
// even if the directory does exist. So I test to make sure no files are seen in the dir.
return (directory(pDir + "*").length == 0);
/*
// Recursively deleting each file & dir using JavaScript:
var retval = true;
// Open the directory and delete each entry.
var files = directory(pDir + "*");
for (var i = 0; i < files.length; ++i)
{
// If the entry is a directory, then deltree it (Note: The entry
// should have a trailing slash). Otherwise, delete the file.
// If the directory/file couldn't be removed, then break out
// of the loop.
if (file_isdir(files[i]))
{
retval = deltree(files[i]);
if (!retval)
break;
}
else
{
retval = file_remove(files[i]);
if (!retval)
break;
}
}
// Delete the directory specified by pDir.
if (retval)
retval = rmdir(pDir);
return retval;
*/
}
// Removes a trailing (back)slash from a path.
//
// Parameters:
// pPath: A directory path
//
// Return value: The path without a trailing (back)slash.
function withoutTrailingSlash(pPath)
{
if ((pPath == null) || (pPath == undefined))
return "";
var retval = pPath;
if (retval.length > 0)
{
var lastIndex = retval.length - 1;
var lastChar = retval.charAt(lastIndex);
if ((lastChar == "\\") || (lastChar == "/"))
retval = retval.substr(0, lastIndex);
}
return retval;
}
\ No newline at end of file
; Compressed archive file extensions
[ZIP]
; PKZip for Win32
;VIEW=\BBS\COMPRESS\pkzip25.exe -view -NoZipExtension %FILENAME%
;EXTRACT=\BBS\COMPRESS\pkzip25.exe -extract -NoZipExtension -Directories %FILENAME% %FILESPEC% %TO_DIR%
; Info-ZIP for Win32 console (comes with Synchronet)
VIEW=\BBS\sbbs\exec\unzip.exe -l %FILENAME%
EXTRACT=\BBS\sbbs\exec\unzip.exe -qq -o %FILENAME% %FILESPEC% -d %TO_DIR%
; Info-ZIP, *nix
;VIEW=unzip -l %FILENAME%
;EXTRACT=unzip -qq -o %FILENAME% %FILESPEC% -d %TO_DIR%
; 7-Zip for Win32 console
;VIEW=\BBS\COMPRESS\7za.exe l %FILENAME%
;EXTRACT=\BBS\COMPRESS\7za.exe x -y %FILENAME% %FILESPEC% -o%TO_DIR%
; 7-Zip for *nix
;VIEW=7za l %FILENAME%
;EXTRACT=7za x -y %FILENAME% %FILESPEC% -o%TO_DIR%
[7Z]
; 7-Zip for Win32 console
VIEW=\BBS\COMPRESS\7za.exe l %FILENAME%
EXTRACT=\BBS\COMPRESS\7za.exe x -y %FILENAME% %FILESPEC% -o%TO_DIR%
; 7-Zip for *nix
;VIEW=7za l %FILENAME%
;EXTRACT=7za x -y %FILENAME% %FILESPEC% -o%TO_DIR%
[RAR]
; RAR for Win32 console
VIEW=\BBS\COMPRESS\Rar.exe lt %FILENAME%
EXTRACT=\BBS\COMPRESS\Rar.exe x %FILENAME% %FILESPEC% %TO_DIR%
; Alexander Roshal's unrar for *nix
;VIEW=unrar lt %FILENAME%
;EXTRACT=unrar x %FILENAME% %FILESPEC% %TO_DIR%
[ARJ]
; ARJ for Win32 console
VIEW=\BBS\COMPRESS\ARJ32.EXE l %FILENAME%
EXTRACT=\BBS\COMPRESS\ARJ32.EXE x %FILENAME% %FILESPEC% -ht%TO_DIR%
; Open-Source ARJ for *nix
;VIEW=arj l %FILENAME%
;EXTRACT=arj x %FILENAME% %FILESPEC% -ht%TO_DIR%
[ISO]
; 7-Zip for Win32 console
VIEW=\BBS\COMPRESS\7za.exe l %FILENAME%
EXTRACT=\BBS\COMPRESS\7za.exe x -y %FILENAME% %FILESPEC% -o%TO_DIR%
; 7-Zip for *nix
;VIEW=7za l %FILENAME%
;EXTRACT=7za x -y %FILENAME% %FILESPEC% -o%TO_DIR%
[TAR]
; 7-Zip for Win32 console
VIEW=\BBS\COMPRESS\7za.exe l %FILENAME%
EXTRACT=\BBS\COMPRESS\7za.exe x -y %FILENAME% %FILESPEC% -o%TO_DIR%
; 7-Zip for *nix
;VIEW=7za l %FILENAME%
;EXTRACT=7za x -y %FILENAME% %FILESPEC% -o%TO_DIR%
[GZ]
; 7-Zip for Win32 console
VIEW=\BBS\COMPRESS\7za.exe l %FILENAME%
EXTRACT=\BBS\COMPRESS\7za.exe x -y %FILENAME% %FILESPEC% -o%TO_DIR%
; 7-Zip for *nix
;VIEW=7za l %FILENAME%
;EXTRACT=7za x -y %FILENAME% %FILESPEC% -o%TO_DIR%
[TGZ]
; gzip for Win32 cmmand-line
;VIEW=\BBS\COMPRESS\gzip.exe -l %FILENAME%
; 7-Zip for Win32 console
VIEW=\BBS\COMPRESS\7za.exe l %FILENAME%
EXTRACT=\BBS\COMPRESS\7za.exe x -y %FILENAME% %FILESPEC% -o%TO_DIR%
; 7-Zip for *nix
;VIEW=7za l %FILENAME%
;EXTRACT=7za x -y %FILENAME% %FILESPEC% -o%TO_DIR%
[TAR.GZ]
; 7-Zip for Win32 console
VIEW=\BBS\COMPRESS\7za.exe l %FILENAME%
EXTRACT=\BBS\COMPRESS\7za.exe x -y %FILENAME% %FILESPEC% -o%TO_DIR%
; tar for *nix
;VIEW=tar ztvf %FILENAME%
;EXTRACT=cd %TO_DIR% && tar zxvf %FILENAME%
; Text file extensions
[TXT]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
[TEXT]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
[DIZ]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
[DOC]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
[ANS]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
[ASC]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
[ASCII]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
[RIP]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
[NFO]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; Chinese text file
[ZW]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
[BBS]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
[ICE]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
[LOG]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; Guitar tab file
[TAB]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; Guitar tab file
[CRD]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; Guitar tab file
[CHORD]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
[NEW]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; Readme file (i.e., READ.ME)
[ME]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
[FAQ]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
[NOW]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
[HTM]
IsText=Yes
VIEW=?typehtml -color %FILENAME%
[HTML]
IsText=Yes
VIEW=?typehtml -color %FILENAME%
[REG]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; A readme file, as in README.1ST
[1ST]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
[CFG]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
[INI]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; Batch file
[BAT]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; Command lst file (similar to a DOS batch file)
[CMD]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; REXX script (a programming language developed by IBM)
[REXX]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; *nix shell script
[SH]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; Outlook Express email message
[EMAIL]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; Mail message
[EMLX]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; EditPad Pro
[EPP]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; Error log
[ERR]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; Outlook Express mailbox index file
[IDX]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; Data list
[LST]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; Mailbox message file
[MSG]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; JavaScript source file
[JS]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; Perl source file
[PL]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; Python source file
[PY]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; PHP source file
[PHP]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; C source file
[C]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; C++ source file
[CPP]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; C++ source file
[CXX]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; C++ source file
[C++]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; Header file for C/C++/Objective-C/etc.
[H]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; C++ header file
[HPP]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; Objective-C source file
[M]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; Objective-C with C++ source file
[MM]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; C# source file
[CS]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; Pascal source file
[PAS]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
; BASIC source file
[BAS]
IsText=Yes