CustomUI

 From:  Max Smirnov (SMIRNOV)
6507.253 
Hi Michael

>>I've been thinking that for the next beta how about if I have MoI look through some specific directory in AppData for any .js files and if any are found it will execute them.
It's a good idea. I thought about one file (something like autorun.js), but if you make a separate directory it will be much better. In this case the execution list should be sorted by name, so we can manage the order of execution.

>>I'll also put in an empty named container element in CommandBar.htm by default that can be used as a target for where to insert controls.
You can give a name to <flex> container.

>>A couple of issues are - what should the directory containing scripts to execute at startup be called, maybe just plain "startup" ?
Yes. Startup is a good name.

>>I guess there should also be a "commands" and "scripts" directory that you could make there as well. But then will having MoI look in 2 different commands directories for things cause problems since currently there's only one that is identified by moi.filesystem.getCommandsDir()?
In my opinion the moi.filesystem.getCommandsDir() command should point to commands directory with MoI's built-in scripts.
For a user commands directory you can add another command. something like moi.filesystem.getUserCommandsDir()
But do we need it? I think moi.filesystem.getAppDataDir()+"commands\\" will be enough.

>>And what should happen if there is a file with the same name in both places, which one should be actually loaded?
I think the current commands directory with MoI's built-in scripts should have higher priority.

>>Also when should startup scripts run - probably just before the main window is shown?
Yes.
I don't remember, does MoI have a command which refreshes MoI UI? It can be useful in some cases.