Skip to content
Snippets Groups Projects
Commit 9ecd185f authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Merge branch 'dd_file_lister_only_dir_fix' into 'master'

DD File Area Chooser: The false command-line parameter works again

See merge request !185
parents dde8c68d 3c8c80af
No related branches found
No related tags found
2 merge requests!463MRC mods by Codefenix (2024-10-20),!185DD File Area Chooser: The false command-line parameter works again
...@@ -23,8 +23,15 @@ ...@@ -23,8 +23,15 @@
* 2022-05-17 Eric Oulashin Version 1.24 * 2022-05-17 Eric Oulashin Version 1.24
* Fixes for searching and search error reporting (probably * Fixes for searching and search error reporting (probably
* due to mistaken copy & paste in an earlier commit) * due to mistaken copy & paste in an earlier commit)
* 2022-06-12 Eric Oulashin Version 1.26
* Running this scipt with the "false command-line parameter
* works again, allowing the user to choose the file directory
* within their file library.
*/ */
// TODO: Failing silently when 1st argument is true
// TODO: In the area list, the 10,000ths digit (for # items) is in a different color)
/* Command-line arguments: /* Command-line arguments:
1 (argv[0]): Boolean - Whether or not to choose a file library first (default). If 1 (argv[0]): Boolean - Whether or not to choose a file library first (default). If
false, the user will only be able to choose a different directory within false, the user will only be able to choose a different directory within
...@@ -189,6 +196,7 @@ function DDFileAreaChooser() ...@@ -189,6 +196,7 @@ function DDFileAreaChooser()
this.SelectFileArea_Traditional = DDFileAreaChooser_SelectFileArea_Traditional; this.SelectFileArea_Traditional = DDFileAreaChooser_SelectFileArea_Traditional;
this.SelectDirWithinFileLib_Traditional = DDFileAreaChooser_SelectDirWithinFileLib_Traditional; this.SelectDirWithinFileLib_Traditional = DDFileAreaChooser_SelectDirWithinFileLib_Traditional;
this.SelectSubdirWithinDir_Traditional = DDFileAreaChooser_SelectSubdirWithinDir_Traditional; this.SelectSubdirWithinDir_Traditional = DDFileAreaChooser_SelectSubdirWithinDir_Traditional;
this.GetActualLibIdx = DDFileAreaChooser_GetActualLibIdx;
this.ListFileLibs_Traditional = DDFileAreaChooser_ListFileLibs_Traditional; this.ListFileLibs_Traditional = DDFileAreaChooser_ListFileLibs_Traditional;
this.ListDirsInFileLib_Traditional = DDFileAreaChooser_ListDirsInFileLib_Traditional; this.ListDirsInFileLib_Traditional = DDFileAreaChooser_ListDirsInFileLib_Traditional;
this.ListSubdirsInFileDir_Traditional = DDFileAreaChooser_ListSubdirsInFileDir_Traditional; this.ListSubdirsInFileDir_Traditional = DDFileAreaChooser_ListSubdirsInFileDir_Traditional;
...@@ -351,6 +359,9 @@ function DDFileAreaChooser_SelectFileArea_Traditional(pLevel, pLibIdx, pDirIdx) ...@@ -351,6 +359,9 @@ function DDFileAreaChooser_SelectFileArea_Traditional(pLevel, pLibIdx, pDirIdx)
return; return;
} }
if (pLevel > 1 && typeof(pLibIdx) !== "number")
pLibIdx = this.GetActualLibIdx();
var curLibIdx = 0; var curLibIdx = 0;
var curDirIdx = 0; var curDirIdx = 0;
if (typeof(bbs.curdir_code) == "string") if (typeof(bbs.curdir_code) == "string")
...@@ -700,6 +711,26 @@ function DDFileAreaChooser_SelectSubdirWithinDir_Traditional(pLibIdx, pDirIdx) ...@@ -700,6 +711,26 @@ function DDFileAreaChooser_SelectSubdirWithinDir_Traditional(pLibIdx, pDirIdx)
return retObj; return retObj;
} }
// For the DDFileAreaChooser class: Maps bbs.curlib to the collapsed library array library index
function DDFileAreaChooser_GetActualLibIdx()
{
var libIdx = bbs.curlib;
if (this.useDirCollapsing)
{
var syncLibName = file_area.lib_list[bbs.curlib].name;
var syncLibDesc = file_area.lib_list[bbs.curlib].description;
for (var i = 0; i < this.lib_list.length; ++i)
{
if (this.lib_list[i].name == syncLibName && this.lib_list[i].description == syncLibDesc)
{
libIdx = i;
break;
}
}
}
return libIdx;
}
// For the DDFileAreaChooser class: Traditional user interface for listing // For the DDFileAreaChooser class: Traditional user interface for listing
// the file libraries // the file libraries
// //
...@@ -970,6 +1001,8 @@ function DDFileAreaChooser_WriteDirListHdr1Line(pLibIdx, pDirIdx, pNumPages, pPa ...@@ -970,6 +1001,8 @@ function DDFileAreaChooser_WriteDirListHdr1Line(pLibIdx, pDirIdx, pNumPages, pPa
// directory name collapsing // directory name collapsing
function DDFileAreaChooser_SelectFileArea_Lightbar(pLevel, pLibIdx, pDirIdx) function DDFileAreaChooser_SelectFileArea_Lightbar(pLevel, pLibIdx, pDirIdx)
{ {
if (pLevel > 1 && typeof(pLibIdx) !== "number")
pLibIdx = this.GetActualLibIdx();
// If there are file libraries, then don't let the user // If there are file libraries, then don't let the user
// choose one. // choose one.
if (file_area.lib_list.length == 0) if (file_area.lib_list.length == 0)
......
...@@ -78,8 +78,8 @@ if (system.version_num < 31400) ...@@ -78,8 +78,8 @@ if (system.version_num < 31400)
} }
// Version & date variables // Version & date variables
var DD_MSG_AREA_CHOOSER_VERSION = "1.25"; var DD_MSG_AREA_CHOOSER_VERSION = "1.26";
var DD_MSG_AREA_CHOOSER_VER_DATE = "2022-06-06"; var DD_MSG_AREA_CHOOSER_VER_DATE = "2022-06-11";
// Keyboard input key codes // Keyboard input key codes
var CTRL_H = "\x08"; var CTRL_H = "\x08";
......
Digital Distortion Area Choosers Digital Distortion Area Choosers
Version 1.26/1.24 Version 1.26
Release date: 2022-06-11 Release date: 2022-06-12
by by
......
...@@ -5,6 +5,9 @@ Revision History (change log) ...@@ -5,6 +5,9 @@ Revision History (change log)
============================= =============================
Version Date Description Version Date Description
------- ---- ----------- ------- ---- -----------
1.26 2022-06-12 File area chooser fix: Running the scipt with the "false"
command-line parameter works again, allowing the user to
choose the file directory within their file library.
1.26 2022-06-11 Message area chooser only: Updated to try to prevent the 1.26 2022-06-11 Message area chooser only: Updated to try to prevent the
error "this.subBoardListPrintfInfo[pGrpIdx] is undefined" error "this.subBoardListPrintfInfo[pGrpIdx] is undefined"
1.25 2022-06-06 Message area chooser only: Fix for miscolored digit(s) in 1.25 2022-06-06 Message area chooser only: Fix for miscolored digit(s) in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment