svg/Javascript with Seaside

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

svg/Javascript with Seaside

Anja Guzzi
Hello,

Hoping to be clear enough, I will try to expose my problem.

I'm building a Seaside application, using svg components (SVG  
elements implemented using the WATagBrush class).

I would like to be able to "drag" around my elements. I know this is  
possible using some javascript code.
So, I have my svg elements and the javascript code (linked to my  
application using the updateRoot method)... but i dont know how to  
make it work.


I see that in the Seaside.WATagBrush class there are some methods  
like "onMouseOver", "onMouseDown",.. could these be any useful to me?


Any help is appreciated :-)
Thanks,
Anja




--
Anja Guzzi
[hidden email]


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: svg/Javascript with Seaside

Lukas Renggli
> I see that in the Seaside.WATagBrush class there are some methods
> like "onMouseOver", "onMouseDown",.. could these be any useful to me?

These are the standard DOM events. I assume that they are supported by
SVG as well. So for example you can write something like this:

    html div onClick: 'alert("got clicked")'; with: 'click me'

For the drag & drop part this doesn't sound like a Seaside issue.
Personally I do not have enough experience with SVG to tell you where
to find a solution. Probably there are JavaScript libraries around
that can help you with that.

If you have a look at the Scriptaculous package (there is a demo at
http://scriptaculous.seasidehosting.st) you will see that this
framework and its JavaScript library provides support for drag & drop
in Seaside on the level of the XHTML DOM. I would be astonished if it
worked on SVG as well, but you might get some ideas from the code.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside