lewisje / svgweb

Automatically exported from code.google.com/p/svgweb
Other
0 stars 0 forks source link

innerHTML with embed tag #498

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I have a setup like this in my existing environment and planning to 
implement the same in SVGWEB. Is there any way I can achieve this.

test.js file with 
    function callSVG (documentNode )
    {
        var viewCell = document.getElementById
("svgviewertable").lastChild.firstChild.firstChild;

         .................................

        viewCell.innerHTML = '<embed wmode="transparent" width="750" 
height="500" src="application/dhtml/common/sample.svg"></embed>';
    }

In sample.svg, I have something like this (having custom menu with options 
and separate functions for each selection).

    <svg id="topSVG" xml:space="preserve" width="7.5in" height="5in" 
onload="loadSVG( evt )" onmousedown="onClick( evt )">
    <def>
      <image id="basetask" 
xlink:href="application/dhtml/images/dotasknode.gif" width="18" 
height="18"/>
      <menu id="myCustomMenu" xmlns="http://mynamepsace.com/">
          <header>Custom Menu</header>
          <item action='ZoomIn'>Zoom &amp;In</item>
          <item action='ZoomOut'>Zoom &amp;Out</item>
          <item action='OriginalView'>Original Vie&amp;w</item>
          <separator />
          <item action='Quality'>Higher &amp;Quality</item>
          <item action='Pause'>&amp;Pause</item>
          <item action='Mute'>&amp;Mute</item>
          <separator />
          <item action='Find'>&amp;Find...</item>
          <item action='FindAgain'>Find &amp;Again</item>
          <separator />
          <item action='Copy'>&amp;Copy Selected Text</item>
          <item action='CopySVG'>&amp;Copy SVG</item>
          <item action='ViewSVG'>View SV&amp;G...</item>
          <item action='ViewSource'>View Sourc&amp;e...</item>
          <item action='SaveAs'>&amp;Save SVG As...</item>
          <separator />
          <menu id="application" >
              <header>application</header>
              <item onactivate="popupPerformDialogs()">Perform...</item>
              <separator/>
              <item onactivate="viewSub()">Zoom to Task</item>
              <item onactivate="viewSubParent( true, true )">Zoom to Task 
Parent</item>
              <item onactivate="viewProcess()">View entire process</item>
              <separator/>
              <item onactivate="getViewerProperties()">View 
Properties</item>
              <item onactivate="popupViewDecisionsDialogs()">View 
Decisions</item>
          </menu>
          <separator />
          <item action='Help'>&amp;Help...</item>
      </menu>
    </def>
    <script><![CDATA[
           var targetNode = null;

          function changeContextMenu()
           {
               var newMenuRoot = parseXML(printNode(document.getElementById
('myCustomMenu')), contextMenu);
               contextMenu.replaceChild( newMenuRoot, 
contextMenu.firstChild );
           }

           function onClick( event )
           {
               if( event.button == 2 ) // right mouse button
               {
                   changeContextMenu();  
               }
           }

           function reload()
           {
               displayJob(svgviewertable.getAttribute( "svg_job" ));
           }

        ]]></script>

</svg>

Original issue reported on code.google.com by skvpra...@gmail.com on 28 May 2010 at 7:47

GoogleCodeExporter commented 8 years ago
We do not support loading svg files this way. There are simple ways to do this 
as
described in the user manual. Also, please do not open issues for simple 
questions.
There is an active user group for that.

Original comment by grick23@gmail.com on 4 Jun 2010 at 4:17