From 76c17ae3e8653261c89218ce0bff6edf2734b0c3 Mon Sep 17 00:00:00 2001 From: Narendra Sisodiya Date: Fri, 13 Feb 2009 09:32:31 +0000 Subject: [PATCH] added clear svg function git-svn-id: http://svg-edit.googlecode.com/svn/trunk@8 eee81c28-f429-11dd-99c0-75d572ba1ddd --- blanksvg.js | 105 +++++++++++++++++++++++++++------------------------- 1 file changed, 55 insertions(+), 50 deletions(-) diff --git a/blanksvg.js b/blanksvg.js index 064acad4..b49b90df 100644 --- a/blanksvg.js +++ b/blanksvg.js @@ -319,63 +319,68 @@ function assignAttr(Node,Attr){ function SVGclear_svg() { - for(var i=1; i=0; i--) - { - attr = attrs.item(i); - out += " " + attr.nodeName + "=\"" + attr.nodeValue+ "\""; - } + for (i=0; i\n"; - } - else - { - out += " />\n"; - } + for (i=attrs.length-1; i>=0; i--) + { + attr = attrs.item(i); + out += " " + attr.nodeName + "=\"" + attr.nodeValue+ "\""; + } - } - return out; - } + + + if (elem.hasChildNodes()) + { + out += ">\n"; + indent++; + for (i=0; i\n"; + } + else + { + out += " />\n"; + } + + } + return out; +} function SVGsubmit_svg(){ var str = " \