Skin Editor

To discuss development of addons / skins / customization of MediaMonkey.

Moderators: jiri, drakinite

malkierian
Posts: 149
Joined: Wed May 10, 2017 1:38 pm
Contact:

Skin Editor

Post 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?
jiri
Posts: 5399
Joined: Tue Aug 14, 2001 7:00 pm
Location: Czech Republic
Contact:

Re: Skin Editor

Post 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
malkierian
Posts: 149
Joined: Wed May 10, 2017 1:38 pm
Contact:

Re: Skin Editor

Post 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?
jiri
Posts: 5399
Joined: Tue Aug 14, 2001 7:00 pm
Location: Czech Republic
Contact:

Re: Skin Editor

Post by jiri »

Sorry about this, the docs missed some newer stuff, it's updated now (including new filesystem methods).

Jiri
malkierian
Posts: 149
Joined: Wed May 10, 2017 1:38 pm
Contact:

Re: Skin Editor

Post 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.
PetrCBR
Posts: 1704
Joined: Tue Mar 07, 2006 5:31 pm
Location: Czech
Contact:

Re: Skin Editor

Post by PetrCBR »

Skin's are located always in 'Skins' subfolder where MM is installed.
malkierian
Posts: 149
Joined: Wed May 10, 2017 1:38 pm
Contact:

Re: Skin Editor

Post 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.
PetrCBR
Posts: 1704
Joined: Tue Mar 07, 2006 5:31 pm
Location: Czech
Contact:

Re: Skin Editor

Post 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).
malkierian
Posts: 149
Joined: Wed May 10, 2017 1:38 pm
Contact:

Re: Skin Editor

Post by malkierian »

Awesome, thanks PetrCBR. I look forward to trying them out.
Post Reply