Page 1 of 1

Skin Editor

Posted: Mon Jun 04, 2018 10:51 pm
by malkierian
Hey, I was thinking it might be nice to have an in-app skin editor (for small edits, like colors and fonts and such), and am even willing to build it, but I couldn't find anything in the API that had anything to do with CSS, LESS, or skins at all. Even if there was just a way of finding out which skin the user currently has running, I could probably figure it out, but it would more likely require access to LESS processing, file I/O, skin reloading, etc. Would this be something you guys might be willing to consider putting in, so I could make it, or is this a pipe dream?

Re: Skin Editor

Posted: Tue Jun 05, 2018 7:30 am
by jiri
Hi, yes, looks like a useful tool. As for the api, you might need app.currentSkin() and app.currentLayout() to know what to edit and window.doReload() to apply the skin changes. This currently performs a complete window re-load, in order to properly apply any possible changes in JS (a skin can contain any custom JS code). We'll also try to add another api function to just reload CSS, in order to be able to perform quick hacks.

Jiri

Re: Skin Editor

Posted: Tue Jun 05, 2018 3:17 pm
by malkierian
I'm still not seeing currentSkin or currentLayout in App in the API reference (I'm using the one linked to in the announcement). Am I looking at an outdated reference? Also, are scripts/addons currently capable of loading and saving files on the filesystem?

Re: Skin Editor

Posted: Wed Jun 06, 2018 7:20 am
by jiri
Sorry about this, the docs missed some newer stuff, it's updated now (including new filesystem methods).

Jiri

Re: Skin Editor

Posted: Wed Jun 06, 2018 3:18 pm
by malkierian
Cool, I can see them now. May I request adding a Skin class to the system that will contain info like what's in the info.json, as well as the skin's system file path? Right now there's no way to guarantee you're getting the right skin path just based off of the string that App.currentSkin() returns. Access to the CSS and LESS engines would be helpful, too, but not necessary.

Re: Skin Editor

Posted: Wed Jun 06, 2018 3:35 pm
by PetrCBR
Skin's are located always in 'Skins' subfolder where MM is installed.

Re: Skin Editor

Posted: Wed Jun 06, 2018 4:16 pm
by malkierian
Yes, but the name registered through info.json can't be guaranteed to correspond to the name of the folder in which that skin resides in.

Re: Skin Editor

Posted: Thu Jun 07, 2018 4:54 am
by PetrCBR
For a next build i've updated skin API. Using app.getSkins() (and app.getLayouts()) you will receive list of objects with these properties: title, id, description, version, author, path, isCurrent. For skin/layout load you can use methods uitools.activateSkin(skin) or uitools.activateLayout(layout).

Re: Skin Editor

Posted: Thu Jun 07, 2018 11:14 am
by malkierian
Awesome, thanks PetrCBR. I look forward to trying them out.