cleaned extra white spaces in embedapi
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2433 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
@@ -1,10 +1,9 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" >
|
<html xmlns="http://www.w3.org/1999/xhtml" >
|
||||||
<head>
|
<head>
|
||||||
<title></title>
|
<title>Embed API</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<script type="text/javascript" src="embedapi.js"></script>
|
<script type="text/javascript" src="embedapi.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var svgCanvas = null;
|
var svgCanvas = null;
|
||||||
@@ -12,26 +11,16 @@
|
|||||||
function init_embed() {
|
function init_embed() {
|
||||||
var frame = document.getElementById('svgedit');
|
var frame = document.getElementById('svgedit');
|
||||||
svgCanvas = new embedded_svg_edit(frame);
|
svgCanvas = new embedded_svg_edit(frame);
|
||||||
|
|
||||||
// Hide main button, as we will be controlling new/load/save etc from the host document
|
// Hide main button, as we will be controlling new/load/save etc from the host document
|
||||||
var doc;
|
var doc = frame.contentDocument || frame.contentWindow.document;
|
||||||
doc = frame.contentDocument;
|
|
||||||
if (!doc)
|
|
||||||
{
|
|
||||||
doc = frame.contentWindow.document;
|
|
||||||
}
|
|
||||||
|
|
||||||
var mainButton = doc.getElementById('main_button');
|
var mainButton = doc.getElementById('main_button');
|
||||||
mainButton.style.display = 'none';
|
mainButton.style.display = 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleSvgData(data, error) {
|
function handleSvgData(data, error) {
|
||||||
if (error)
|
if (error) {
|
||||||
{
|
|
||||||
alert('error ' + error);
|
alert('error ' + error);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
alert('Congratulations. Your SVG string is back in the host page, do with it what you will\n\n' + data);
|
alert('Congratulations. Your SVG string is back in the host page, do with it what you will\n\n' + data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -45,12 +34,9 @@
|
|||||||
svgCanvas.getSvgString()(handleSvgData);
|
svgCanvas.getSvgString()(handleSvgData);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<button onclick="loadSvg();">Load example</button>
|
<button onclick="loadSvg();">Load example</button>
|
||||||
<button onclick="saveSvg();">Save data</button>
|
<button onclick="saveSvg();">Save data</button>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<iframe src="svg-editor.html" width="900px" height="600px" id="svgedit" onload="init_embed()"></iframe>
|
<iframe src="svg-editor.html" width="900px" height="600px" id="svgedit" onload="init_embed()"></iframe>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user