Skip to content

Commit

Permalink
nested frames new have a correct parent relationship. added referer h…
Browse files Browse the repository at this point in the history
…eader for http requests where window document will be exchanged. thanks to jorge ventura for finding these issues. also added example for svg rendering to jpg with batik
  • Loading branch information
thatcher committed Aug 20, 2010
1 parent aab7890 commit 3b0f9ca
Show file tree
Hide file tree
Showing 44 changed files with 134 additions and 37 deletions.
2 changes: 1 addition & 1 deletion build.properties
Expand Up @@ -2,7 +2,7 @@
PROJECT: env-js
BUILD_MAJOR: 1
BUILD_MINOR: 2
BUILD_ID: 32
BUILD_ID: 33
BUILD_VERSION: ${BUILD_MAJOR}.${BUILD_MINOR}.${BUILD_ID}
BUILD: ${PROJECT}.${BUILD_VERSION}
VERSION: ${BUILD} ${DSTAMP}
Expand Down
1 change: 1 addition & 0 deletions build.xml
Expand Up @@ -173,6 +173,7 @@
<fileset dir="${SRC_DIR}" includes="platform/rhino/dom.js" />
<fileset dir="${SRC_DIR}" includes="platform/rhino/event.js" />
<fileset dir="${SRC_DIR}" includes="platform/rhino/html.js" />
<fileset dir="${SRC_DIR}" includes="platform/rhino/svg.js" />
<fileset dir="${SRC_DIR}" includes="platform/rhino/parser.js" />
<fileset dir="${SRC_DIR}" includes="platform/rhino/timer.js" />
<fileset dir="${SRC_DIR}" includes="platform/rhino/xhr.js" />
Expand Down
22 changes: 21 additions & 1 deletion plugins/env.svg.js
Expand Up @@ -4,7 +4,10 @@
load('dist/env.rhino.js');
load('plugins/jquery.js');
load('plugins/vendor/raphael.js');
load('plugins/vendor/g.raphael-min.js');
load('plugins/vendor/g.pie-min.js');

/*
// Creates canvas 320 × 200 at 10, 50
var paper = Raphael(10, 50, 320, 200);
Expand All @@ -15,5 +18,22 @@ circle.attr("fill", "#f00");
// Sets the stroke attribute of the circle to white
circle.attr("stroke", "#fff");
*/

Envjs.writeToFile(document.body.innerHTML, Envjs.uri('reports/svg.html'));
// Creates canvas 640 × 480 at 10, 50
var r = Raphael(10, 50, 640, 480);

// Creates pie chart at with center at 320, 200,
// radius 100 and data: [55, 20, 13, 32, 5, 1, 2]
r.g.piechart(320, 240, 100, [55, 20, 13, 32, 5, 1, 2]);

Envjs.writeToFile(document.body.innerHTML, Envjs.uri('reports/svg.html'));
//Envjs.renderSVG = function(svgstring, url)

/** if you want to render the svg to an image file use:
> java -cp rhino/js.jar:`ls -1 rhino/svg/*.jar|sed 's/\(.\)$/\1:/'|tr -d '\n'` \
org.mozilla.javascript.tools.shell.Main -opt -1 plugins/env.svg.js
*/
Envjs.renderSVG(document.body.innerHTML, Envjs.uri('reports/svg.jpg'));
1 change: 1 addition & 0 deletions plugins/vendor/g.pie-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions plugins/vendor/g.raphael-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion reports/svg.html
@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="320" height="200" style="position: absolute; left: 10px; top: 50px;"><desc>Created with Rapha‘l</desc><defs/><circle cx="50" cy="40" r="10" fill="#ff0000" stroke="#ffffff"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="640" height="480" style="position: absolute; left: 10px; top: 50px;"><desc>Created with Rapha‘l</desc><defs/><path fill="#1751a7" stroke="#ffffff" d="M320,240L222.42978699614716,218.08987598431298A100,100,0,0,1,417.57021300385287,218.089875984313Z" stroke-width="1" stroke-linejoin="round"/><path fill="#8aa717" stroke="#ffffff" d="M320,240L417.57021300385287,218.089875984313A100,100,0,0,1,341.91012401568696,337.57021300385287Z" stroke-width="1" stroke-linejoin="round"/><path fill="#a74217" stroke="#ffffff" d="M320,240L341.91012401568696,337.57021300385287A100,100,0,0,1,251.0459455262933,312.4247082951467Z" stroke-width="1" stroke-linejoin="round"/><path fill="#a78a17" stroke="#ffffff" d="M320,240L251.0459455262933,312.4247082951467A100,100,0,0,1,221.47223576110588,257.0961888760301Z" stroke-width="1" stroke-linejoin="round"/><path fill="#5f17a7" stroke="#ffffff" d="M320,240L221.47223576110588,257.0961888760301A100,100,0,0,1,220.270954332131,232.64354364003324Z" stroke-width="1" stroke-linejoin="round"/><path fill="#a71717" stroke="#ffffff" d="M320,240L220.270954332131,232.64354364003324A100,100,0,0,1,221.47223576110588,222.9038111239699Z" stroke-width="1" stroke-linejoin="round"/><path fill="#00327f" stroke="#ffffff" d="M320,240L221.47223576110588,222.9038111239699A100,100,0,0,1,222.42978699614713,218.089875984313Z" stroke-width="1" stroke-linejoin="round"/><path fill="#000000" stroke="none" d="M320,240L222.42978699614716,218.08987598431298A100,100,0,0,1,417.57021300385287,218.089875984313Z" fill-opacity="0"/><path fill="#000000" stroke="none" d="M320,240L417.57021300385287,218.089875984313A100,100,0,0,1,341.91012401568696,337.57021300385287Z" fill-opacity="0"/><path fill="#000000" stroke="none" d="M320,240L341.91012401568696,337.57021300385287A100,100,0,0,1,251.0459455262933,312.4247082951467Z" fill-opacity="0"/><path fill="#000000" stroke="none" d="M320,240L251.0459455262933,312.4247082951467A100,100,0,0,1,221.47223576110588,257.0961888760301Z" fill-opacity="0"/><path fill="#000000" stroke="none" d="M320,240L221.47223576110588,257.0961888760301A100,100,0,0,1,220.270954332131,232.64354364003324Z" fill-opacity="0"/><path fill="#000000" stroke="none" d="M320,240L220.270954332131,232.64354364003324A100,100,0,0,1,221.47223576110588,222.9038111239699Z" fill-opacity="0"/><path fill="#000000" stroke="none" d="M320,240L221.47223576110588,222.9038111239699A100,100,0,0,1,222.42978699614713,218.089875984313Z" fill-opacity="0"/></svg>
Binary file added reports/svg.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rhino/svg/batik-anim.jar
Binary file not shown.
Binary file added rhino/svg/batik-awt-util.jar
Binary file not shown.
Binary file added rhino/svg/batik-bridge.jar
Binary file not shown.
Binary file added rhino/svg/batik-codec.jar
Binary file not shown.
Binary file added rhino/svg/batik-css.jar
Binary file not shown.
Binary file added rhino/svg/batik-dom.jar
Binary file not shown.
Binary file added rhino/svg/batik-ext.jar
Binary file not shown.
Binary file added rhino/svg/batik-extension.jar
Binary file not shown.
Binary file added rhino/svg/batik-gui-util.jar
Binary file not shown.
Binary file added rhino/svg/batik-gvt.jar
Binary file not shown.
Binary file added rhino/svg/batik-parser.jar
Binary file not shown.
Binary file added rhino/svg/batik-rasterizer.jar
Binary file not shown.
Binary file added rhino/svg/batik-script.jar
Binary file not shown.
Binary file added rhino/svg/batik-slideshow.jar
Binary file not shown.
Binary file added rhino/svg/batik-squiggle.jar
Binary file not shown.
Binary file added rhino/svg/batik-svg-dom.jar
Binary file not shown.
Binary file added rhino/svg/batik-svggen.jar
Binary file not shown.
Binary file added rhino/svg/batik-svgpp.jar
Binary file not shown.
Binary file added rhino/svg/batik-swing.jar
Binary file not shown.
Binary file added rhino/svg/batik-transcoder.jar
Binary file not shown.
Binary file added rhino/svg/batik-ttf2svg.jar
Binary file not shown.
Binary file added rhino/svg/batik-util.jar
Binary file not shown.
Binary file added rhino/svg/batik-xml.jar
Binary file not shown.
Binary file added rhino/svg/batik.jar
Binary file not shown.
Binary file added rhino/svg/pdf-transcoder.jar
Binary file not shown.
Binary file added rhino/svg/xml-apis-ext.jar
Binary file not shown.
Binary file added rhino/svg/xml-apis.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion specs/window/frameset.html
Expand Up @@ -4,5 +4,5 @@
<head>
<title>Envjs Frameset Spec</title>
</head>
<frameset id="framesetSerializeTest"><frame src="links.html"/><noframes>frames not supported</noframes></frameset>
<frameset id="framesetSerializeTest"><frame id='fs1' src="links.html"/><noframes>frames not supported</noframes></frameset>
</html>

0 comments on commit 3b0f9ca

Please sign in to comment.