chenbo007 / svg-edit

Automatically exported from code.google.com/p/svg-edit
0 stars 0 forks source link

Provide editor for SVG text source #59

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It would be very useful to allow the user to edit the source directly.  I'm
not sure entirely of the ramifications of this yet (in terms of the gadget).

From a minimum, I think the following should happen:

1) the canvas should provide a way to get and set the full text of the SVG
document:  getSVGSource() and setSVGSource(str)

2) the setSVGSource(str) needs to be undo-able

3) the HTML editor should provide a means to switch editing modes from
graphical to text (button?)

4) when switching from graphical to text mode, the canvas would hide and a
textarea would be shown that includes the SVG source

5) when switching from text to graphical mode, the canvas would be set with
the contents of the textarea, the textarea would be hidden and the canvas
would be made visible again

6) in text mode, it is not necessary to show the toolbar, and possibly
change the contextual panel to hide the undo/redo

4) 

Original issue reported on code.google.com by codedr...@gmail.com on 8 Jul 2009 at 1:19

GoogleCodeExporter commented 9 years ago

Original comment by codedr...@gmail.com on 9 Jul 2009 at 7:58

GoogleCodeExporter commented 9 years ago
7) when switching from text mode to graphical mode, the SVG text must be put 
through
a scrubber that includes a whitelist of elements and attributes that SVG-edit
supports.  Presumably we will strip out comments, unnecessary whitespace nodes, 
etc too.

8) if there is an error with the source, what do we do?

Original comment by codedr...@gmail.com on 9 Jul 2009 at 8:13

GoogleCodeExporter commented 9 years ago
Reqts 1 and 2 have been fulfilled as getSvgString() and setSvgString(s).  

For reqt 8, if the source text has XML parse errors, setSvgString(s) returns 
false.

Original comment by codedr...@gmail.com on 10 Jul 2009 at 5:09

GoogleCodeExporter commented 9 years ago
The full implementation for this has been checked in with r317

Original comment by codedr...@gmail.com on 13 Jul 2009 at 3:54