Commit f008b49a authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Merge branch 'ddfl_202_file_searching' into 'master'

Digital Distortion File Lister v2.02: Added the ability to do a file search (via filespec, description, or new files since last scan).

See merge request !141
parents 57fec759 5112c81a
......@@ -724,7 +724,7 @@ function DDLightbarMenu_Draw(pSelectedItemIndexes, pDrawBorders, pDrawScrollbar)
if (!this.drawnAlready)
this.DisplayInitialScrollbar(this.pos.y);
else
this.UpdateScrollbarWithHighlightedItem();
this.UpdateScrollbarWithHighlightedItem(true);
}
// 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.
......@@ -1347,7 +1347,11 @@ function DDLightbarMenu_GetVal(pDraw, pSelectedItemIndexes)
var draw = (typeof(pDraw) == "boolean" ? pDraw : true);
if (draw)
{
this.Draw(pSelectedItemIndexes);
if (this.scrollbarEnabled && !this.CanShowAllItemsInWindow())
this.DisplayInitialScrollbar(this.scrollbarInfo.solidBlockLastStartRow);
}
// User input loop
var userChoices = null; // For multi-select mode
......@@ -2326,10 +2330,15 @@ function DDLightbarMenu_CalcScrollbarSolidBlockStartRow()
// Updates the scrollbar position based on the currently-selected
// 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();
if (solidBlockStartRow != this.scrollbarInfo.solidBlockLastStartRow)
if (forceUpdate || (solidBlockStartRow != this.scrollbarInfo.solidBlockLastStartRow))
this.UpdateScrollbar(solidBlockStartRow, this.scrollbarInfo.solidBlockLastStartRow, this.scrollbarInfo.numSolidScrollBlocks);
this.scrollbarInfo.solidBlockLastStartRow = solidBlockStartRow;
}
......
This diff is collapsed.
Digital Distortion File Lister
Version 2.01
Release date: 2022-02-07
Version 2.02
Release date: 2022-02-13
by
......@@ -22,6 +22,7 @@ Contents
- Command shell setup
- Background: Running JavaScript scripts in Synchronet
4. Configuration file & color/text theme configuration file
5. Strings used from text.dat
1. Disclaimer
......@@ -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
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
=======================
......@@ -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:
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
Programs > Online Programs (Doors)), see the following document for more
information:
......@@ -248,4 +268,14 @@ fileAreaDescHighlight The file library/directory description for
'highlight' colors (for moving a file)
fileAreaNumItemsHighlight The number of directories/files for
'highlight' colors (for moving a file)
\ No newline at end of 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)
=============================
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
info. Fixed command bar refreshing when pressing the
hotkeys. Added an option to pause after viewing a file
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment