We need onSmugmugDoneCreatingPage event
jfriend
Registered Users Posts: 8,097 Major grins
It is getting more a more difficult to write scripts that modify Smugmug's pages. This is because we have a harder and harder time knowing when Smugmug is actually done building the page. It used to be we could use YE.onDOMReady. Then, Smugmug started using YE.onDOMReady to add things to the page (buttons, etc...) so it because hard for us to know when all of Smugmug's code was done adding things to the page.
How, I find that certain flash objects not only don't work on just onDOMReady, but they finish initializing themselves on a setTimeout call which makes their initialization very indeterminate.
So, if we want to run our own scripts to modify the page when Smugmug is done putting things in the page, it's a nightmare to do it reliably without causing problems.
ALL we need is one simple page level event when all of Smugmug's code (including the building of flash objects and buttons and anything else built with JS or built on timers) is done. This would make modifying the page a lot more reliable, would make the technique for doing it not vary depending upon what page you're on, etc....
I've asked for this before when the YUI buttons first appeared and were added via onDOMReady. But, I never heard one way or the other whether anyone at Smugmug thought this was a good idea or was even interested in the topic at all.
The consequences of not doing this right is that we have scripts (like the one that moves the slideshow button to the same line as the cart buttons) that work fine for a year, then Smugmug changes something and people's pages stop working because of some timing conflict with customization scripts they have and we can't even find a way to make the customization work any more, much less make them work in a way that will be safe for the future.
We could have a lot fewer page creation timing issues if there was a simple event when Smugmug was done building the page that signified that is was now safe for us to modify things to our liking.
Here's one thread where we're tracking down one of these timing issues now and I'm trying to hack a super defensive script that won't cause problems and am not having any luck. Worse yet, the timing issue is brower-specific and doesn't happen on my system (the worst kind).
How, I find that certain flash objects not only don't work on just onDOMReady, but they finish initializing themselves on a setTimeout call which makes their initialization very indeterminate.
So, if we want to run our own scripts to modify the page when Smugmug is done putting things in the page, it's a nightmare to do it reliably without causing problems.
ALL we need is one simple page level event when all of Smugmug's code (including the building of flash objects and buttons and anything else built with JS or built on timers) is done. This would make modifying the page a lot more reliable, would make the technique for doing it not vary depending upon what page you're on, etc....
I've asked for this before when the YUI buttons first appeared and were added via onDOMReady. But, I never heard one way or the other whether anyone at Smugmug thought this was a good idea or was even interested in the topic at all.
The consequences of not doing this right is that we have scripts (like the one that moves the slideshow button to the same line as the cart buttons) that work fine for a year, then Smugmug changes something and people's pages stop working because of some timing conflict with customization scripts they have and we can't even find a way to make the customization work any more, much less make them work in a way that will be safe for the future.
We could have a lot fewer page creation timing issues if there was a simple event when Smugmug was done building the page that signified that is was now safe for us to modify things to our liking.
Here's one thread where we're tracking down one of these timing issues now and I'm trying to hack a super defensive script that won't cause problems and am not having any luck. Worse yet, the timing issue is brower-specific and doesn't happen on my system (the worst kind).
--John
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
0
Comments
The more Smugmug adds things to the page dynamically, the harder it is to write problem-free javascript that also modifies the page.
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
For a long time, I've wanted to us to have a js framework for different Smug events. And we have discussed it several times internally. But it's not really my area, probably Lee or Jimmy...maybe another sorcerer.
Cheers,
David
SmugMug API Developer
My Photos
Hopefully Lee or Jimmy will drop in with a comment some time.
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question