• ddfilelister.js question

    From Retro Guy@VERT/RETROBBS to All on Thursday, December 26, 2024 00:43:10
    First, thanks Nightfox for these nice scripts, they make the interface quite pleasant.

    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.

    I have quite a few files that I have not provided descriptions for, and the filename is about all that is necessary.

    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 :)

    Thanks for any pointers (like what function is best to mess with), or comments on this.
    --
    Retro Guy
    ---
    þ Synchronet þ RetroBBS - retrobbs.ddns.net
  • From Retro Guy@VERT/RETROBBS to All on Thursday, December 26, 2024 07:12:29
    Re: ddfilelister.js question
    By: Retro Guy to All on Thu Dec 26 2024 12:43 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;

    Any chance I'm breaking something else? (That's how I write code btw, by breaking other stuff :)
    --
    Retro Guy
    ---
    þ Synchronet þ RetroBBS - retrobbs.ddns.net
  • From Retro Guy@VERT/RETROBBS to All on Thursday, December 26, 2024 10:45:18
    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
  • From Nightfox@VERT/DIGDIST to Retro Guy on Thursday, December 26, 2024 08:48:21
    Re: ddfilelister.js question
    By: Retro Guy to All on Thu Dec 26 2024 07:12 am

    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;

    Any chance I'm breaking something else? (That's how I write code btw, by breaking other stuff :)

    I don't think that would break anything. And I could add that as a configuration option.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com
  • From Retro Guy@VERT/RETROBBS to Nightfox on Friday, December 27, 2024 08:46:21
    Re: ddfilelister.js question
    By: Nightfox to Retro Guy on Thu Dec 26 2024 08:48 am

    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;

    Any chance I'm breaking something else? (That's how I write code btw, by
    breaking other stuff :)

    I don't think that would break anything. And I could add that as a configuration option.

    That sounds good. I'm running this way now and no problems that I can see.

    -Retro Guy
    ---
    þ Synchronet þ RetroBBS - retrobbs.ddns.net
  • From Nightfox@VERT/DIGDIST to Retro Guy on Friday, December 27, 2024 19:12:04
    Re: ddfilelister.js question
    By: Retro Guy to All on Thu Dec 26 2024 10:45 am

    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.

    I've added this as a configuration option, and it looks like my update has been merged. With the latest update, there is a configuration setting, useFilenameIfNoDescription, which you can set to true (which is the default) to enable this behavior.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com
  • From Retro Guy@VERT/RETROBBS to Nightfox on Saturday, December 28, 2024 06:03:36
    Re: ddfilelister.js question
    By: Nightfox to Retro Guy on Fri Dec 27 2024 07:12 pm

    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.

    I've added this as a configuration option, and it looks like my update has been merged. With the latest update, there is a configuration setting, useFilenameIfNoDescription, which you can set to true (which is the default) to enable this behavior.

    Thank you for that. Now I don't need to make sure to keep my change on my next upgrade :)

    -Retro Guy
    ---
    þ Synchronet þ RetroBBS - retrobbs.ddns.net