Commit 8b24ddc0 authored by Eric Oulashin's avatar Eric Oulashin Committed by Rob Swindell
Browse files

SlyEdit 1.77: Fix for aborting when trying to access sub-board information...

SlyEdit 1.77: Fix for aborting when trying to access sub-board information when there are no sub-boards
parent 19396b9c
......@@ -136,12 +136,16 @@
* Finished refactoring to use DDLightbarMenu
* for the cross-posting menus. Also used DDLightbarMenu
* for the quote selection window.
* 2022-03-05 Version 1.76
* 2022-03-05 Eric Oulashin Version 1.76
* When selecting quote lines in a reply message, SlyEdit now
* remembers the position in the quote selection menu so that
* the quote menu isn't always at the top whenever it's opened
* again. This issue may have been introduced when SlyEdit
* was refactored to use DDLightbarMenu for its lightbar stuff.
* 2022-05-27 Eric Oulashin Version 1.77
* Fixed a few instances where SlyEdit was trying to access
* sub-board information with an empty sub-board code (in the rare
* case when no sub-boards are configured).
*/
/* Command-line arguments:
......@@ -238,8 +242,8 @@ if (console.screen_columns < 80)
}
// Constants
const EDITOR_VERSION = "1.76";
const EDITOR_VER_DATE = "2022-03-05";
const EDITOR_VERSION = "1.77";
const EDITOR_VER_DATE = "2022-05-27";
// Program variables
......@@ -304,6 +308,8 @@ gCrossPostMsgSubs.propIsFuncName = function(pPropName) {
gCrossPostMsgSubs.subCodeExists = function(pSubCode) {
if (typeof(pSubCode) != "string")
return false;
if (pSubCode === "")
return false;
var grpIndex = msg_area.sub[pSubCode].grp_index;
var foundIt = false;
......@@ -318,6 +324,8 @@ gCrossPostMsgSubs.subCodeExists = function(pSubCode) {
gCrossPostMsgSubs.add = function(pSubCode) {
if (typeof(pSubCode) != "string")
return;
if (pSubCode === "")
return;
if (this.subCodeExists(pSubCode))
return;
......@@ -333,6 +341,8 @@ gCrossPostMsgSubs.add = function(pSubCode) {
gCrossPostMsgSubs.remove = function(pSubCode) {
if (typeof(pSubCode) != "string")
return;
if (pSubCode === "")
return;
var grpIndex = msg_area.sub[pSubCode].grp_index;
if (this.hasOwnProperty(grpIndex))
......@@ -4177,9 +4187,9 @@ function spellCheckWordInLine(pDictionaries, pEditLineIdx, pWordArray, pWordIdx,
// Ensure the word to test is all lowercase for case-insensitive matching
var currentWord = pWordArray[pWordIdx].toLowerCase();
// Ensure the word we're checking only has letters and/or an apostrophe.
var currentWord = currentWord.replace(/^[^a-zA-ZÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜáíóúñÑß']*([a-zA-ZÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜáíóúñÑß']+)[^a-zA-ZÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜáíóúñÑß']*$/, "$1");
var currentWord = currentWord.replace(/^[^a-zA-ZÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜáíóúñÑß']*([a-zA-ZÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜáíóúñÑß']+)[^a-zA-ZÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜáíóúñÑß']*$/, "$1");
// Now, ensure the word only certain characters: Letters, apostrophe. Skip it if not.
if (!/^[a-zA-ZÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜáíóúñÑß']+$/g.test(currentWord))
if (!/^[a-zA-ZÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜáíóúñÑß']+$/g.test(currentWord))
{
retObj.skipped = true;
return retObj;
......@@ -5890,15 +5900,18 @@ function writeMsgOntBtmHelpLineWithPause(pMsg, pPauseMS)
function getSignName(pSubCode, pRealNameOnlyFirst, pRealNameForEmail)
{
var useRealName = false;
if (pSubCode.toUpperCase() == "MAIL")
useRealName = pRealNameForEmail;
else
if (typeof(pSubCode) === "string" && pSubCode != "")
{
var msgbase = new MsgBase(pSubCode);
if (msgbase.open())
if (pSubCode.toUpperCase() == "MAIL")
useRealName = pRealNameForEmail;
else
{
useRealName = ((msgbase.cfg.settings & SUB_NAME) == SUB_NAME);
msgbase.close();
var msgbase = new MsgBase(pSubCode);
if (msgbase.open())
{
useRealName = ((msgbase.cfg.settings & SUB_NAME) == SUB_NAME);
msgbase.close();
}
}
}
var signName = "";
......@@ -5992,4 +6005,4 @@ function letUserUploadMessageFile(pCurpos)
console.gotoxy(originalCurpos);
return uploadedMessage;
}
\ No newline at end of file
}
......@@ -43,6 +43,9 @@
* property of the sub-board rather than checking the
* ARS. The can_post property covers more cases.
* 2021-12-09 Eric Oulashin Added consolePauseWithoutText()
* 2022-05-27 Fixed a few instances where SlyEdit was trying to access
* sub-board information with an empty sub-board code (in the rare
* case when no sub-boards are configured).
*/
if (typeof(require) === "function")
......@@ -59,43 +62,43 @@ var BKG_ATTR = 2; // Background color attribute
var SPECIAL_ATTR = 3; // Special attribute
// Box-drawing/border characters: Single-line
var UPPER_LEFT_SINGLE = "";
var HORIZONTAL_SINGLE = "";
var UPPER_RIGHT_SINGLE = "";
var VERTICAL_SINGLE = "";
var LOWER_LEFT_SINGLE = "";
var LOWER_RIGHT_SINGLE = "";
var T_SINGLE = "";
var LEFT_T_SINGLE = "";
var RIGHT_T_SINGLE = "";
var BOTTOM_T_SINGLE = "";
var CROSS_SINGLE = "";
var UPPER_LEFT_SINGLE = "Ú";
var HORIZONTAL_SINGLE = "Ä";
var UPPER_RIGHT_SINGLE = "¿";
var VERTICAL_SINGLE = "³";
var LOWER_LEFT_SINGLE = "À";
var LOWER_RIGHT_SINGLE = "Ù";
var T_SINGLE = "Â";
var LEFT_T_SINGLE = "Ã";
var RIGHT_T_SINGLE = "´";
var BOTTOM_T_SINGLE = "Á";
var CROSS_SINGLE = "Å";
// Box-drawing/border characters: Double-line
var UPPER_LEFT_DOUBLE = "";
var HORIZONTAL_DOUBLE = "";
var UPPER_RIGHT_DOUBLE = "";
var VERTICAL_DOUBLE = "";
var LOWER_LEFT_DOUBLE = "";
var LOWER_RIGHT_DOUBLE = "";
var T_DOUBLE = "";
var LEFT_T_DOUBLE = "";
var RIGHT_T_DOUBLE = "";
var BOTTOM_T_DOUBLE = "";
var CROSS_DOUBLE = "";
var UPPER_LEFT_DOUBLE = "É";
var HORIZONTAL_DOUBLE = "Í";
var UPPER_RIGHT_DOUBLE = "»";
var VERTICAL_DOUBLE = "º";
var LOWER_LEFT_DOUBLE = "È";
var LOWER_RIGHT_DOUBLE = "¼";
var T_DOUBLE = "Ë";
var LEFT_T_DOUBLE = "Ì";
var RIGHT_T_DOUBLE = "¹";
var BOTTOM_T_DOUBLE = "Ê";
var CROSS_DOUBLE = "Î";
// Box-drawing/border characters: Vertical single-line with horizontal double-line
var UPPER_LEFT_VSINGLE_HDOUBLE = "";
var UPPER_RIGHT_VSINGLE_HDOUBLE = "";
var LOWER_LEFT_VSINGLE_HDOUBLE = "";
var LOWER_RIGHT_VSINGLE_HDOUBLE = "";
var UPPER_LEFT_VSINGLE_HDOUBLE = "Õ";
var UPPER_RIGHT_VSINGLE_HDOUBLE = "¸";
var LOWER_LEFT_VSINGLE_HDOUBLE = "Ô";
var LOWER_RIGHT_VSINGLE_HDOUBLE = "¾";
// Other special characters
var DOT_CHAR = "";
var CHECK_CHAR = "";
var THIN_RECTANGLE_LEFT = "";
var THIN_RECTANGLE_RIGHT = "";
var BLOCK1 = ""; // Dimmest block
var BLOCK2 = "";
var BLOCK3 = "";
var BLOCK4 = ""; // Brightest block
var DOT_CHAR = "ú";
var CHECK_CHAR = "û";
var THIN_RECTANGLE_LEFT = "Ý";
var THIN_RECTANGLE_RIGHT = "Þ";
var BLOCK1 = "°"; // Dimmest block
var BLOCK2 = "±";
var BLOCK3 = "²";
var BLOCK4 = "Û"; // Brightest block
// Navigational keys
var UP_ARROW = "";
......@@ -1376,7 +1379,7 @@ function displayCommandList(pDisplayHeader, pClear, pPause, pCanCrossPost, pIsSy
// Help keys and slash commands
printf("\1n\1g%-44s %-33s\r\n", "Help keys", "Slash commands (on blank line)");
printf("\1k\1h%-44s %-33s\r\n", "", "");
printf("\1k\1h%-44s %-33s\r\n", "ÄÄÄÄÄÄÄÄÄ", "ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ");
displayCmdKeyFormattedDouble("Ctrl-G", "General help", "/A", "Abort", true);
displayCmdKeyFormattedDouble("Ctrl-L", "Command key list (this list)", "/S", "Save", true);
displayCmdKeyFormattedDouble("", "", "/Q", "Quote message", true);
......@@ -1390,7 +1393,7 @@ function displayCommandList(pDisplayHeader, pClear, pPause, pCanCrossPost, pIsSy
printf(" \1c\1h%-7s\1g \1n\1c%s", "", "", "/?", "Show help");
console.crlf();
// Command/edit keys
console.print("\1n\1gCommand/edit keys\r\n\1k\1h\r\n");
console.print("\1n\1gCommand/edit keys\r\n\1k\1hÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r\n");
displayCmdKeyFormattedDouble("Ctrl-A", "Abort message", "PageUp", "Page up", true);
displayCmdKeyFormattedDouble("Ctrl-Z", "Save message", "PageDown", "Page down", true);
displayCmdKeyFormattedDouble("Ctrl-Q", "Quote message", "Ctrl-W", "Word/text search", true);
......@@ -1469,14 +1472,14 @@ function displayProgramExitInfo(pClearScreen)
console.clear("n");
/*console.print("ncYou have been using:\r\n");
console.print("hk70\r\n");
console.print("7 nb7 hk0\r\n");
console.print("7 nb7 hk0\r\n");
console.print("7 nb7 hk0\r\n");
console.print("7 nb7 hk0\r\n");
console.print("7 nb7 hk0\r\n");
console.print("7 nb7 hk0\r\n");
console.print("\r\n");
console.print("hkÛ7ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß0Û\r\n");
console.print("Û7 nb7Üßßßß Û Ûßßßß Û Ü hk0Û\r\n");
console.print("Û7 nb7ßÜÜÜ Û Ü Ü ÛÜÜÜ ÜÜÛ Ü ÜÜÛÜÜ hk0Û\r\n");
console.print("Û7 nb7Û Û Û Û Û Û Û Û Û hk0Û\r\n");
console.print("Û7 nb7ßßßß ß ßÜß ßßßßß ßßß ß ßßß hk0Û\r\n");
console.print("Û7 nb7Üß hk0Û\r\n");
console.print("Û7 nb7ß hk0Û\r\n");
console.print("ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß\r\n");
console.print("ngVersion hy" + EDITOR_VERSION + " nm(" +
EDITOR_VER_DATE + ")");*/
console.print("ncYou have been using hSlyEdit ncversion g" + EDITOR_VERSION +
......@@ -3342,7 +3345,7 @@ function getCurMsgInfo(pMsgAreaName)
// Note: As of the May 8, 2013 build of Synchronet (3.16), the bbs.smb_sub*
// properties reflect the current sub-board being posted to, always.
// Digital Man committed a change in CVS for this on May 7, 2013.
if ((typeof(pMsgAreaName) == "string") && (pMsgAreaName.length > 0))
if ((typeof(pMsgAreaName) === "string") && (pMsgAreaName.length > 0) && (retObj.subBoardCode != "") && msg_area.sub.hasOwnProperty(retObj.subBoardCode))
{
if (msg_area.sub[retObj.subBoardCode].name.indexOf(pMsgAreaName) == -1)
{
......@@ -3825,7 +3828,7 @@ function moveGenColorsToGenSettings(pColorsArray, pCfgObj)
// Return value: Boolean - Whether or not the character is a letter
function charIsLetter(pChar)
{
return /^[ABCDEFGHIJKLMNOPQRSTUVWXYZ]$/.test(pChar.toUpperCase());
return /^[ABCDEFGHIJKLMNOPQRSTUVWXYZÀÈÌÒÙàèìòùÁÉÍÓÚÝáéíóúýÂÊÎÔÛâêîôûÃÑÕãñõÄËÏÖÜäëïöüçÇßØøÅåÆæÞþÐð]$/.test(pChar.toUpperCase());
}
// For configuration files, this function returns a fully-pathed filename.
......@@ -4746,7 +4749,7 @@ function getLanguageNameFromDictFilename(pFilenameFullPath)
else if (languageNameLower == "pt-br")
languageName = "Portug" + ascii(130) + "s (BR)";
else if (languageNameLower == "es-es")
languageName = "Espa" + ascii(164) + "ol (Espaa)";
languageName = "Espa" + ascii(164) + "ol (España)";
else if (languageNameLower == "es-co")
languageName = "Espa" + ascii(164) + "ol (CO)";
else if (languageNameLower == "es-cl")
......
Supports Markdown
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