Hello,

I don't recommend using Adobes context menu. Chances are that ASV won't get 
updated 
any time soon, on the other hand many browsers (Mozilla, Opera, Safari, 
Konqueror) now 
start including SVG.

If you build your SVG application around proprietary Adobe extensions your 
content won't 
be portable.

If you really need a context menu I would recommend building your own widget 
using 
javascript and the DOM.

Andreas


--- In svg-developers@yahoogroups.com, "jaykirc" <[EMAIL PROTECTED]> wrote:
>
> Hi!
> 
> I need to extend the Adobe SVG Viewer context menu for auto-generated
> SVG files in an external javascript. I've already added the needed
> tags into the document using DOM like
> 
> <defs>
>     <menu id="annotate">
>         <header>RDF Menu</header>
>         <item action="ZoomIn">Zoom &amp;In</item>
>         <item action="ZoomOut">Zoom &amp;Out</item>
>         <item action="OriginalView">&amp;Original View</item>
>         <item/>
>         <item onactivate="myFunction(evt)">&amp;My Function</item>
>         ...
>         ...
>     </menu>
> </defs>
> 
> Now my problem is to set up a function to parse the new menu: I could
> write the method in my external javascript file like
> 
> function parseMenu(svg) {
>     var svgDoc = svg.getSVGDocument();
>     var svgRootDoc = svgDoc.getRootElement();
>           
>     var newMenuRoot =
> parseXML(printNode(svgRootDoc.getElementById("annotationMenu")),
> contextMenu);
>     contextMenu.replaceChild(newMenuRoot, contextMenu.firstChild);
> }
> 
> The Problem with this is that I don't have access to "contextMenu", so
> I get error messages when the function is called...
> 
> The other possibility would be to add the function to the SVG document
> just like the tags for the menu itself:
> 
> script = svgDoc.createElement("script");
> text = svgDoc.createTextNode("function parseMenu() {var newMenuRoot =
> parseXML(printNode(svgRootDoc.getElementById( \"annotationMenu\")),
> contextMenu);contextMenu.replaceChild(newMenuRoot,
> contextMenu.firstChild);}");
> script.appendChild(text);
> svgDocRoot.appendChild(script);
> 
> Doing this i get a Javascript error saying "Object expected" after
> calling the parseMenu() function. I think this means he can't find the
> corresponding function definition.
> 
> I can't figure out how to get this going, would be great if anyone
> could help me with this.
> 
> Cheers,
> Jochen
>







------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/1U_rlB/TM
--------------------------------------------------------------------~-> 

-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to