[svg-developers] Contextmenu firefox 1.5

2005-12-11 Thread jophof007
Hi,

I have a XML file loading mixed page something like this:

html xmlns=http://www.w3.org/1999/xhtml;

body oncontextmenu='return (false) '
link href=../../include/contextmenu/contextmenu.css
rel=stylesheet type=text/css /

svg xmlns=http://www.w3.org/2000/svg;
 xmlns:xlink=http://www.w3.org/1999/xlink;
 onmousedown='Grab(evt)'
 onmousemove='Drag(evt)'
 onmouseup='Drop(evt)'
 width=99%
 height=99%
 onload=init()

script type=text/javascript ![CDATA[
var is_ie = false;
var is_gecko = true;
var svgDocument=document;
var root = document.documentElement;
var drawBoard,background, root;
var odiagram=null, textcontainer;
var oserver = new Object();
]]
/script

script xlink:href=../postgeturlemu.js/
script xlink:href=../../include/string.js/
script xlink:href=../clmenu.js/

script![CDATA[
var svgns  = http://www.w3.org/2000/svg;;
//var ldebug = false; // debug on and all lines will get an indicator
so you can see which code they are corresponding with
var ldebug = true; // debug on and all lines will get an indicator so
you can see which code they are made of
var mouser = new Mouser();
var npolltime = 3000; // elapsed number of miliseconds to poll the
server for updates on the diagram
var nmaxtrials = 300; // number of times trying to get the data from
the server
//var lbypassdatabase=true;
var lbypassdatabase=false;

// CONSTANTS
var FORKVERTICAL = FORKVERTICAL;
var FORKHORIZONTAL = FORKHORIZONTAL;
var NMAX = 9;
var lfirstmove = false; // event to help saving state of symbols
]]/script

defs id=definitions
  marker id=Down-Arrow
viewBox=0 0 10 10 refX=10 refY=5
markerWidth=6 markerHeight=6
orient=auto
path d=M 0 0 L 10 5 L 0 10 z style=stroke:black;fill:black/
  /marker

  linearGradient id=symbolgradient
stop offset=5% stop-color=#000/
stop offset=95% stop-color=#000/
  /linearGradient

  !-- Background Gradient --
  radialGradient id=backgroundGradient
gradientUnits=objectBoundingBox
  cx=0 cy=0 r=1.2
stop offset=0% style=stop-color:white/
stop offset=60% style=stop-color:rgb(181, 181, 230)/
stop offset=80% style=stop-color:rgb(122, 122, 173)/
stop offset=100% style=stop-color:rgb(22, 22, 73)/
  /radialGradient

  !-- Define a drop shadow filter --
  !--
  filter id=closeDropShadow
feGaussianBlur in=SourceAlpha stdDeviation=2 result=blur/
feOffset in=blur dx=6 dy=6 result=offsetBlur/
feMerge
  feMergeNode in=offsetBlur/
  feMergeNode in=SourceGraphic/
/feMerge
  /filter
  --
/defs

  svg preserveAspectRatio=xMinYMin slice width=100% height=55
rect id='diagramtitlebackground' width='100%' height='800%'
style='fill:url(#backgroundGradient)'/
  /svg
!--  g id='diagramtitle' style=filter:url(#closeDropShadow)/g--
  g id='diagramtitle'  /g
  rect id='diagramtitlebackground2' width=100% height=55
fill=none stroke-width=2 stroke=black/
  text id=measure x=-1000 y=-1000 /text
  g id='_root'/g
/svg
div id=_cm0_ class=skin0 onMouseover=opage.highlight(event) 
  onMouseout=opage.lowlight(event)\ 
  onClick =opage.jumpto(event) 
   
/div
!--style=visibility:hidden--
script![CDATA[
  var opage = new clpage (opage); // the page contains all grid
dialogues
  ocontextmanager = new clcontextmanager (ocontextmanager,
document.getElementById (_cm0_), document, _cm0_ );
  opage.contextmanager = ocontextmanager;
  opage.contextmenu = ocontextmanager.addcontextmenuholder ( _cm0_ ); 
]]/script

/body
/html

The code is running fine but when I do a right mouse click I want to
disable the default contextmenu from Firefox this worked in normal
firefox pages but the code doesn't work on mixed content page.

The code I use is:

  e.stopPropagation();
  e.preventDefault();

John
http://open-modeling.sourceforge.net






 Yahoo! Groups Sponsor ~-- 
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/I258zB/QnQLAA/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/
 





[svg-developers] Scripting from HTML to SVG

2005-12-11 Thread Greg Mercer
Hi All,

I was trying the following example, on FireFox 1.5, using Adobe SVG
Viewer 6.0 - I've set the svg.enabled to false using about:config.

http://jwatt.org/svg/demos/scripting-across-embed.html

It has the following code that attempts to get the svg window
object, so that it can call into svg script functions from the html file.

Under this enviroment, all these attempts to get window fails. See
svgwin below. 

Is there any way around this?

Thanks,

Greg

...

var svgdoc = null;
var svgwin = null;

function init()
{
  // FIRST WE TRY TO OBTAIN A REFERENCE TO THE SVG DOCUMENT.
  //
  // Mozilla with native SVG support and ASV running in IE both
support the
  // GetSVGDocument interface for the embed object.
  //
  //   http://w3.org/TR/SVG11/struct.html#InterfaceGetSVGDocument
  //
  // Unfortunately ASV in IE doesn't allow us to check if the method
  // getSVGDocument() exists without calling it. Since calling a
function that
  // doesn't exist will cause an error we must be prepared to catch an
  // exception.

  var embed = document.getElementById('embed');
  try {
svgdoc = embed.getSVGDocument();
  }
  catch(exception) {
alert('The GetSVGDocument interface is not supported');
  }

  // If the GetSVGDocument interface is supported then the global variable
  // svgdoc will now contain a reference to the SVG document.
Otherwise it will
  // be null.
  //
  // NOW WE TRY TO OBTAIN A REFERENCE TO THE SVG DOCUMENT'S window
OBJECT.
  //
  // The W3C does not provide a direct way to obtain the window
object for
  // the SVG document from the embed element (obviously, since it's
not a W3C
  // tag). The W3C way to access the SVG document's window object is
via the
  // SVG document itself, using the defaultView attribute of the
DocumentView
  // interface.
  //
  //  
http://www.w3.org/TR/DOM-Level-2-Views/views.html#Views-DocumentView
  //
  // ASV in IE doesn't implement the W3C's DocumentView interface
(yet), so we
  // also try to access the SVG document's window object using the
non-W3C
  // standard properties 'window' and non-W3C standard function
getWindow() on
  // the embed object. Again ASV doesn't allow us to check whether
getWindow()
  // is supported, so we need to be ready to catch an exception if
calling it
  // causes an error.

  if (svgdoc  svgdoc.defaultView) {  // try the W3C standard way first
svgwin = svgdoc.defaultView;
  } else if (embed.window) {
svgwin = embed.window;
  } else try {
svgdoc = embed.getWindow();
  }
  catch(exception) {
alert('The DocumentView interface is not supported\r\n' +
  'Non-W3C standard methods of obtaining window also failed');
  }

  // If we failed to get a reference to the SVG document's window
then svgwin
  // will still be null.
}







 Yahoo! Groups Sponsor ~-- 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/vlQLAA/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/
 




RE: [svg-developers] Scripting from HTML to SVG

2005-12-11 Thread Geoffrey Swenson
It works on my computer the same way in both FF1.5 and IE6. Do you have the
Adobe Plugin installed for Firefox?

 

Geoffrey J. Swenson

[EMAIL PROTECTED]

 

-Original Message-
From: svg-developers@yahoogroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of Greg Mercer
Sent: Sunday, December 11, 2005 7:25 PM
To: svg-developers@yahoogroups.com
Subject: [svg-developers] Scripting from HTML to SVG

 

Hi All,

I was trying the following example, on FireFox 1.5, using Adobe SVG
Viewer 6.0 - I've set the svg.enabled to false using about:config.

http://jwatt.org/svg/demos/scripting-across-embed.html

It has the following code that attempts to get the svg window
object, so that it can call into svg script functions from the html file.

Under this enviroment, all these attempts to get window fails. See
svgwin below. 

Is there any way around this?

Thanks,

Greg

..

var svgdoc = null;
var svgwin = null;

function init()
{
  // FIRST WE TRY TO OBTAIN A REFERENCE TO THE SVG DOCUMENT.
  //
  // Mozilla with native SVG support and ASV running in IE both
support the
  // GetSVGDocument interface for the embed object.
  //
  //   http://w3.org/TR/SVG11/struct.html#InterfaceGetSVGDocument
  //
  // Unfortunately ASV in IE doesn't allow us to check if the method
  // getSVGDocument() exists without calling it. Since calling a
function that
  // doesn't exist will cause an error we must be prepared to catch an
  // exception.

  var embed = document.getElementById('embed');
  try {
svgdoc = embed.getSVGDocument();
  }
  catch(exception) {
alert('The GetSVGDocument interface is not supported');
  }

  // If the GetSVGDocument interface is supported then the global variable
  // svgdoc will now contain a reference to the SVG document.
Otherwise it will
  // be null.
  //
  // NOW WE TRY TO OBTAIN A REFERENCE TO THE SVG DOCUMENT'S window
OBJECT.
  //
  // The W3C does not provide a direct way to obtain the window
object for
  // the SVG document from the embed element (obviously, since it's
not a W3C
  // tag). The W3C way to access the SVG document's window object is
via the
  // SVG document itself, using the defaultView attribute of the
DocumentView
  // interface.
  //
  //  
http://www.w3.org/TR/DOM-Level-2-Views/views.html#Views-DocumentView
  //
  // ASV in IE doesn't implement the W3C's DocumentView interface
(yet), so we
  // also try to access the SVG document's window object using the
non-W3C
  // standard properties 'window' and non-W3C standard function
getWindow() on
  // the embed object. Again ASV doesn't allow us to check whether
getWindow()
  // is supported, so we need to be ready to catch an exception if
calling it
  // causes an error.

  if (svgdoc  svgdoc.defaultView) {  // try the W3C standard way first
svgwin = svgdoc.defaultView;
  } else if (embed.window) {
svgwin = embed.window;
  } else try {
svgdoc = embed.getWindow();
  }
  catch(exception) {
alert('The DocumentView interface is not supported\r\n' +
  'Non-W3C standard methods of obtaining window also failed');
  }

  // If we failed to get a reference to the SVG document's window
then svgwin
  // will still be null.
}







-
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 

 

*Visit your group svg-developers
http://groups.yahoo.com/group/svg-developers  on the web.
  
*To unsubscribe from this group, send an email to:
 [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] 
  
*Your use of Yahoo! Groups is subject to the Yahoo! Terms of
http://docs.yahoo.com/info/terms/  Service. 

 

  _  



[Non-text portions of this message have been removed]



 Yahoo! Groups Sponsor ~-- 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/vlQLAA/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/
 




[svg-developers] Screen extents

2005-12-11 Thread G. Wade Johnson
I know there must be an easy answer to this, but how do I get the actual width
and height of the viewer. I am not looking for the width and height of the svg
or for the viewBox values.

I am building an SVG image on the fly and sending it to the viewer. This image
may be larger than the area that the viewer can display. I want to find the
area that the viewer displays so that I can modify the image based on what is
currently displayed.

I've normally layed out my displays so that this is not a problem. In this
case, I do not have that option.

Thanks,
G. Wade
-- 
A 'language' is a dialect with an army.


 Yahoo! Groups Sponsor ~-- 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/vlQLAA/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/
 





Re: [svg-developers] Screen extents

2005-12-11 Thread Sean Montague
You could try innerWidth  innerHeight or if you have embeded it in html:
parent.document.SvgMap.clientWidth
parent.document.SvgMap.clientHeight

G. Wade Johnson wrote:

I know there must be an easy answer to this, but how do I get the actual width
and height of the viewer. I am not looking for the width and height of the svg
or for the viewBox values.

I am building an SVG image on the fly and sending it to the viewer. This image
may be larger than the area that the viewer can display. I want to find the
area that the viewer displays so that I can modify the image based on what is
currently displayed.

I've normally layed out my displays so that this is not a problem. In this
case, I do not have that option.

Thanks,
G. Wade
  



 Yahoo! Groups Sponsor ~-- 
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/I258zB/QnQLAA/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/