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

Merge branch 'dd_msg_area_chooser_select_current_subgroup' into 'master'

DD Message area chooser: Lightbar mode name collapsing: Ensure the intermediate subgroup is selected

See merge request !356
parents 0972c5b8 b9a8be29
No related branches found
No related tags found
2 merge requests!463MRC mods by Codefenix (2024-10-20),!356DD Message area chooser: Lightbar mode name collapsing: Ensure the intermediate subgroup is selected
...@@ -71,6 +71,9 @@ ...@@ -71,6 +71,9 @@
* Sub-board name collapsing: Fix for incorrect sub-subboard assignment. * Sub-board name collapsing: Fix for incorrect sub-subboard assignment.
* Also, won't collapse if the name before the separator is the same as * Also, won't collapse if the name before the separator is the same as
* the message group description. * the message group description.
* 2023-10-27 Eric Oulashin Version 1.41
* Lightbar mode: When using name collapisng, ensure the menu item for
* the appropriate subgroup is selected.
*/ */
// TODO: In the area list, the 10,000ths digit (for # posts) is in a different color) // TODO: In the area list, the 10,000ths digit (for # posts) is in a different color)
...@@ -114,8 +117,8 @@ if (system.version_num < 31400) ...@@ -114,8 +117,8 @@ if (system.version_num < 31400)
} }
// Version & date variables // Version & date variables
var DD_MSG_AREA_CHOOSER_VERSION = "1.40"; var DD_MSG_AREA_CHOOSER_VERSION = "1.41";
var DD_MSG_AREA_CHOOSER_VER_DATE = "2023-10-24"; var DD_MSG_AREA_CHOOSER_VER_DATE = "2023-10-27";
// Keyboard input key codes // Keyboard input key codes
var CTRL_H = "\x08"; var CTRL_H = "\x08";
...@@ -1177,19 +1180,38 @@ function DDMsgAreaChooser_CreateLightbarSubBoardMenu(pLevel, pGrpIdx, pSubIdx) ...@@ -1177,19 +1180,38 @@ function DDMsgAreaChooser_CreateLightbarSubBoardMenu(pLevel, pGrpIdx, pSubIdx)
// Set the currently selected item. If the current sub-board is in this list, // Set the currently selected item. If the current sub-board is in this list,
// then set the selected item to that; otherwise, the selected item should be // then set the selected item to that; otherwise, the selected item should be
// the first sub-board. // the first sub-board.
var selectedItemIdxWasSet = false;
if (msg_area.sub[bbs.cursub_code].grp_index == pGrpIdx) if (msg_area.sub[bbs.cursub_code].grp_index == pGrpIdx)
{ {
//if (user.is_sysop) console.print("\x01n\r\nHere 1\r\n\x01p"); // Temporary
if ((pSubIdx >= 0) && (pSubIdx < this.group_list[pGrpIdx].sub_list.length)) if ((pSubIdx >= 0) && (pSubIdx < this.group_list[pGrpIdx].sub_list.length))
{ {
var subSubsValid = Array.isArray(this.group_list[pGrpIdx].sub_list[pSubIdx].sub_subboard_list) && this.group_list[pGrpIdx].sub_list[pSubIdx].sub_subboard_list.length > 0; var subSubsValid = Array.isArray(this.group_list[pGrpIdx].sub_list[pSubIdx].sub_subboard_list) && this.group_list[pGrpIdx].sub_list[pSubIdx].sub_subboard_list.length > 0;
if (!subSubsValid && bbs.cursub_code == this.group_list[pGrpIdx].sub_list[pSubIdx].code) if (!subSubsValid && bbs.cursub_code == this.group_list[pGrpIdx].sub_list[pSubIdx].code)
{ {
//if (user.is_sysop) console.print("\x01n\r\nHere 3\r\n\x01p"); // Temporary
subBoardMenu.selectedItemIdx = pSubIdx; subBoardMenu.selectedItemIdx = pSubIdx;
if (subBoardMenu.selectedItemIdx >= subBoardMenu.topItemIdx+subBoardMenu.GetNumItemsPerPage()) if (subBoardMenu.selectedItemIdx >= subBoardMenu.topItemIdx+subBoardMenu.GetNumItemsPerPage())
subBoardMenu.topItemIdx = subBoardMenu.selectedItemIdx - subBoardMenu.GetNumItemsPerPage() + 1; subBoardMenu.topItemIdx = subBoardMenu.selectedItemIdx - subBoardMenu.GetNumItemsPerPage() + 1;
} }
} }
} }
// If the selected item wasn't set, then check whether the current sub-board
// is within any of the sub-subboards for the subgroups in the group, and set
// it if so.
if (!selectedItemIdxWasSet)
{
for (var subIdx = 0; subIdx < this.group_list[pGrpIdx].sub_list.length; ++subIdx)
{
if (this.CurrentSubBoardIsInSubSubsForSub(pGrpIdx, subIdx))
{
subBoardMenu.selectedItemIdx = subIdx;
if (subBoardMenu.selectedItemIdx >= subBoardMenu.topItemIdx+subBoardMenu.GetNumItemsPerPage())
subBoardMenu.topItemIdx = subBoardMenu.selectedItemIdx - subBoardMenu.GetNumItemsPerPage() + 1;
break;
}
}
}
} }
else if (pLevel == 3) else if (pLevel == 3)
{ {
......
Digital Distortion Area Choosers Digital Distortion Area Choosers
Version 1.40 Version 1.41/1.40
Release date: 2023-10-24 Release date: 2023-10-27
by by
......
...@@ -5,6 +5,10 @@ Revision History (change log) ...@@ -5,6 +5,10 @@ Revision History (change log)
============================= =============================
Version Date Description Version Date Description
------- ---- ----------- ------- ---- -----------
1.41 2023-1027 Message area chooser only: In lightbar mode, when using
name collapisng, ensure the menu item for the appropriate
subgroup is selected.
The file area chooser was already doing this.
1.40 2023-10-24 Name collapsing: Fix for incorrect subboard/directory 1.40 2023-10-24 Name collapsing: Fix for incorrect subboard/directory
assignment. Also, won't collapse if the name before the assignment. Also, won't collapse if the name before the
separator is the same as the message group description. separator is the same as the message group description.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment