Skip to content
Snippets Groups Projects
Commit 5112c81a authored by Eric Oulashin's avatar Eric Oulashin
Browse files

Digital Distortion File Lister version 2.02: Added the ability to do

a file search (via filespec, description, or new files since last scan).
A command-line parameter, -MODE, specifies which search to perform
(search_filename, search_description, or new_file_search for searching;
list_curdir lists files in the user's current directory, which is the
default).
parent 57fec759
No related branches found
No related tags found
2 merge requests!463MRC mods by Codefenix (2024-10-20),!141Digital Distortion File Lister v2.02: Added the ability to do a file search (via filespec, description, or new files since last scan).
Pipeline #2732 passed
...@@ -724,7 +724,7 @@ function DDLightbarMenu_Draw(pSelectedItemIndexes, pDrawBorders, pDrawScrollbar) ...@@ -724,7 +724,7 @@ function DDLightbarMenu_Draw(pSelectedItemIndexes, pDrawBorders, pDrawScrollbar)
if (!this.drawnAlready) if (!this.drawnAlready)
this.DisplayInitialScrollbar(this.pos.y); this.DisplayInitialScrollbar(this.pos.y);
else else
this.UpdateScrollbarWithHighlightedItem(); this.UpdateScrollbarWithHighlightedItem(true);
} }
// For numbered mode, we'll need to know the length of the longest item number // For numbered mode, we'll need to know the length of the longest item number
// so that we can use that space to display the item numbers. // so that we can use that space to display the item numbers.
...@@ -1347,7 +1347,11 @@ function DDLightbarMenu_GetVal(pDraw, pSelectedItemIndexes) ...@@ -1347,7 +1347,11 @@ function DDLightbarMenu_GetVal(pDraw, pSelectedItemIndexes)
var draw = (typeof(pDraw) == "boolean" ? pDraw : true); var draw = (typeof(pDraw) == "boolean" ? pDraw : true);
if (draw) if (draw)
{
this.Draw(pSelectedItemIndexes); this.Draw(pSelectedItemIndexes);
if (this.scrollbarEnabled && !this.CanShowAllItemsInWindow())
this.DisplayInitialScrollbar(this.scrollbarInfo.solidBlockLastStartRow);
}
// User input loop // User input loop
var userChoices = null; // For multi-select mode var userChoices = null; // For multi-select mode
...@@ -2326,10 +2330,15 @@ function DDLightbarMenu_CalcScrollbarSolidBlockStartRow() ...@@ -2326,10 +2330,15 @@ function DDLightbarMenu_CalcScrollbarSolidBlockStartRow()
// Updates the scrollbar position based on the currently-selected // Updates the scrollbar position based on the currently-selected
// item index, this.selectedItemIdx. // item index, this.selectedItemIdx.
function DDLightbarMenu_UpdateScrollbarWithHighlightedItem() //
// Parameters:
// pForceUpdate: Boolean - Whether or not to force the redraw regardless of block location.
// Defaults to false.
function DDLightbarMenu_UpdateScrollbarWithHighlightedItem(pForceUpdate)
{ {
var forceUpdate = (typeof(pForceUpdate) === "boolean" ? pForceUpdate : false);
var solidBlockStartRow = this.CalcScrollbarSolidBlockStartRow(); var solidBlockStartRow = this.CalcScrollbarSolidBlockStartRow();
if (solidBlockStartRow != this.scrollbarInfo.solidBlockLastStartRow) if (forceUpdate || (solidBlockStartRow != this.scrollbarInfo.solidBlockLastStartRow))
this.UpdateScrollbar(solidBlockStartRow, this.scrollbarInfo.solidBlockLastStartRow, this.scrollbarInfo.numSolidScrollBlocks); this.UpdateScrollbar(solidBlockStartRow, this.scrollbarInfo.solidBlockLastStartRow, this.scrollbarInfo.numSolidScrollBlocks);
this.scrollbarInfo.solidBlockLastStartRow = solidBlockStartRow; this.scrollbarInfo.solidBlockLastStartRow = solidBlockStartRow;
} }
......
This diff is collapsed.
Digital Distortion File Lister Digital Distortion File Lister
Version 2.01 Version 2.02
Release date: 2022-02-07 Release date: 2022-02-13
by by
...@@ -22,6 +22,7 @@ Contents ...@@ -22,6 +22,7 @@ Contents
- Command shell setup - Command shell setup
- Background: Running JavaScript scripts in Synchronet - Background: Running JavaScript scripts in Synchronet
4. Configuration file & color/text theme configuration file 4. Configuration file & color/text theme configuration file
5. Strings used from text.dat
1. Disclaimer 1. Disclaimer
...@@ -66,6 +67,13 @@ Synchronet's viewable files configuration), and adding files to the user's ...@@ -66,6 +67,13 @@ Synchronet's viewable files configuration), and adding files to the user's
batch download queue. Additionally, sysops can delete files and move files to batch download queue. Additionally, sysops can delete files and move files to
another file directory. another file directory.
In addition to listing files in the user's current directory, this lister can
perform a file search (via filespec, description, or new file search since last
search). The default is to list files in the current directory, but a search
mode can be specified with the command-line option -MODE. search_filename,
search_description, or new_file_search will perform the searching; list_curdir
lists files in the user's current directory, which is the default.
3. Installation & Setup 3. Installation & Setup
======================= =======================
...@@ -115,6 +123,18 @@ In a JavaScript script, you can use the bbs.exec() function to run a JavaScript ...@@ -115,6 +123,18 @@ In a JavaScript script, you can use the bbs.exec() function to run a JavaScript
script, as in the following example: script, as in the following example:
bbs.exec("?../xtrn/ddfilelister/ddfilelister.js"); bbs.exec("?../xtrn/ddfilelister/ddfilelister.js");
To perform searching, you can add the -MODE option on the command line.
To do a filename search:
?../xtrn/DigDist/ddfilelister/ddfilelister.js -MODE=search_filename
To do a description search:
?../xtrn/DigDist/ddfilelister/ddfilelister.js -MODE=search_description
To search for new files since the last search:
?../xtrn/DigDist/ddfilelister/ddfilelister.js -MODE=new_file_search
You can also specify a mode to list the user's current directory, which is
already the default action:
?../xtrn/DigDist/ddfilelister/ddfilelister.js -MODE=list_curdir
To install the file lister as an external program (in SCFG in External To install the file lister as an external program (in SCFG in External
Programs > Online Programs (Doors)), see the following document for more Programs > Online Programs (Doors)), see the following document for more
information: information:
...@@ -249,3 +269,13 @@ fileAreaDescHighlight The file library/directory description for ...@@ -249,3 +269,13 @@ fileAreaDescHighlight The file library/directory description for
fileAreaNumItemsHighlight The number of directories/files for fileAreaNumItemsHighlight The number of directories/files for
'highlight' colors (for moving a file) 'highlight' colors (for moving a file)
5. Strings used from text.dat
=============================
Digital Distortion File Lister uses the following strings from text.dat (in
Synchronet's ctrl directory):
- DirLibOrAll (622)
- FileSpecStarDotStar (199)
- SearchStringPrompt (76)
...@@ -5,6 +5,12 @@ Revision History (change log) ...@@ -5,6 +5,12 @@ Revision History (change log)
============================= =============================
Version Date Description Version Date Description
------- ---- ----------- ------- ---- -----------
2.02 2022-02-13 Added the ability to do a file search (via filespec,
description, or new files since last scan). A command-
line parameter, -MODE, specifies which search to perform
(search_filename, search_description, or new_file_search
for searching; list_curdir lists files in the user's
current directory, which is the default).
2.01 2022-02-07 Fixed file description being undefined when viewing file 2.01 2022-02-07 Fixed file description being undefined when viewing file
info. Fixed command bar refreshing when pressing the info. Fixed command bar refreshing when pressing the
hotkeys. Added an option to pause after viewing a file hotkeys. Added an option to pause after viewing a file
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment