From e64035dc4e66249dcf9889398c941a6d80d165ad Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Fri, 28 Aug 2009 14:39:53 +0000 Subject: [PATCH] add a comment to output SVG saying 'created with SVG-edit - http://svg-edit.googlecode.com/' git-svn-id: http://svg-edit.googlecode.com/svn/trunk@494 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 7ea17b80..ec3c9ef8 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -532,6 +532,8 @@ function SvgCanvas(c) svgroot.setAttribute("id", "svgroot"); svgroot.setAttribute("xmlns", svgns); container.appendChild(svgroot); + var comment = svgdoc.createComment(" created with SVG-edit - http://svg-edit.googlecode.com/ "); + svgroot.appendChild(comment); var d_attr = null; var started = false; @@ -2276,7 +2278,8 @@ function SvgCanvas(c) defs = defs[0]; } else { - defs = svgroot.insertBefore( svgdoc.createElementNS(svgns, "defs" ), svgroot.firstChild); + // first child is a comment, so call nextSibling + defs = svgroot.insertBefore( svgdoc.createElementNS(svgns, "defs" ), svgroot.firstChild.nextSibling); } return defs; }; @@ -2677,7 +2680,8 @@ function SvgCanvas(c) var oldParent = t.parentNode; var oldNextSibling = t.nextSibling; if (oldNextSibling == selectorManager.selectorParentGroup) oldNextSibling = null; - var firstChild = t.parentNode.firstChild; + // first child is a comment, so call nextSibling + var firstChild = t.parentNode.firstChild.nextSibling; if (firstChild.tagName == 'defs') { firstChild = firstChild.nextSibling; }