|Re: SVG Web library - integration with RAP [message #631991 is a reply to message #630740]
||Mon, 11 October 2010 07:29
| Cristina Petra
Registered: July 2009
I managed to integrate SVGWeb in my RAP application. Here is what did:|
- Create an "svg" library related folder in which I place svg-uncompressed.js, svg.swf and svg.htc files.
- Add an "org.eclipse.equinox.http.registry.resources" extension point to register this folder
- Register the svg.js file as a local .js resource file. With this, the "DOMContentLoaded" listener will work just fine.
- I changed the library path by hand (pointing to my js file) in the svg-uncompressed.js file, as any script integrated in the html page (with the HtmlResponseWriter) will come too late.
You can use the same workaround regarding the meta-data related to forcing the flash on all browsers (change _forceFlash function from the svg.js file), or use url parameter as they explain (this I didn't try yet).
- I needed this library for dynamic svg files - therefore I must follow their instructions related this topic. Inner html they don't support yet (as I read), so if you have the same needs you must actually create objects, as they explain, and afterwards use their appendChild function. The library will handle the rest.
E.g. in a custom widget:
var myElem = this.getElement();
var obj = document.createElement('object', true);
Powered by FUDForum
. Page generated in 0.01624 seconds