diff --git a/xtrn/ddfilelister/ddfilelister.js b/xtrn/ddfilelister/ddfilelister.js index c54a109bdd5ef8e92ac53c1c423066ea6a3f1c08..edf9dc69ed6ceee73a5f2255a309c6c8547e3fe3 100644 --- a/xtrn/ddfilelister/ddfilelister.js +++ b/xtrn/ddfilelister/ddfilelister.js @@ -39,6 +39,10 @@ * highlighted file on the right. Also, made the file info * window taller for terminals within 25 lines high. * 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") @@ -94,8 +98,8 @@ if (system.version_num < 31900) } // Lister version information -var LISTER_VERSION = "2.05"; -var LISTER_DATE = "2022-03-12"; +var LISTER_VERSION = "2.05a"; +var LISTER_DATE = "2022-03-13"; /////////////////////////////////////////////////////////////////////////////// @@ -3604,6 +3608,8 @@ function displayFileExtDescOnMainScreen(pFileIdx, pStartScreenRow, pEndScreenRow fileDesc = fileMetadata.extdesc; else fileDesc = fileMetadata.desc; + if (typeof(fileDesc) != "string") + fileDesc = ""; // This might be overkill, but just in case, convert any non-Synchronet // attribute codes to Synchronet attribute codes in the description. @@ -3691,9 +3697,15 @@ function displayFileExtDescOnMainScreen(pFileIdx, pStartScreenRow, pEndScreenRow // given top & bottom screen rows. function refreshScreenMainContent(pUpperLeftX, pUpperLeftY, pWidth, pHeight, pSelectedItemIdxes) { - var selectedItemIdxesIsValid = (typeof(pSelectedItemIdxes) === "object"); - var selectedItemIdxes = (selectedItemIdxesIsValid ? pSelectedItemIdxes : {}); - gFileListMenu.DrawPartialAbs(pUpperLeftX, pUpperLeftY, pWidth, pHeight, selectedItemIdxes); + // Have the file list menu partially re-draw itself if necessary + var startXWithinFileList = (pUpperLeftX >= gFileListMenu.pos.x && pUpperLeftX < gFileListMenu.pos.x + gFileListMenu.size.width); + 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, // refresh the selected items (with checkmarks) outside the top & bottom // lines on the file menu diff --git a/xtrn/ddfilelister/readme.txt b/xtrn/ddfilelister/readme.txt index 37dfeb53389d539be11ef09160f1e698861d43b8..1842252b213e0a461e7cc1e942754d5df6bcc2b4 100644 --- a/xtrn/ddfilelister/readme.txt +++ b/xtrn/ddfilelister/readme.txt @@ -1,6 +1,6 @@ Digital Distortion File Lister - Version 2.05 - Release date: 2022-03-12 + Version 2.05a + Release date: 2022-03-13 by diff --git a/xtrn/ddfilelister/revision_history.txt b/xtrn/ddfilelister/revision_history.txt index f8c50f2d32728bb0600acdd100497fc63cd17d4e..99fc0c0b7e6c47ad902cfc46157ca933b76587a8 100644 --- a/xtrn/ddfilelister/revision_history.txt +++ b/xtrn/ddfilelister/revision_history.txt @@ -5,6 +5,8 @@ Revision History (change log) ============================= 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 setting: If the user's extended file description setting is enabled, the lister will now show extended file