I want to be able to perform actions during the update of a Microsummary. This would enable microsummaries to do everything from use a notification system to modify the UI of the microsummary to indicate change.
I am proposing that we add a new optional element to the microsummary xml format:
In the CDATA section can exist optional function callbacks that happen at various points in the processing of the microsummary. One that I have identified quickly is during the update of the microsummary which happens periodically. I have defined that to be:
When the microsummary is updated, we will check for the existence of this function, and if it does exist, we call it. It might be that we pass paramaters to it at some point, or add new objects or functions into context in which it runs. One such function which I have added is:
microsummaryLog( string );
Which will log messages to the console service.
The context of which it runs will be a non-privileged context (sandbox).
Created attachment 245823 [details] [diff] [review]
this is sorta of not completely baked. I am posting it now so that (a) I don't forget and lose these changes, (b) I can get jst to help look at the security of the sandboxing I am doing -- specificaly with repect to which principal I am using, and (c) to get some early feedback from myk on direction.
A few notes that might be interesting:
1) I am not sure if i am calling this._sandbox.onMicrosummaryUpdate(); in the right place. i seams that I am doing alot of waiting around before update is called.
2) i short circuited _updateInterval() and LOG()
3) I am wondering if there is an easier way to get the CDATA from the handler element -- a while look on the children checking for type seams pretty dumb.
4) jst -- Components.utils.Sandbox("")... what should the string be? Also, why is it failing? Is it because the URI that I am passing hasn't been loaded yet? Maybe the empty string is the right thing to do?
Regarding UI modification on microsummary update:
At least something can be done using CSS, see e.g.
which implements tinderstatus using a microsummary: colours and icons of the microsummary depend on the status of the microsummary text.
Your suggestion is much more powerful, of course - until CSS allows embedding of JS ;)
mass reassigning to nobody.
- BUGSPAM -
Wontfixing all Microsummaries bugs, since the feature has been removed from the core product and previous versions won't get further fixes for it.
If interested in supporting Microsummaries in your add-on, you're free to use our old microsummaries code and to search all previously open bugs by looking for [microsummaries-feature-removal] in the status whiteboard field.