diff --git a/xtrn/DDAreaChoosers/DDFileAreaChooser.js b/xtrn/DDAreaChoosers/DDFileAreaChooser.js index dfc730803ff7224c0ab0466faef4a89e88d851d3..0b555ec59235c8633f7345db97b54bc1fcff6b6f 100644 --- a/xtrn/DDAreaChoosers/DDFileAreaChooser.js +++ b/xtrn/DDAreaChoosers/DDFileAreaChooser.js @@ -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) diff --git a/xtrn/DDAreaChoosers/DDMsgAreaChooser.js b/xtrn/DDAreaChoosers/DDMsgAreaChooser.js index 2574f5c12ec74b85c24091f6d999c8f47fc7ed58..a2d848f318b515a2456faef880c1ef17b6b50e5d 100644 --- a/xtrn/DDAreaChoosers/DDMsgAreaChooser.js +++ b/xtrn/DDAreaChoosers/DDMsgAreaChooser.js @@ -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"; diff --git a/xtrn/DDAreaChoosers/readme.txt b/xtrn/DDAreaChoosers/readme.txt index ea8833aef4e6254d2ce7a8c9be28b81b1dc606ab..89594daf5a0578775dc8eb152c3891a67ba520cd 100644 --- a/xtrn/DDAreaChoosers/readme.txt +++ b/xtrn/DDAreaChoosers/readme.txt @@ -1,6 +1,6 @@ Digital Distortion Area Choosers - Version 1.26/1.24 - Release date: 2022-06-11 + Version 1.26 + Release date: 2022-06-12 by diff --git a/xtrn/DDAreaChoosers/revision_history.txt b/xtrn/DDAreaChoosers/revision_history.txt index f0024a7b57793b89804eb9a4ba58fd5908812036..348a85fdfd37876e97f6b14c4d5bfc4c2e127284 100644 --- a/xtrn/DDAreaChoosers/revision_history.txt +++ b/xtrn/DDAreaChoosers/revision_history.txt @@ -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