Commit 9bfc1a4a authored by Eric Oulashin's avatar Eric Oulashin
Browse files

Fix for "fileDesc is not defined" error when displaying the file description on the main screen.

ddfilelister version 2.05a: Fix for "fileDesc is not defined" error when displaying the file
description on the main screen.  Also made a small refactor to the main screen refresh function.
parent 6895c8da
Pipeline #2890 passed with stage
in 10 minutes and 8 seconds
...@@ -39,6 +39,10 @@ ...@@ -39,6 +39,10 @@
* highlighted file on the right. Also, made the file info * highlighted file on the right. Also, made the file info
* window taller for terminals within 25 lines high. * window taller for terminals within 25 lines high.
* I had started work on this on March 9, 2022. * I had started work on this on March 9, 2022.
* 2022-03-13 Eric Oulashin Version 2.05a
* Fix for "fileDesc is not defined" error when displaying
* the file description on the main screen. Also made a
* small refactor to the main screen refresh function.
*/ */
if (typeof(require) === "function") if (typeof(require) === "function")
...@@ -94,8 +98,8 @@ if (system.version_num < 31900) ...@@ -94,8 +98,8 @@ if (system.version_num < 31900)
} }
// Lister version information // Lister version information
var LISTER_VERSION = "2.05"; var LISTER_VERSION = "2.05a";
var LISTER_DATE = "2022-03-12"; var LISTER_DATE = "2022-03-13";
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
...@@ -3604,6 +3608,8 @@ function displayFileExtDescOnMainScreen(pFileIdx, pStartScreenRow, pEndScreenRow ...@@ -3604,6 +3608,8 @@ function displayFileExtDescOnMainScreen(pFileIdx, pStartScreenRow, pEndScreenRow
fileDesc = fileMetadata.extdesc; fileDesc = fileMetadata.extdesc;
else else
fileDesc = fileMetadata.desc; fileDesc = fileMetadata.desc;
if (typeof(fileDesc) != "string")
fileDesc = "";
// This might be overkill, but just in case, convert any non-Synchronet // This might be overkill, but just in case, convert any non-Synchronet
// attribute codes to Synchronet attribute codes in the description. // attribute codes to Synchronet attribute codes in the description.
...@@ -3691,9 +3697,15 @@ function displayFileExtDescOnMainScreen(pFileIdx, pStartScreenRow, pEndScreenRow ...@@ -3691,9 +3697,15 @@ function displayFileExtDescOnMainScreen(pFileIdx, pStartScreenRow, pEndScreenRow
// given top & bottom screen rows. // given top & bottom screen rows.
function refreshScreenMainContent(pUpperLeftX, pUpperLeftY, pWidth, pHeight, pSelectedItemIdxes) function refreshScreenMainContent(pUpperLeftX, pUpperLeftY, pWidth, pHeight, pSelectedItemIdxes)
{ {
var selectedItemIdxesIsValid = (typeof(pSelectedItemIdxes) === "object"); // Have the file list menu partially re-draw itself if necessary
var selectedItemIdxes = (selectedItemIdxesIsValid ? pSelectedItemIdxes : {}); var startXWithinFileList = (pUpperLeftX >= gFileListMenu.pos.x && pUpperLeftX < gFileListMenu.pos.x + gFileListMenu.size.width);
gFileListMenu.DrawPartialAbs(pUpperLeftX, pUpperLeftY, pWidth, pHeight, selectedItemIdxes); var startYWithinFileList = (pUpperLeftY >= gFileListMenu.pos.y && pUpperLeftY < gFileListMenu.pos.y + gFileListMenu.size.height);
if (startXWithinFileList && startYWithinFileList)
{
var selectedItemIdxesIsValid = (typeof(pSelectedItemIdxes) === "object");
var selectedItemIdxes = (selectedItemIdxesIsValid ? pSelectedItemIdxes : {});
gFileListMenu.DrawPartialAbs(pUpperLeftX, pUpperLeftY, pWidth, pHeight, selectedItemIdxes);
}
// If pSelectedItemIdxes is a bool instead of an object and is true, // If pSelectedItemIdxes is a bool instead of an object and is true,
// refresh the selected items (with checkmarks) outside the top & bottom // refresh the selected items (with checkmarks) outside the top & bottom
// lines on the file menu // lines on the file menu
......
Digital Distortion File Lister Digital Distortion File Lister
Version 2.05 Version 2.05a
Release date: 2022-03-12 Release date: 2022-03-13
by by
......
...@@ -5,6 +5,8 @@ Revision History (change log) ...@@ -5,6 +5,8 @@ Revision History (change log)
============================= =============================
Version Date Description Version Date Description
------- ---- ----------- ------- ---- -----------
2.05a 2022-03-13 Fix for "fileDesc is not defined" error when displaying
the file description on the main screen.
2.05 2022-03-12 Now makes use of the user's extended file description 2.05 2022-03-12 Now makes use of the user's extended file description
setting: If the user's extended file description setting setting: If the user's extended file description setting
is enabled, the lister will now show extended file is enabled, the lister will now show extended file
......
Markdown is supported
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