Major progress on the Protaculous Action today. I have revved all of the Actions to use the latest version of Prototype and Scriptaculous. I also included controls to use the packed version of these libraries.
In the process, there have been a few changes to the base Protaculous Action.
You can no longer choose one or more component libraries from Scriptaculous. This is offset by the ridiculous file size savings possible from using the packed versions.
There are now two window events that you can observe: dom:loaded and window load. They are different from one another, and have different uses. When the DOM is loaded, that means that all of the elements that will make up the page are loaded into the browser’s memory. Not all resources have been downloaded, the page may not even display at this point. This is the time to do things like set up listeners for events or hide things that are supposed to appear later on. When the window loads, the entire page, images and all, have finished downloading. This is the time to do things like start animated effects, pop up alerts, etc. It’s also the time to add more sensitive listeners that need the entire page to be really ready in order to work properly.
There’s a new Item Action called Observer. You can use it to attach event listeners to individual objects on the page, in the click, dblclick, mouseover or mouseout events. These listeners are set up in the dom:loaded event, so they are ready to go before the page has even finished loading.
Give it a try, and see what you can do with it. I’ll post some recipes later on to give you a few starting points.
No matter where it is.
That’s because the packing process reduces the entire library to a single (very long) line of code.
And that’s why there’s a switch in the Actions to let you pick the “more readable” option, even though it’s a much bigger download. While you’re debugging (locally, even) file size will not be a problem. When you have everything working, just switch over to the packed version and watch your page size shrink like magic!