@rudibarani,
Ok, the development branch now has support for the new class name changes. When a module is shown on a page, it will be given the class page_{Current Page}
and then the class will be removed when the module is hidden.
Read the statement by Michael Teeuw here.
Posts
-
RE: MMM-Page-Selector: A page switcher that can set positions of modules
-
RE: MMM-Page-Selector: A page switcher that can set positions of modules
Ah right. I need to get around to making those changes. I’ll start on them in the morning.
-
RE: MMM-Inspirational-Quotes is now here
It’s truly a gem of the internet and I’m glad that I could share it with the world.
-
RE: MMM-Page-Selector: A page switcher that can set positions of modules
Hey @rudibarani,
If there are no errors being thrown, then I would make sure that you are on the development branch and not master as I am still not sure how stable some changes are so I am refraining from merging.
If that is not the problem, I would open up thenode_helper.js
file and putconsole.log()
statements in some places to make sure they are running correctly.- Line 30 should be
self.restorePage()
. I would put on right before that. If it never runs, then there is a problem with how the frontend is handling the config. - Line 38 should then be
jsonObj = JSON.parse(obj);
. I would print out the value ofjsonObj
right after that runs to see if thepage
key is in it. - Line 57 should then be
reject(err);
. I see that I accidentally didn’t include any debug information when this rejects so put a log that prints out the error directly before this.
If the problem isn’t immediately obvious, posting the output of those logs would go a long way to figuring this out.
- Line 30 should be
-
MMM-Inspirational-Quotes is now here
The moment we have all been waiting for is upon us. That is if you have been waiting for the moment when bot-created inspirational quotes can be delivered directly to you through the medium of a magic mirror.
Just to be clear, most of these quotes will not make you inspired, but they will all make you laugh so I think that’s a good trade-off.
The image generation is done using inspirobot and this module is simply a wrapper for it.
Download and usage instructions can be found on the Github Page
-
RE: MMM-Page-Selector: A page switcher that can set positions of modules
Oh, that’s odd that it is going in inverse order. I must have made a mistake somewhere. I’ll be looking into that and reversing it.
I have finals coming up soon which means I don’t have very much time to support this and a more intuitive way of ordering the elements will take a bit of time.
Can you clarify what you mean with your last statement? If I am interpreting it correctly, you are saying that you would like a way of specifying CSS for specific pages. If I’m not mistaken, this would be a pretty quick and easy change as I would just update the class list to include the current page name.
-
RE: MMM-Page-Selector: A page switcher that can set positions of modules
@rudibarani Good to know that’s a solution.
Right now, modules are stacked in the order that they appear in the config file. If a module is above another in the config, it will be above that other one on the page.
However, with a little work, that could be changed. Do you think that it would be helpful to be able to change that on a page to page basis? -
RE: MMM-Page-Selector: A page switcher that can set positions of modules
@rudibarani
Good stuff. I’m glad everything is working out. -
RE: MMM-Page-Selector: A page switcher that can set positions of modules
Hey robiv,
I do actually prefer to have issues opened on GitHub. That way I can more easily keep track of them and also it provides a record of my work in case I want to use it in order to prove my merit.
Thanks for asking. -
RE: MMM-Page-Selector: A page switcher that can set positions of modules
Yep, I can verify that it is in fact WatchDog.
I can also provide an explanation and a patch that you can do yourself. The way I made it possible to not include theposition
prop anymore is by building a temporary config, loading that one, restarting magic mirror, and then replacing the temporary with the original. I’m really sure of the underlying reason, but this process seems to trigger WatchDog to trigger an abort.
As robiv says, combined with pm2, this causes a restart loop.
The two easiest ways to get around this are:- Don’t use watchdog. If you don’t think that you are going to experience crashes, then that works
- Give a position prop to every module. Including position props doesn’t change any of the visual function and that way, Page-Selector never triggers a restart and the problem doesn’t occur in the first place. The config for any given module should follow this format:
{ module: 'MMM-module-name', position: 'any_position' //It doesn't matter what it is disabled: false, config: { ... } },
I will try to find a way to make the modules play well together, but that might take a while.