In hook_init() we add lightbox.js unless you explicitly state where it is used and where it isn't used. This means that it appears on every page, whether or not it has a Lightbox2 element. This JavaScript file is huge and it puts load on the client's browser. It would be nicer if we provided context to it, so that lightbox.js is only included when it is needed.

Comments

stella’s picture

It's kind of difficult to judge where the lightbox.js file is or isn't needed in the php code. The majority of the work is done in the Javascript. Lightbox2.module has no way of knowing if there are images on the page, either manually added in the node body, or through say an image block.

This is something that has annoyed me for a while and if you have any ideas on how to make this happen, I'm certainly interested. Catch me on irc if you want to talk through this. For now though, this just gets added to my very long todo list. :(

Cheers,
Stella

stella’s picture

Status: Active » Closed (fixed)