Oh hmm, I didn't notice the one second timeout part of your code until you mentioned this.
Reading the spec, it definitely seems like this isn't a requirement if the initial content is below an unspecified size. While I understand that you and a lot of folks would probably just like to have this politeness built-in, it isn't clear to me that's the case for everyone (or a large majority). @mlgore : I'm curious in your case, would you want this for all ads?
I think I'd rank the most "ideal" cases like:
having an ad builder system that keeps track of sizes all along the way and lets you specify what's needed for initial content vs. host initiated subload. This adds a lot of tool complexity though.
Automatically using a timeout if the content is above a certain size
Having an option to use this or not on a per-ad basis, possibly with some user default setting
(there could even be combinations of these)
For now though, maybe the best route forward is to make an "IAB Polite" export script, that basically works as you made it. Shall I take a stab at this?
Would you mind sending a zip of your .hype document?
It looks like the problem is from changing the hype main content <div> tag to an <a> tag, but I'm not sure why that would be a problem. I can probably figure it out quickly with the document.
I assume this is because the hype document has this code in the head html as well. With an export script that adds it in, it will no longer be necessary to manually add it.
Thanks! With that document I was able to quickly track down that the <a> tag didn't quite work right with the flexible layout that you were using. (I'd also wonder if you need flexible layout on that ad?, but that's beside the point)
I added a fix to the latest commit; would you mind trying the latest version again?
Please use the same steps to download, copy, and chmod as above:
(just replace the existing IABPoliteAd.hype-export.py file with this newer one)
Sorry for the delay, but now I have received feedback from my contact at MediaImpact.
He tested the banner I exported with your script and said that everything is wonderful. Polite works, clicktag works, and the flexible layout works as well.
Thank you Jonathan for the effort and time you put into this scripts and the AxelSpringer script. This makes my job immensely easier and hopefully everyone else who has to deal with MediaImpact (or Axel Springer).
Even though Hype is not primarily intended as a tool for creating advertising banners, together with the export scripts it is a very powerful and unique tool that I would not want to do without.