Make JS output of lightbox2 module themeable
| Project: | Lightbox2 |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
One of the changes that was added in Drupal 6 was the ability to make JS output from modules themable so it is overridable in themes. There are some sketchy details about this at http://drupal.org/update/modules/5/6#javascript-themeing. A good example I found in the Active Tags module JS: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/active_tags...
Basically, this would entail name-spacing all JS functions in Drupal.theme.prototype.XXX, and calling them indirectly, like Drupal.theme('XXX', arguments). Then a theme could provide its own JS that defined a function Drupal.theme.XXX and overrode the module's defaults.
Assigning to self. I'll try and workup a patch over the next couple days.

#1
Hm. Actually, the client discovered a workaround where you can sub-class the Lightbox object and override its modalHTML property. Since this alleviates the need for directly modifying the module's files and thus fulfills the client's needs, I no longer have time allocated to work on this.
It would still be something cool to do though for consistency, but I'm not sure how extensive changes need to be done to get it to keep the class-based approach along with the themeable output. An exercise for the module maintainers with more intimate familiarity, I suppose. :)
#2
Just ran into this as well. Its a bit of a monster task I think, but this is my way of subscripting and reminding myself to take a stab. CTools modal JS files as well do a good job of Drupal.prototype.theme .