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

Merge branch 'dd_msg_area_chooser_coloring_fix_and_separator_char_fix' into 'master'

DDMsgAreaChooser fix: Sub-board item colors aligned properly again; also, a fix to properly allow separator characters such as |, etc.

See merge request !551
parents 5ea47e93 2833009b
No related branches found
No related tags found
1 merge request!551DDMsgAreaChooser fix: Sub-board item colors aligned properly again; also, a fix to properly allow separator characters such as |, etc.
...@@ -65,7 +65,8 @@ function getAreaHeirarchy(pWhichAreas, pCollapsing, pCollapsingSeparator) ...@@ -65,7 +65,8 @@ function getAreaHeirarchy(pWhichAreas, pCollapsing, pCollapsingSeparator)
// A regular expression intended to be used for replacing all double instances // A regular expression intended to be used for replacing all double instances
// of the separator character with a single instance // of the separator character with a single instance
var doubleSepCharGlobalRegex = new RegExp(pCollapsingSeparator + pCollapsingSeparator, "g"); // "gi" for global case insensitive // Modifiers can be "gi" for global case insensitive
var doubleSepCharGlobalRegex = new RegExp(quoteLiteralCharsForRegEx(pCollapsingSeparator + pCollapsingSeparator), "g");
// Build the heirarchy // Build the heirarchy
// For each library, go through each directory // For each library, go through each directory
...@@ -296,3 +297,27 @@ function splitStrNoSpacesBeforeSeparator(pStr, pSep) ...@@ -296,3 +297,27 @@ function splitStrNoSpacesBeforeSeparator(pStr, pSep)
} }
return strArray; return strArray;
} }
// Adds backslash characters to a string to quote characters as needed
// to match the literal character in a regular expression
//
// Parameters:
// pStr: The string to search
//
// Return value: The string with special regex characters back-quoted
function quoteLiteralCharsForRegEx(pStr)
{
if (typeof(pStr) !== "string")
return "";
const specialChars = "^$.*+?()[]{}|\\";
var newStr = "";
for (var i = 0; i < pStr.length; ++i)
{
if (specialChars.indexOf(pStr[i]) > -1)
newStr += "\\";
newStr += pStr[i];
}
return newStr;
}
\ No newline at end of file
This diff is collapsed.
Digital Distortion Area Choosers Digital Distortion Area Choosers
Version 1.43 Version 1.44
Release date: 2025-06-01 Release date: 2025-06-05
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.44 2025-06-05 Fix (message area chooser only): Sub-board item colors
are properly aligned again
1.43 2025-06-01 *.example.cfg files provided in the Synchronet repo: If 1.43 2025-06-01 *.example.cfg files provided in the Synchronet repo: If
DDFileAreaChooser.cfg or DDMsgAreaChooser.cfg don't exist, DDFileAreaChooser.cfg or DDMsgAreaChooser.cfg don't exist,
read the ones with .example.cfg instead. Sysops can copy read the ones with .example.cfg instead. Sysops can copy
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment