Closed derinb closed 8 years ago
Third party add-ons can request rotation by Personas Plus Component help like this:
Components.classes['@personasplus/bootstartup;1'].getService().wrappedJSObject.requestRotation();
Just a reminder, in case it is missed under work pile
I didn't. It was just weekend :)
I'm not really comfortable merging this. #51 lists some serious issues with the rotation code. We shouldn't export it if it's broken.
Also, https://github.com/mozilla/personas-plus/issues/51#issuecomment-240186054 shows a potential way for other add-ons to just rotate themes themselves if needed. I'd like to understand first why that approach does not work.
Thanks. Creating rotationTimer
is easy but there are more to rotate personas.
The rotation feed and category details are fetched from Personas Plus. Because Personas Plus used to be an overlay add-on, it was easy to gain access PersonasPlus JS object in global window context. But because now Personas Plus is bootstrapped and has its own scope, no other external add-on can reach its methods.
Before rotation, Personas Plus chooses a persona among fetched favorites.json or featured.json. I can create rotationTimer easily but because I can not access Personas Plus methods without component, it does not help much.
OK Andreas I am closing this in a few hours if it is OK for you.
It would be great if we could keep the rotation feature by Personas Plus, because my add-on was companion for Personas Plus. Users will complain but it seems we are going to remove all rotation code from Personas Plus.
I'm fine with keeping rotation code but then we need to fix it. Neither users nor extension developers like you will be happy if code or features you want to use is buggy.
Actually there is not significant issues. But activating rotation requires at least 3 preferences which is not easy for users. So GUI is needed. Rotation works as expected with my add-on GUI.
But Amy and Jorge do not want to include GUI for rotation. If we keep rotation code in Personas Plus, then we should expose API so that other developers can use it.
So I am not sure what to do next.
Andreas, it seems to be about Groovy Blue theme details and migration from GetPersons.com to AMO. Am I missing something?
Andreas, should I close this now?
Personas Rotator users waiting an update. I will code the new Personas Rotator according to this PR.
If this is accepted, I continue the Personas Plus as almost with the old one.
But if the methods are not exposed, I need to find a way to check featured.json downloaded or not.
I can understand exposing methods are not preferable for security reasons but I took my chance, anyway :)
@wagnerand is on holiday starting today, so he may be very slow to respond.
Oh thanks for the feedback Jorge. I think he was not keen to accept this PR. I will close the PR in a few hours.
It will be difficult but I will try to restore back functionality for Personas Rotator without exposing.
For rotation add-ons, some methods need to be exposed.
Component named
PersonasPlusStartup
is registered/unregistered inbootstrap.js
.requestRotation
method is exposed. When it is called, it asksPersonaController
to switch them byaskRotation
method.Because
PersonaService
is actually handles rotation,askRotation
method actually callsPersonaService._rotatePersona
method.