Tab-Labelizer - Extend the folder names shown in your tabs

What properties are you talking about?

I think it was "ActivateTabData", which now uses ".newtab" and ".oldtab" instead of ".new"/".old". The latter variant has always been a bit problematic as "new" is a js-keyword and needed a workaround (using ActivateTabData["new"] notation). This change is welcome, I do not recall a hint on that though. Now that I write this, I feel like this has been talked about some weeks/month ago, but as the script worked up to some latest beta, these props must be quite new I think.

The change was in the release notes, and the old properties are actually still there (just undocumented), so it wouldn't have broken any existing scripts.

Ok, then I must have misinterpreted a script error and did not read that beta-description of 11.4.1 thoroughly enough in may! o)
Sorry for being wrong, it wasn't meant offensive anyway, you know that! o)

Hi tbone. My latest changes were in version 1.1e. Look FW to the new version :slight_smile:

The error was caused by change in Directory Opus 11.5.5 (beta).

This meant that you could not call string methods (like resolve in our case) on the path object returned from the Resolve method. You can see object type using this code

Object.prototype.toString.call(path)

Updated the script to V1.2, it now requires DOpus 11.7

  • Updated to be compatible with DOpus 11.5.5 and later versions (fixed bug caused by change to Resolve method).
  • Added config descriptions (new feature in DOpus 11.7).
  • Added ExtendedConfig, which is multiline config (new feature in DOpus 11.7). the internal JSON config can now be edited in the config window.

Re the ExtendedConfig. I took the JSON object that is in the code and stringify'ed it. This can then be edited by the user saving them from needing to edit the script. Stringify'ing the JSON object is nice as we don't need manually convert it to a string in code which would require lots of escaping. One downside is the extended config comments that are in the code don't show in the config window. Not sure if I have created any performance issues here.

Feedback most welcome.

Tbone, I guess we are the only ones that use this script as no one else seemed to notice that it was not working any more.

Hi wow!
I don't think we are the only ones, I mean there have been 73 + 20 downloads so far. But I agree, quite strange that nobody came back to tell it doesn't work anymore. o) Maybe most of the poeple do not upgrade as often as we do, so the former version may still be in charge and some may fix things on their own, who knows. o)

Thanks for providing this version. I'd like to call that an intermediate-fix-version, as the work in progress on my side takes account of everything you added and more. I unfortunately lag behind finishing it, so it's good to have that. I move that version to the thread opening and would like you to remove it right above, alright?

EDIT: Done, descriptions and instructions changed a bit to reflect your changes.

Hi tbone, the one posted as 1.2 has the wrong version number.
I have updated it and added support for the script wizard.

Thanks wow! o)
I pulled that as v1.3 into the thread opening to avoid confusions.
Because there is SW support from now on, a small version increment surely doesn't hurt.

Do you mind removing all of your recent snippets and uploads to keep this thread a bit shaped?

Updated to v1.3.1:

  • fix to prevent error messages for empty tabs

@wow, thanks for the cleaning job! o)

Good pick up tbone.
Can we make that configurable? I would rather it say 'Empty Tab' than '-'.
You forgot to update the version in the script to 1.3.1. Perhaps this is something the SW could detect?

The script has progressed a lot since you first wrote this little gem. The first post is a little out of date, it does not talk about the setting the title. Might be worth doing a review.

I noted recently that dopus has built in ability to shorten a path. I does it in some dialogs. Do you know if that functionality is exposed?

Updated to v1.3.2:

  • version increase and configurable label for empty tabs

Yes, I agree. o) The thing is, I have another branched and enhanced version in "progress", I already mentioned it here: Tab-Labelizer - Extend the folder names shown in your tabs Now that was in August last year, oops. o) I'm going to overhaul the intro once that version is done.

A nice addition might be to show the FTP site bookmark name (if available) in the tab.

You can sort of get this already by adding this to the location config:

      "^ftp://SITE=(.*)\\?.*@.*//",
      "ftp://$1://",
      "^ftp://(.*)%20(.*)$",
      "ftp://$1 $2",
      "^ftp://(.*)%20(.*)$",
      "ftp://$1 $2",

But it's not ideal as I think you need to keep the last pairs (with the %20 stuff) if you want to handle site names with more than 2 spaces, and it won't handle other encoded characters. Running decodeUrl on the name should fix it up, but requires modifying the code.

With the above, you also end up with tab names like:
ftp://My Site Name//current folder

But this might be nicer:
My Site Name: current folder

I couldn't work out if there's a way to get that using the config alone. It seemed to lose the whole thing if I didn't keep the ftp:// prefix there, so I guess it's being handled specially.

Maybe an option for special FTP site handling might be nice? I could add it myself if you want, but I didn't want to fork the code & confuse things, and maybe you want to do it in a particular way.

Is it me or v.1.3.2 (latest one) doesnt work in DOpus 12? I get the path unfolding, but I dont see the path aliases changes.

What' you mean with "path unfolding" and "alias changes"? What type of location/path is it you see this?

Btw: I'd be happy to have updated this add-in and incorporate your suggestions as well, Leo.
Unfortunately, I didn't find the time and mood yet. So much more which is in the queue, damnit. o)

1 Like

this is how my new - opened tabs appear after default activation of the script..
I can see the unfolded path but none of the location name replacements (ex. C:\ = (sys) )

I have updated the script to 1.4.3

Changes:

  • Fix for aliases not working.
  • Added feature, show friendly FTP site name. Added new config item frendlyFtpHostName.
  • Added feature, show drive label instead of drive letter. Added new config item showDriveLabel.

Tab-Labelizer.js.txt v1.4.3 (35.1 KB)

This has been fixed.

Also discussed here Ftp path, Site name instead of Host address - #7 by Leo

Nice idea, this has been added. There is a new config for this frendlyFtpHostName, it is defaulted to true.

From this thread Drive labels on tabs?

This has been added, There is a new config for this showDriveLabel, it is defaulted to false.

I have updated the script to 1.5.0

Changes:

  • Added feature to set the title of the Standalone Viewer. Added new script config EnableVieweritleUpdate Defaulted to true.

Tab-Labelizer.js.txt v1.5.0 (37.0 KB)

image

@tbone Given the script now allows the Window, Tab, and Viewer titles to be updated, might be time for a rename? DOpus-Labelizer perhaps?

"EnableVieweritleUpdate" -> where is the missing "T"? Even in the code it's spelled wrong, wtf?! o)

Thanks for your updates! o)

Regarding the rename, I'm not so sure. "Labelizer" conflicts with the various titles being set for Windows/Viewers. Only tabs seem to have labels? So you might not make things much clearer when renaming "Tab-Labelizer" to "DOpus-Labelizer"(?). I'm not against a rename in general, but I don't think it's a necessary move, fixing some internals would make more sense to me. o)

Consistency is key....

I have updated the script to V1.5.1

Changes:

  • EnableVieweritleUpdate -> EnableViewerTitleUpdate
  • Performance improvement, only run when needed.

Tab-Labelizer.js.txt V1.5.1 (37.3 KB)