Hi.

We've been able to integrate some Raphaël animations into a qooxdoo 
window, and for those who might be interested, here is how we did (in 
fact it was not very complicated). Take note that this has not been 
fully tested, but for the moment it seems to work (although it's more or 
less a hack).
We have not tried to make Raphaël communicate with qooxdoo, but if this 
happens someday we'll post it here.



For the example, we'll reproduce this animation into a qooxdoo window: 
http://raphaeljs.com/hand.html (which I suppose is a clock)

As we can see in the source code of the page, the file raphael.js is 
needed (obviously), and there's a second <script> tag which contains the 
instructions to create the animation. The produced animation will be 
displayed into the <div id=holder> element. This means that we'll have 
to create a <div> tag into our qooxdoo window.

The code that create the clock looks like this
window.onload = function () {
...
}

For qooxdoo, we do not want the window.onload thing, but only to execute 
the instructions once the <div> tag is created. So we create a .js file 
(let's call it raphaelClock.js) which contains the drawing of the clock 
(i.e. the body of the window.onload function).
I suggest to put the Raphael files into the resource folder, and add 
some #asset(myraphaelfile.js). This way it will work in source and build 
versions.

Then all we need to do in the qooxdoo window is:

window = new qx.ui.window.Window();

var html = new qx.ui.embed.Html("<div id=holder></div>\n" + 
                                    "<script 
src=\"resource/raphael/raphaelClock.js\"type=\"text/javascript\"charset=\"utf-8\">
 
</script>");

window.add(html);


The last thing to do is adding
<script src="resource/raphael/raphael.js" type="text/javascript" 
charset="utf-8"></script>
in the index.html, before the call to the qooxdoo .js file that loads 
the application.


If we want to change the drawing, we just have to code some Raphaël in 
the resource file :)


HTH.

-- 
Loïc Bresson


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to