Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
4540ad04
Commit
4540ad04
authored
1 year ago
by
Eric Oulashin
Committed by
Rob Swindell
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
DDMsgReader: Bug fix for going to a specific message in the message list...
parent
e4b6cfaa
No related branches found
No related tags found
2 merge requests
!463
MRC mods by Codefenix (2024-10-20)
,
!323
DDMsgReader: Bug fix for going to a specific message in the message list...
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
xtrn/DDMsgReader/DDMsgReader.js
+61
-55
61 additions, 55 deletions
xtrn/DDMsgReader/DDMsgReader.js
xtrn/DDMsgReader/readme.txt
+2
-2
2 additions, 2 deletions
xtrn/DDMsgReader/readme.txt
xtrn/DDMsgReader/revision_history.txt
+2
-0
2 additions, 0 deletions
xtrn/DDMsgReader/revision_history.txt
with
65 additions
and
57 deletions
xtrn/DDMsgReader/DDMsgReader.js
+
61
−
55
View file @
4540ad04
...
...
@@ -146,6 +146,8 @@
* optional.
* 2023-08-26 Eric Oulashin Version 1.77a
* When saving a message on the local BBS PC without all the headers, the date is now included
* 2023-08-30 Eric Oulashin Version 1.78
* Bug fix for going to a specific message in the message list (especially for lightbar mode)
*/
"use strict";
...
...
@@ -252,8 +254,8 @@ var ansiterm = require("ansiterm_lib.js", 'expand_ctrl_a');
// Reader version information
var READER_VERSION = "1.7
7a
";
var READER_DATE = "2023-08-
26
";
var READER_VERSION = "1.7
8
";
var READER_DATE = "2023-08-
30
";
// Keyboard key codes for displaying on the screen
var UP_ARROW = ascii(24);
...
...
@@ -3466,7 +3468,7 @@ function DigDistMsgReader_ListMessages_Traditional(pAllowChgSubBoard)
var returnObj = this.EditExistingMsg(msgNum-1);
else
{
console.print("\x01n\r\n\x01h\x01yThat message isn't editable.\n");
console.print("\x01n\r\n\x01h\x01yThat message isn't editable.\
x01
n");
console.crlf();
console.pause();
}
...
...
@@ -3479,7 +3481,7 @@ function DigDistMsgReader_ListMessages_Traditional(pAllowChgSubBoard)
}
}
// G: Go to a specific message by # (place that message on the top)
else if (retvalObj.userInput ==
"G"
)
else if (retvalObj.userInput ==
this.msgListKeys.goToMsg
)
{
var msgNum = this.PromptForMsgNum(curpos, "\x01n" + replaceAtCodesInStr(this.text.goToMsgNumPromptText), false, ERROR_PAUSE_WAIT_MS, false);
if (msgNum > 0)
...
...
@@ -3743,6 +3745,11 @@ function DigDistMsgReader_ListMessages_Lightbar(pAllowChgSubBoard)
// Create a DDLightbarMenu for the message list and list messages
// and let the user choose one
var msgListMenu = this.CreateLightbarMsgListMenu();
// numMessages & numMessagesPerPage are used with msgListMenu.CalcPageForItemAndSetTopItemIdx() when
// going to a specific message. They're optional, but it can be faster to get them just once instead of
// every time.
var numMessages = msgListMenu.NumItems();
var numMessagesPerPage = msgListMenu.GetNumItemsPerPage();
var msgHeader = null;
var drawMenu = true;
var continueOn = true;
...
...
@@ -3948,7 +3955,7 @@ function DigDistMsgReader_ListMessages_Lightbar(pAllowChgSubBoard)
else
drawMenu = false; // No need to re-draw the menu
}
// G: Go to a specific message by # (highlight or place that message on the top)
// G: Go to a specific message by # (highlight or place that message on the
top, or in the page if can't put it on
top)
else if (lastUserInputUpper == this.msgListKeys.goToMsg)
{
// Move the cursor to the bottom of the screen and
...
...
@@ -3974,6 +3981,7 @@ function DigDistMsgReader_ListMessages_Lightbar(pAllowChgSubBoard)
{
this.lightbarListSelectedMsgIdx = chosenMsgIndex;
msgListMenu.selectedItemIdx = this.lightbarListSelectedMsgIdx;
msgListMenu.CalcPageForItemAndSetTopItemIdx(numMessagesPerPage, numMessages);
}
else
{
...
...
@@ -9327,43 +9335,42 @@ function DigDistMsgReader_PromptForMsgNum(pCurPos, pPromptText, pClearToEOLAfter
pCurPos.hasOwnProperty("y") && (typeof(pCurPos.y) == "number"));
var useCurPos = (console.term_supports(USER_ANSI) && curPosValid);
var msgNum = 0;
var promptCount = 0;
var lastErrorLen = 0; // The length of the last error message
var promptTextLen = console.strlen(pPromptText);
var continueAskingMsgNum = false;
do
{
++promptCount;
msgNum = 0;
if (promptTextLen > 0)
console.print(pPromptText);
if (pClearToEOLAfterPrompt && useCurPos)
{
// The first time the user is being prompted, clear the line to the
// end of the line. For subsequent times, clear the line from the
// prompt text length to the error text length;
if (promptCount == 1)
console.cleartoeol("\x01n");
else
{
if (lastErrorLen > promptTextLen)
{
console.print("\x01n");
console.gotoxy(pCurPos.x+promptTextLen, pCurPos.y);
var clearLen = lastErrorLen - promptTextLen;
for (var counter = 0; counter < clearLen; ++counter)
console.print(" ");
}
}
console.gotoxy(pCurPos.x+promptTextLen, pCurPos.y);
}
msgNum = console.getnum(this.HighestMessageNum());
// If the message number is invalid, then output an error message.
if (msgNum != 0)
{
if (!this.IsValidMessageNum(msgNum))
{
var msgNum = 0;
var promptCount = 0;
var lastErrorLen = 0; // The length of the last error message
var promptTextLen = console.strlen(pPromptText);
var continueAskingMsgNum = false;
do
{
++promptCount;
msgNum = 0;
if (promptTextLen > 0)
console.print(pPromptText);
if (pClearToEOLAfterPrompt && useCurPos)
{
// The first time the user is being prompted, clear the line to the
// end of the line. For subsequent times, clear the line from the
// prompt text length to the error text length;
if (promptCount == 1)
console.cleartoeol("\x01n");
else
{
if (lastErrorLen > promptTextLen)
{
console.print("\x01n");
console.gotoxy(pCurPos.x + promptTextLen, pCurPos.y);
var clearLen = lastErrorLen - promptTextLen;
printf("%-*s", clearLen, "");
}
}
console.gotoxy(pCurPos.x + promptTextLen, pCurPos.y);
}
msgNum = console.getnum(this.NumMessages()); // this.HighestMessageNum()
// If the message number is invalid, then output an error message.
if (msgNum != 0)
{
if (!this.IsValidMessageNum(msgNum) && msgNum != -1) // msgNum would be -1 if the user pressed Q to quit
{
// Output an error message that the message number is invalid
if (useCurPos)
{
...
...
@@ -9373,8 +9380,8 @@ function DigDistMsgReader_PromptForMsgNum(pCurPos, pPromptText, pClearToEOLAfter
// message number to read - I don't want this to clear the whole line
// because that would erase the scrollbar character on the right.
writeWithPause(pCurPos.x, pCurPos.y,
"\x01n" + replaceAtCodesInStr(format(this.text.invalidMsgNumText, msgNum)) + "\x01n",
pErrorPauseTimeMS, "\x01n", true);
"\x01n" + replaceAtCodesInStr(format(this.text.invalidMsgNumText, msgNum)) + "\x01n",
pErrorPauseTimeMS, "\x01n", true);
console.gotoxy(pCurPos);
}
else
...
...
@@ -9387,17 +9394,16 @@ function DigDistMsgReader_PromptForMsgNum(pCurPos, pPromptText, pClearToEOLAfter
// Set msgNum back to 0 to signify that the user didn't enter a (valid)
// message number.
msgNum = 0;
lastErrorLen = 24 + msgNum.toString().length;
continueAskingMsgNum = pRepeat;
}
else
continueAskingMsgNum = false;
}
else
continueAskingMsgNum = false;
}
while (continueAskingMsgNum)
return msgNum;
lastErrorLen = 24 + msgNum.toString().length;
continueAskingMsgNum = pRepeat;
}
else
continueAskingMsgNum = false;
}
else
continueAskingMsgNum = false;
} while (continueAskingMsgNum);
return msgNum;
}
// For the DigDistMsgReader class: Looks for complex @-code strings in a text line and
...
...
This diff is collapsed.
Click to expand it.
xtrn/DDMsgReader/readme.txt
+
2
−
2
View file @
4540ad04
Digital Distortion Message Reader
Version 1.7
7a
Release date: 2023-08-
26
Version 1.7
8
Release date: 2023-08-
30
by
...
...
This diff is collapsed.
Click to expand it.
xtrn/DDMsgReader/revision_history.txt
+
2
−
0
View file @
4540ad04
...
...
@@ -5,6 +5,8 @@ Revision History (change log)
=============================
Version Date Description
------- ---- -----------
1.78 2023-08-30 Bug fix for going to a specific message in the message
list (especially for lightbar mode)
1.77a 2023-08-26 When saving a message on the local BBS PC without all the
headers, the date is now included
1.77 2023-08-20 Including all message headers when saving a message (sysop
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment