Martin Atkins (mart) wrote in fotobilder,
Martin Atkins
mart
fotobilder

Cross-browser DHTML Realisation

The suckiness of it all just hit home.

It was all going really well, until I noticed this interesting discrepency: In Mozilla events fire with a scope chain starting at the object which fired the event, then the window containing that object. In Internet Explorer 6, events fire in the scope their event handler was defined in. Given that I'm used to how CODE refs work in Perl, I was expecting the latter behavior, and it was all going well until I got to cross-browsering my clicky-choose-hue box.

What's more, Mozilla doesn't seem keen on letting my window talk to window.opener, so I can't fake IE's behavior by making explicit calls into the parent window's scope. I'm just wondering if any of those folks who said they do this kind of thing for a living want to give me a hint on how to get around this one…

Might as well throw in a screenshot, too.

The lightness gradient is off by one pixel because of the bug I reported a few minutes ago regarding colour transformations on the full 256-colour palette.


Update @ 2:05GMT: It's fixed, and it wasn't nearly as painful as I was expecting:

  // Copy some functions into the picker's scope so events can hit them
  p._HSVtoRGB = _HSVtoRGB;
  p._varstoform = _varstoform;
  p.setBGColor = setBGColor;

It's an ugly solution, but it works and doesn't involve duplicating anything apart from three references, which I assume are pretty small. I'm back on track now.

Subscribe

  • 302: lj_dev

    In the interests of consolidating all FotoBilder development-related discussion, we're going to be closing down this community. The same…

  • Development stalled?

    Is the development of Fotobilder held? Stalled? I am asking because there is no activity on the community and there is no link to the Fotobilder…

  • (no subject)

    Does FotoBilder works with Apache2? I installed all the required modules on my debian sarge, and when I restart my apache server, it dies horribly…

  • Post a new comment

    Error

    Comments allowed for members only

    Anonymous comments are disabled in this journal

    default userpic
  • 11 comments

  • 302: lj_dev

    In the interests of consolidating all FotoBilder development-related discussion, we're going to be closing down this community. The same…

  • Development stalled?

    Is the development of Fotobilder held? Stalled? I am asking because there is no activity on the community and there is no link to the Fotobilder…

  • (no subject)

    Does FotoBilder works with Apache2? I installed all the required modules on my debian sarge, and when I restart my apache server, it dies horribly…