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

Merge branch 'ddmsgreader_531_timezone_and_key_help_alignment' into 'master'

DDMsgReader: Fixes for time zone alignment and key help for the message list. Should fix #531

Closes #531

See merge request !265
parents 1e9316c2 96094422
No related branches found
No related tags found
2 merge requests!463MRC mods by Codefenix (2024-10-20),!265DDMsgReader: Fixes for time zone alignment and key help for the message list. Should fix #531
...@@ -101,6 +101,8 @@ ...@@ -101,6 +101,8 @@
* is now word-wrapped to the terminal width. * is now word-wrapped to the terminal width.
* 2023-03-02 Eric Oulashin Version 1.66 * 2023-03-02 Eric Oulashin Version 1.66
* Now allows editing the subject when forwarding a message * Now allows editing the subject when forwarding a message
* 2023-03-09 Eric Oulashin Version 1.67
* Fixes for time zone alignment & list key help for wide terminals
*/ */
   
"use strict"; "use strict";
...@@ -206,8 +208,8 @@ var ansiterm = require("ansiterm_lib.js", 'expand_ctrl_a'); ...@@ -206,8 +208,8 @@ var ansiterm = require("ansiterm_lib.js", 'expand_ctrl_a');
   
   
// Reader version information // Reader version information
var READER_VERSION = "1.66"; var READER_VERSION = "1.67";
var READER_DATE = "2023-03-02"; var READER_DATE = "2023-03-09";
   
// Keyboard key codes for displaying on the screen // Keyboard key codes for displaying on the screen
var UP_ARROW = ascii(24); var UP_ARROW = ascii(24);
...@@ -1269,14 +1271,15 @@ function DigDistMsgReader(pSubBoardCode, pScriptArgs) ...@@ -1269,14 +1271,15 @@ function DigDistMsgReader(pSubBoardCode, pScriptArgs)
this.enhMsgHeaderLinesToReadingUser.push(hdrLine5); this.enhMsgHeaderLinesToReadingUser.push(hdrLine5);
var hdrLine6 = "\x01n\x01c" + VERTICAL_SINGLE + "\x01h\x01k" + BLOCK1 + BLOCK2 + BLOCK3 var hdrLine6 = "\x01n\x01c" + VERTICAL_SINGLE + "\x01h\x01k" + BLOCK1 + BLOCK2 + BLOCK3
+ "\x01gD\x01n\x01gate\x01h\x01c: " + this.colors.msgHdrDateColor + "@MSG_DATE-L"; + "\x01gD\x01n\x01gate\x01h\x01c: " + this.colors.msgHdrDateColor + "@MSG_DATE-L";
//numChars = console.screen_columns - 23; //numChars = console.screen_columns - 67;
numChars = console.screen_columns - 67; //Wed, 08 Mar 2023 19:06:37
numChars = 26 - 11;
for (var i = 0; i < numChars; ++i) for (var i = 0; i < numChars; ++i)
hdrLine6 += "#"; hdrLine6 += "#";
//hdrLine6 += "@\x01n\x01c" + VERTICAL_SINGLE; //hdrLine6 += "@\x01n\x01c" + VERTICAL_SINGLE;
hdrLine6 += "@ @MSG_TIMEZONE@\x01n"; hdrLine6 += "@ @MSG_TIMEZONE@\x01n";
for (var i = 0; i < 40; ++i) numChars = console.screen_columns - 42;
hdrLine6 += " "; hdrLine6 += format("%" + numChars + "s", "");
hdrLine6 += "\x01n\x01c" + VERTICAL_SINGLE; hdrLine6 += "\x01n\x01c" + VERTICAL_SINGLE;
this.enhMsgHeaderLines.push(hdrLine6); this.enhMsgHeaderLines.push(hdrLine6);
this.enhMsgHeaderLinesToReadingUser.push(hdrLine6); this.enhMsgHeaderLinesToReadingUser.push(hdrLine6);
...@@ -8082,23 +8085,26 @@ function DigDistMsgReader_SetEnhancedReaderHelpLine() ...@@ -8082,23 +8085,26 @@ function DigDistMsgReader_SetEnhancedReaderHelpLine()
+ this.colors.enhReaderHelpLineParenColor + ")" + this.colors.enhReaderHelpLineParenColor + ")"
+ this.colors.enhReaderHelpLineGeneralColor + "uit, " + this.colors.enhReaderHelpLineGeneralColor + "uit, "
+ this.colors.enhReaderHelpLineHotkeyColor + "@`?`?@"; + this.colors.enhReaderHelpLineHotkeyColor + "@`?`?@";
// Center the help text based on the console width // Center the help text based on the console width
var numCharsRemaining = console.screen_columns - console.strlen(this.enhReadHelpLine) - 1; //var numHotkeyChars = 92;
var numCharsOnEachSide = Math.floor(numCharsRemaining/2); var numHotkeyChars = 89;
// Left side //var numCharsRemaining = console.screen_columns - (console.strlen(this.enhReadHelpLine) - numHotkeyChars) - 1;
for (var i = 0; i < numCharsOnEachSide; ++i) var helpLineScreenLen = (console.strlen(this.enhReadHelpLine) - numHotkeyChars);
this.enhReadHelpLine = " " + this.enhReadHelpLine; var numCharsRemaining = console.screen_columns - helpLineScreenLen - 1;
var frontPaddingLen = Math.floor(numCharsRemaining/2);
var padding = format("%" + frontPaddingLen + "s", "");
this.enhReadHelpLine = padding + this.enhReadHelpLine;
this.enhReadHelpLine = "\x01n" + this.colors.enhReaderHelpLineBkgColor + this.enhReadHelpLine; this.enhReadHelpLine = "\x01n" + this.colors.enhReaderHelpLineBkgColor + this.enhReadHelpLine;
// Right side if (console.screen_columns > 80)
for (var i = 0; i < numCharsOnEachSide; ++i)
this.enhReadHelpLine += " ";
//numCharsRemaining = console.screen_columns - console.strlen(this.enhReadHelpLine) - 5;
numCharsRemaining = console.screen_columns - 1 - console.strlen(this.enhReadHelpLine);
if (numCharsRemaining > 0)
{ {
for (var i = 0; i < numCharsRemaining; ++i) //helpLineScreenLen += frontPaddingLen;
this.enhReadHelpLine += " "; //numCharsRemaining = console.screen_columns - helpLineScreenLen - 1;
helpLineScreenLen = (console.strlen(this.enhReadHelpLine) - numHotkeyChars);
//numCharsRemaining = console.screen_columns - helpLineScreenLen - 2;
// Adding 3 as a correction factor for wide terminals (this is a kludge)
numCharsRemaining = console.screen_columns - helpLineScreenLen + 3;
if (numCharsRemaining > 0)
this.enhReadHelpLine += format("%" + numCharsRemaining + "s", "");
} }
   
// Create a version without the change area option // Create a version without the change area option
...@@ -8138,20 +8144,24 @@ function DigDistMsgReader_SetEnhancedReaderHelpLine() ...@@ -8138,20 +8144,24 @@ function DigDistMsgReader_SetEnhancedReaderHelpLine()
+ this.colors.enhReaderHelpLineHotkeyColor + "@`?`?@ "; + this.colors.enhReaderHelpLineHotkeyColor + "@`?`?@ ";
   
// Center the help text based on the console width // Center the help text based on the console width
numCharsRemaining = console.screen_columns - console.strlen(this.enhReadHelpLineWithoutChgArea) - 2; numHotkeyChars = 84;
numCharsOnEachSide = Math.floor(numCharsRemaining/2); //var numCharsRemaining = console.screen_columns - (console.strlen(this.enhReadHelpLineWithoutChgArea) - numHotkeyChars) - 1;
// Left side helpLineScreenLen = (console.strlen(this.enhReadHelpLineWithoutChgArea) - numHotkeyChars);
for (var i = 0; i < numCharsOnEachSide; ++i) numCharsRemaining = console.screen_columns - helpLineScreenLen - 1;
this.enhReadHelpLineWithoutChgArea = " " + this.enhReadHelpLineWithoutChgArea;
this.enhReadHelpLineWithoutChgArea = "\x01n" + this.colors.enhReaderHelpLineBkgColor + this.enhReadHelpLineWithoutChgArea;
// Right side
for (var i = 0; i < numCharsOnEachSide; ++i)
this.enhReadHelpLineWithoutChgArea += " ";
numCharsRemaining = console.screen_columns - console.strlen(this.enhReadHelpLineWithoutChgArea) - 1;
if (numCharsRemaining > 0) if (numCharsRemaining > 0)
{ {
for (var i = 0; i < numCharsRemaining; ++i) frontPaddingLen = Math.floor(numCharsRemaining/2);
this.enhReadHelpLineWithoutChgArea += " "; padding = format("%" + frontPaddingLen + "s", "");
this.enhReadHelpLineWithoutChgArea = padding + this.enhReadHelpLineWithoutChgArea;
}
this.enhReadHelpLineWithoutChgArea = "\x01n" + this.colors.enhReaderHelpLineBkgColor + this.enhReadHelpLineWithoutChgArea;
if (console.screen_columns > 80)
{
helpLineScreenLen = (console.strlen(this.enhReadHelpLineWithoutChgArea) - numHotkeyChars);
// Adding 3 as a correction factor for wide terminals (this is a kludge)
numCharsRemaining = console.screen_columns - helpLineScreenLen + 3;
if (numCharsRemaining > 0)
this.enhReadHelpLineWithoutChgArea += format("%" + numCharsRemaining + "s", "");
} }
} }
function stripCtrlFromEnhReadHelpLine_ReplaceArrowChars(pHelpLine) function stripCtrlFromEnhReadHelpLine_ReplaceArrowChars(pHelpLine)
......
Digital Distortion Message Reader Digital Distortion Message Reader
Version 1.66 Version 1.67
Release date: 2023-03-02 Release date: 2023-03-09
by by
......
...@@ -5,6 +5,8 @@ Revision History (change log) ...@@ -5,6 +5,8 @@ Revision History (change log)
============================= =============================
Version Date Description Version Date Description
------- ---- ----------- ------- ---- -----------
1.67 2023-03-09 Fixes for time zone alignment & list key help for wide
terminals
1.66 2023-03-02 When forwarding a message, the subject can now be edited 1.66 2023-03-02 When forwarding a message, the subject can now be edited
before sending the message before sending the message
1.65 2023-02-24 Ctrl-C can now be used to cancel message scans. Output 1.65 2023-02-24 Ctrl-C can now be used to cancel message scans. Output
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment