What I have spent the last two days doing
Feb. 3rd, 2010 05:56 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Otherwise known as "Why I hate the proprietary CMS we use."
There are polls.
Polls display in iframes.
That's what the documentation says. It says file pollmini.pbo displays the questions and pollminichart.pbo displays the results after voting.
The problem with iframes is that some idiot always cranks up their font size or uses a font with kerning set reaaaaaaal wide, or really deep leading, and the they can't see the vote button and write to complain.
I discovered on their never-updated 'community solutions' site a package by one of their developers which uses ajax for iframes! Yay!
It was actually really easy to implement. I had to make a few tweaks for our particular uses. Here's the catch...
There's no documentation anywhere on any of the files which are involved. There's now pollminiquery and pollminiresultsentry and pollminiresultsentryitem and pollminiresults and ...oh jesus. And none of these have -any documentation at all-. I have working sample files. That's it.
And the genius who put this together left no kind of fallback for javascript disabled browsers. I don't like that. I don't like that at all.
So I cobbled together a work around.
First I use the proprietary tag to call the poll, normally. You get an ajax poll which won't even show up if you're not using a js enabled browser - you see blank space.
Then there's a noscript tag.
The noscript tag contains an iframe tag.
The iframe tag calls iframepoll.pbs
iframepoll.pbs calls the proprietary poll tag again, with an argument to use a different set of files ('objectclass2')
That calls pollminiquery2.pbo (as opposed to the default, pollminiquery.pbo, which was also already called by the first poll tag, but displays nothing because there's no javascript.)
pollminiquery2.pbo contains nothing but a metarefresh to the address that it's supposed to query for the ajax context. I can't link to this address in the iframe directly because it's dynamic and changes from day to day and poll to poll.
Which calls pollmini2.pbo (as opposed to pollmini.pbo which never GOT called because the js was disabled) which is the same as pollmini.pbo except the button is a submit button instead of a button with an onclick, and the action is the address it's supposed to submit to, not another javascript function.
...Because calling it in 'iframes' and 'noniframes' mode would be too hard.
And NONE of this is documented.
There are polls.
Polls display in iframes.
That's what the documentation says. It says file pollmini.pbo displays the questions and pollminichart.pbo displays the results after voting.
The problem with iframes is that some idiot always cranks up their font size or uses a font with kerning set reaaaaaaal wide, or really deep leading, and the they can't see the vote button and write to complain.
I discovered on their never-updated 'community solutions' site a package by one of their developers which uses ajax for iframes! Yay!
It was actually really easy to implement. I had to make a few tweaks for our particular uses. Here's the catch...
There's no documentation anywhere on any of the files which are involved. There's now pollminiquery and pollminiresultsentry and pollminiresultsentryitem and pollminiresults and ...oh jesus. And none of these have -any documentation at all-. I have working sample files. That's it.
And the genius who put this together left no kind of fallback for javascript disabled browsers. I don't like that. I don't like that at all.
So I cobbled together a work around.
First I use the proprietary tag to call the poll, normally. You get an ajax poll which won't even show up if you're not using a js enabled browser - you see blank space.
Then there's a noscript tag.
The noscript tag contains an iframe tag.
The iframe tag calls iframepoll.pbs
iframepoll.pbs calls the proprietary poll tag again, with an argument to use a different set of files ('objectclass2')
That calls pollminiquery2.pbo (as opposed to the default, pollminiquery.pbo, which was also already called by the first poll tag, but displays nothing because there's no javascript.)
pollminiquery2.pbo contains nothing but a metarefresh to the address that it's supposed to query for the ajax context. I can't link to this address in the iframe directly because it's dynamic and changes from day to day and poll to poll.
Which calls pollmini2.pbo (as opposed to pollmini.pbo which never GOT called because the js was disabled) which is the same as pollmini.pbo except the button is a submit button instead of a button with an onclick, and the action is the address it's supposed to submit to, not another javascript function.
...Because calling it in 'iframes' and 'noniframes' mode would be too hard.
And NONE of this is documented.