Last modified: 2014-02-20 19:23:31 UTC
From an email, from Daniel Schwen (CC'd): > Ideally I'd like to have a > * pre- and post- opening of the viewer hook > * a hook that is called when the displayed image in the viewer changes, > * and a hook [to] feed a list of 'next' and 'prev' images to the viewer. We've been thinking about a hooking infrastructure, and this seems like a good list to start with. Thanks Daniel!
Note: the lightbox JS code used by the extension already implements the following hooks: - closeInterface (when the viewer is closed) - imageLoaded (when image is done loading) This is documented at /MultimediaViewer/resources/multilightbox/hooks.txt So we can reuse these twos for our own hooks.
Please write coherent bug summaries.
The course has changed on this, we're now using custom jQuery events. They serve the same purpose. But we've decided not to preemptively add hooks that aren't used yet, this was attempted with lightboxHooks and is hard to do well without a real need. I think it's too early in this extension's lifespan to guess ways people will customize it/hook into it. So for now we'll only create events that are being used in mmv itself to communicate events across isolated components.
FYI we'll want to use https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.hook instead, in the future.