Commit 3c8c80af authored by Eric Oulashin's avatar Eric Oulashin
Browse files

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

allowing the user to choose the file directory within their file library.
parent dde8c68d
Pipeline #3116 passed with stage
in 10 minutes and 7 seconds
......@@ -23,8 +23,15 @@
* 2022-05-17 Eric Oulashin Version 1.24
* Fixes for searching and search error reporting (probably
* 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:
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
......@@ -189,6 +196,7 @@ function DDFileAreaChooser()
this.SelectFileArea_Traditional = DDFileAreaChooser_SelectFileArea_Traditional;
this.SelectDirWithinFileLib_Traditional = DDFileAreaChooser_SelectDirWithinFileLib_Traditional;
this.SelectSubdirWithinDir_Traditional = DDFileAreaChooser_SelectSubdirWithinDir_Traditional;
this.GetActualLibIdx = DDFileAreaChooser_GetActualLibIdx;
this.ListFileLibs_Traditional = DDFileAreaChooser_ListFileLibs_Traditional;
this.ListDirsInFileLib_Traditional = DDFileAreaChooser_ListDirsInFileLib_Traditional;
this.ListSubdirsInFileDir_Traditional = DDFileAreaChooser_ListSubdirsInFileDir_Traditional;
......@@ -351,6 +359,9 @@ function DDFileAreaChooser_SelectFileArea_Traditional(pLevel, pLibIdx, pDirIdx)
return;
}
if (pLevel > 1 && typeof(pLibIdx) !== "number")
pLibIdx = this.GetActualLibIdx();
var curLibIdx = 0;
var curDirIdx = 0;
if (typeof(bbs.curdir_code) == "string")
......@@ -700,6 +711,26 @@ function DDFileAreaChooser_SelectSubdirWithinDir_Traditional(pLibIdx, pDirIdx)
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
// the file libraries
//
......@@ -970,6 +1001,8 @@ function DDFileAreaChooser_WriteDirListHdr1Line(pLibIdx, pDirIdx, pNumPages, pPa
// directory name collapsing
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
// choose one.
if (file_area.lib_list.length == 0)
......
......@@ -78,8 +78,8 @@ if (system.version_num < 31400)
}
// Version & date variables
var DD_MSG_AREA_CHOOSER_VERSION = "1.25";
var DD_MSG_AREA_CHOOSER_VER_DATE = "2022-06-06";
var DD_MSG_AREA_CHOOSER_VERSION = "1.26";
var DD_MSG_AREA_CHOOSER_VER_DATE = "2022-06-11";
// Keyboard input key codes
var CTRL_H = "\x08";
......
Digital Distortion Area Choosers
Version 1.26/1.24
Release date: 2022-06-11
Version 1.26
Release date: 2022-06-12
by
......
......@@ -5,6 +5,9 @@ Revision History (change log)
=============================
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
error "this.subBoardListPrintfInfo[pGrpIdx] is undefined"
1.25 2022-06-06 Message area chooser only: Fix for miscolored digit(s) in
......
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