I finally created my own Web 2.0 application. This is different from Web 2 applications, which are classified “pipedream” and not “beta.” Thanks to the Web2.0V2Logo Creatr Beta it has a logo too:
Thanks to browser incompatibilities it only works in Opera 9 and secret internal builds at the moment. Perhaps it also works in Firefox 3, I haven’t tried. Anyway, Paintr 2.0 Beta is here for all your drawings, although I guess it’s more useful for sites accepting digital autographs, such as TransIP. (They are excellent. The only downside is their name; I keep forgetting it.)
I would appreciate feedback on my scripting style. What the best way of doing things is in ECMAScript is not always clear to me.
Who need canvas? :P (very very alpha)
Apparently the problem is that Gecko doesn't support event.offsetX. The coordinate-related DOM is a mess.
(Did I need to start the comment with xhtml doctype?)
The Gecko bug is 69787.
I've put a modified version there with some changes
for computing the position of the canvas and then using
clientX/Y. Hopefully, 174397 should make things easier.
I changed the CSS because having a margin on the html element has no effect on the
offsetLeft property of the body. I first thought it was a bug, but Opera behaves the same way, so I guess it's a design choice ;-).
I think the easiest way to get it to work in firefox is using position:relative on the canvas element, and event.layerX/layerY instead of event.offsetX/offsetY.
Quite nice! I would suggest you to add this as Opera widget, even though we have much more advanced painter. ;)
Anne this is uber cool. Can't live without it. Bye Bye MS Paint.
This app is great! I dumped photoshop to use this superior design studio instead! I even designed a house with it!
Jan de Mooij: Thanks for the tip, how could I have missed that ;-). Now the changes are much smaller.
Anne, feel free to apply the patch if you want Gecko compatibility.