The library should not be loading on every page as long as the module is enabled (in hook_init).

If another module wants to load the library it can do so on just the specific pages it is needed on.

If you want to make it easier for less technical people to use then auto loading of the library on every page should be an administration setting that can be turned on or off.

Comments

frob’s picture

Category: Bug report » Feature request
Status: Active » Needs work

Yup, patches welcome.

Not really a bug, more of a feature request.

Really what would be needed here is an interface that allows users to not only load the lib per page, but also add settings without writing JS. If we were going to write a useful UI then that would need to be included. Loading the js doesn't really do much except allow someone to call the lib in their own JS. I agree, we should just remove this from hook init.

rooby’s picture

Status: Needs work » Needs review
StatusFileSize
new393 bytes

Here is a simple patch to remove the loading.

frob’s picture

Status: Needs review » Needs work

It would be better if it allowed configuration of what pages that it would load on.

rooby’s picture

Maybe that could be a follow up issue?

frob’s picture

Assigned: Unassigned » frob

seems reasonable. I will try and review this patch later today.

  • frob committed e240dd7 on 7.x-1.x authored by rooby
    Issue #2447065 by rooby: Don't load the library on every page
    
frob’s picture

Status: Needs work » Fixed

Done, and it only took 19 days!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.