Re: ddfilelister.js question
By: Retro Guy to All on Thu Dec 26 2024 07:12 am
I have a question about using ddfilelister.js to list files (of course).
It works fine, no bug to mention, but I'm curious if there is an option
to display the full (long) filename to the right in the listing of files
when there is no extended description.
Is there an option to do this? Or should I dig into the .js and have a
look. I have been looking through the script and may be able to
accomplish this, but if it's already an option I'd rather just do that :)
I seem to have this working fine now by adding two lines to ddfilelister.js (at line 3400 on my copy): if(desc == "")
desc = gFileList[pIdx].name;
I have created a diff if anyone is interested:
@@ -3396,6 +3396,9 @@
}
*/
var desc = (typeof(gFileList[pIdx].desc) === "string" ? gFileList[pIdx].desc : "");
+ // If no description to display, display long filename
+ if(desc == "")
+ desc = gFileList[pIdx].name;
// Remove/replace any cursor movement codes in the description, which can corrupt the display
desc = removeOrReplaceSyncCursorMovementChars(desc, false);
var fileSizeStr = file_size_str(gFileList[pIdx].size, null, FILE_SIZE_PRECISION);
I moved the changes above an existing comment, and added a comment for this change.
--
Retro Guy
---
þ Synchronet þ RetroBBS - retrobbs.ddns.net