Great work Jeff. You've done the heavy lifting for the rest of us wanting to use Prototype/Scriptaculous.

I'm musing about the best way of structuring extensions to this. Doing each widget or component using S/P AJAX as a separate module (one for menus, one say for popup or draggable text, etc.) seems like clutter. Could we, e.g., (thinking out loud here) create an extensions directory, containing .inc files, that is read in at Administer -> Settings -> spajax. A hook, e.g., _capabilities, could then load descriptions of each extension, and then the admin would select which to enable.

Comments

jjeff’s picture

Yeah, I thought about this. The main problem is that these "submodules" wouldn't have access to the hook system - meaning that if spajax_mm was an .inc file rather than a .module, its _menu() or _help() wouldn't get called.

But are you talking about the actual spajax.module functions themselves? Hmmm... Interesting... Is there an overhead to having separate .inc files as opposed to one big one? Is there an advantage to being able to turn on/off each individual function? One downside is that all of the documentation starts to get spread out. It is nice to be able to have everything in one file in that regard.

I do agree that there needs to be some better structuring of the code in this module. Some functions output strings, while others output a script directly to the page.

Thanks for your ideas. I hope this will spark some discussion to help knock this module into shape.

-Jeff