changeset 404:01cb43413b59

SvgEditor: svg-edit adapted
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Fri, 28 Aug 2009 09:39:07 +0200
parents e8fb1a159800
children 43ee86f48825
files data/plugin/action/SvgEditor.py htdocs/svg-edit/editor/svg-editor.css htdocs/svg-edit/editor/svg-editor.js
diffstat 3 files changed, 273 insertions(+), 215 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/action/SvgEditor.py	Thu Aug 27 23:24:24 2009 +0200
+++ b/data/plugin/action/SvgEditor.py	Fri Aug 28 09:39:07 2009 +0200
@@ -1,4 +1,4 @@
-# -*- coding: iso-8859-1 -*-
+# -*- coding: iso-8859-2 -*-
 """
     MoinMoin - SvgEditor
 
@@ -44,9 +44,8 @@
     url = request.getQualifiedURL()
     htdocs = "%s%s" % (request.cfg.url_prefix_static, '/svg-edit/editor')
     
-    meta = """
-<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<link rel="icon" type="image/png" href="images/logo.png">
+    meta = """<http-equiv="Content-type" content="text/html;charset=UTF-8" />
+<link rel="icon" type="image/png" href="%(htdocs)s/images/logo.png">
 <link rel="stylesheet" href="%(htdocs)s/jgraduate/css/jPicker-1.0.9.css" type="text/css"/>
 <link rel="stylesheet" href="%(htdocs)s/jgraduate/css/jGraduate-0.2.0.css" type="text/css"/>
 <link rel="stylesheet" href="%(htdocs)s/svg-editor.css" type="text/css"/>
@@ -63,7 +62,7 @@
 <script type="text/javascript" src="%(htdocs)s/svgcanvas.js"></script>
 <!--script type="text/javascript" src="%(htdocs)s/svgcanvas.min.js"></script-->
 <script type="text/javascript" src="%(htdocs)s/svg-editor.js"></script>
-<!--script type="text/javascript" src="%(htdocs)s/svg-editor.min.js"></script--> 
+<!--script type="text/javascript" src="%(htdocs)s/svg-editor.min.js"></script-->
 """ % {"htdocs": htdocs} 
 
     html = """
@@ -77,239 +76,259 @@
 
 <div id="logo">
 	<a href="http://svg-edit.googlecode.com/" target="_blank" title="SVG-edit Home Page">
-		<img src="%(htdocs)s/images/logo.png" width="32" height="32"/>
+		<img src="%(htdocs)s/images/logo.png" alt="logo" />
 	</a>
 </div>
 
 <div id="tools_top" class="tools_panel">
-	<!-- File-like buttons: New, Save, Source -->
-	<div>
-		<img class="tool_sep" src="%(htdocs)s/images/sep.png" alt="|"/>
-		<img class="tool_button" id="tool_clear" src="%(htdocs)s/images/clear.png" title="New Image [N]" alt="Clear" />
-		<img class="tool_button" id="tool_save" src="%(htdocs)s/images/save.png" title="Save Image [S]" alt="Save"/>
-		<img class="tool_button" id="tool_source" src="%(htdocs)s/images/source.png" title="Edit Source [U]" alt="Source"/>
-	</div>
+    <!-- File-like buttons: New, Save, Source -->
+    <div>
+        <img class="tool_sep" src="%(htdocs)s/images/sep.png" alt="|"/>
+        <img class="tool_button" id="tool_clear" src="%(htdocs)s/images/clear.png" title="New Image [N]" alt="Clear" />
+        <img style="display:none" class="tool_button" id="tool_open" src="%(htdocs)s/images/open.png" title="Open Image [O]" alt="Open"/>
+        <img class="tool_button" id="tool_save" src="%(htdocs)s/images/save.png" title="Save Image [S]" alt="Save"/>
+        <img class="tool_button" id="tool_source" src="%(htdocs)s/images/source.png" title="Edit Source [U]" alt="Source"/>
+    </div>
 
     <!-- History buttons -->
-	<div>
-		<img class="tool_sep" src="%(htdocs)s/images/sep.png" alt="|"/>
-		<img class="tool_button tool_button_disabled" id="tool_undo" src="%(htdocs)s/images/undo.png" title="Undo [Z]" alt="Undo" />
-		<img class="tool_button tool_button_disabled" id="tool_redo" src="%(htdocs)s/images/redo.png" title="Redo [Y]" alt="Redo"/>
-	</div>
-
-	<!-- Buttons when something a single element is selected -->
-	<div id="selected_panel">
-		<img class="tool_sep" src="%(htdocs)s/images/sep.png" alt="|"/>
-		<img class="tool_button" id="tool_clone" src="%(htdocs)s/images/copy.png" title="Clone Element [C]" alt="Copy"/>
-		<img class="tool_button" id="tool_delete" src="%(htdocs)s/images/delete.png" title="Delete Element [Delete/Backspace]" alt="Delete"/>
-		<img class="tool_button" id="tool_move_top" src="%(htdocs)s/images/move_top.png" title="Move to Top [Shift+Up]" alt="Top"/>
-		<img class="tool_button" id="tool_move_bottom" src="%(htdocs)s/images/move_bottom.png" title="Move to Bottom [Shift+Down]" alt="Bottom"/>
-		<select id="group_opacity" class="selected_tool" title="Change selected item opacity">
-			<option selected="selected" value="1">100 %%</option>
-			<option value="0.9">90 %%</option>
-			<option value="0.8">80 %%</option>
-			<option value="0.7">70 %%</option>
-			<option value="0.6">60 %%</option>
-			<option value="0.5">50 %%</option>
-			<option value="0.4">40 %%</option>
-			<option value="0.3">30 %%</option>
-			<option value="0.2">20 %%</option>
-			<option value="0.1">10 %%</option>
-		</select>
-		<span class="selected_tool">angle:</span>
-		<input id="angle" class="selected_tool" title="Change rotation angle" alt="Rotation Angle" size="2" value="0" type="text"/>
-	</div>
-
-	<!-- Buttons when something a single element is selected -->
-	<div id="multiselected_panel">
-		<img class="tool_sep" src="%(htdocs)s/images/sep.png" alt="|"/>
-		<img class="tool_button" id="tool_clone_multi" src="%(htdocs)s/images/copy.png" title="Clone Elements [C]" alt="Clone"/>
-		<img class="tool_button" id="tool_delete_multi" src="%(htdocs)s/images/delete.png" title="Delete Selected Elements [Delete/Backspace]" alt="Delete"/>
-	</div>
-
-	<div id="rect_panel">
-		<img class="tool_sep" src="%(htdocs)s/images/sep.png" alt="|"/>
-		<label class="rect_tool">x:</label>
-		<input id="rect_x" class="rect_tool attr_changer" title="Change rectangle X coordinate" alt="x" size="3"/>
-		<label class="rect_tool">y:</label>
-		<input id="rect_y" class="rect_tool attr_changer" title="Change rectangle Y coordinate" alt="y" size="3"/>
-		<label class="rect_tool">width:</label>
-		<input id="rect_w" class="rect_tool attr_changer" title="Change rectangle width" alt="width" size="3"/>
-		<label class="rect_tool">height:</label>
-		<input id="rect_h" class="rect_tool attr_changer" title="Change rectangle height" alt="height" size="3"/>
-		<label class="rect_tool">Corner Radius:</label>
-		<input id="rect_radius" size="3" value="0" class="rect_tool" type="text" title="Change Rectangle Corner Radius" alt="Corner Radius"/>
-	</div>
+    <div>
+        <img class="tool_sep" src="%(htdocs)s/images/sep.png" alt="|"/>
+        <img class="tool_button tool_button_disabled" id="tool_undo" src="%(htdocs)s/images/undo.png" title="Undo [Z]" alt="Undo" />
+        <img class="tool_button tool_button_disabled" id="tool_redo" src="%(htdocs)s/images/redo.png" title="Redo [Y]" alt="Redo"/>
+    </div>
 
-	<div id="circle_panel">
-		<img class="tool_sep" src="%(htdocs)s/images/sep.png" alt="|"/>
-		<label class="circle_tool">cx:</label>
-		<input id="circle_cx" class="circle_tool attr_changer" title="Change circle's cx coordinate" alt="cx" size="3"/>
-		<label class="circle_tool">cy:</label>
-		<input id="circle_cy" class="circle_tool attr_changer" title="Change circle's cy coordinate" alt="cy" size="3"/>
-		<label class="circle_tool">r:</label>
-		<input id="circle_r" class="circle_tool attr_changer" title="Change circle's radius" alt="r" size="3"/>
-	</div>
-
-	<div id="ellipse_panel">
-		<img class="tool_sep" src="%(htdocs)s/images/sep.png" alt="|"/>
-		<label class="ellipse_tool">cx:</label>
-		<input id="ellipse_cx" class="ellipse_tool attr_changer" title="Change ellipse's cx coordinate" alt="cx" size="3"/>
-		<label class="ellipse_tool">cy:</label>
-		<input id="ellipse_cy" class="ellipse_tool attr_changer" title="Change ellipse's cy coordinate" alt="cy" size="3"/>
-		<label class="ellipse_tool">rx:</label>
-		<input id="ellipse_rx" class="ellipse_tool attr_changer" title="Change ellipse's x radius" alt="rx" size="3"/>
-		<label class="ellipse_tool">ry:</label>
-		<input id="ellipse_ry" class="ellipse_tool attr_changer" title="Change ellipse's y radius" alt="ry" size="3"/>
-	</div>
-
-	<div id="line_panel">
-		<img class="tool_sep" src="%(htdocs)s/images/sep.png" alt="|"/>
-		<label class="line_tool">x1:</label>
-		<input id="line_x1" class="line_tool attr_changer" title="Change line's starting x coordinate" alt="x1" size="3"/>
-		<label class="line_tool">y1:</label>
-		<input id="line_y1" class="line_tool attr_changer" title="Change line's starting y coordinate" alt="y1" size="3"/>
-		<label class="line_tool">x2:</label>
-		<input id="line_x2" class="line_tool attr_changer" title="Change line's ending x coordinate" alt="x2" size="3"/>
-		<label class="line_tool">y2:</label>
-		<input id="line_y2" class="line_tool attr_changer" title="Change line's ending y coordinate" alt="x1" size="3"/>
-	</div>
+    <!-- Buttons when a single element is selected -->
+    <div id="selected_panel">
+        <img class="tool_sep" src="%(htdocs)s/images/sep.png" alt="|"/>
+        <img class="tool_button" id="tool_clone" src="%(htdocs)s/images/clone.png" title="Clone Element [C]" alt="Copy"/>
+        <img class="tool_button" id="tool_delete" src="%(htdocs)s/images/delete.png" title="Delete Element [Delete/Backspace]" alt="Delete"/>
+        <img class="tool_sep" src="%(htdocs)s/images/sep.png" alt="|"/>
+        <img class="tool_button" id="tool_move_top" src="%(htdocs)s/images/move_top.png" title="Move to Top [Shift+Up]" alt="Top"/>
+        <img class="tool_button" id="tool_move_bottom" src="%(htdocs)s/images/move_bottom.png" title="Move to Bottom [Shift+Down]" alt="Bottom"/>
+        <img class="tool_sep" src="%(htdocs)s/images/sep.png" alt="|"/>
+        <select id="group_opacity" class="selected_tool" title="Change selected item opacity">
+            <option selected="selected" value="1">100 %%</option>
+            <option value="0.9">90 %%</option>
+            <option value="0.8">80 %%</option>
+            <option value="0.7">70 %%</option>
+            <option value="0.6">60 %%</option>
+            <option value="0.5">50 %%</option>
+            <option value="0.4">40 %%</option>
+            <option value="0.3">30 %%</option>
+            <option value="0.2">20 %%</option>
+            <option value="0.1">10 %%</option>
+        </select>
+        <span class="selected_tool">angle:</span>
+        <input id="angle" class="selected_tool" title="Change rotation angle" alt="Rotation Angle" size="2" value="0" type="text"/>
+    </div>
 
-	<div id="text_panel">
-		<img class="tool_sep" src="%(htdocs)s/images/sep.png" alt="|"/>
-		<label class="text_tool">x:</label>
-		<input id="text_x" class="text_tool attr_changer" title="Change text X coordinate" alt="x" size="3"/>
-		<label class="text_tool">y:</label>
-		<input id="text_y" class="text_tool attr_changer" title="Change text Y coordinate" alt="y" size="3"/>
-		<img class="tool_button" id="tool_bold" src="%(htdocs)s/images/bold.png" title="Bold Text [B]" alt="Bold"/>
-		<img class="tool_button" id="tool_italic" src="%(htdocs)s/images/italic.png" title="Italic Text [I]" alt="Italic"/>
-		<select id="font_family" class="text_tool" title="Change Font Family">
-			<option selected="selected" value="serif">serif</option>
-			<option value="sans-serif">sans-serif</option>
-			<option value="cursive">cursive</option>
-			<option value="fantasy">fantasy</option>
-			<option value="monospace">monospace</option>
-		</select>
-		<select id="font_size" class="text_tool" title="Change Font Size">
-			<option value="6pt">6pt</option>
-			<option value="8pt">8pt</option>
-			<option value="10pt">10pt</option>
-			<option selected="selected" value="12pt">12pt</option>
-			<option value="14pt">14pt</option>
-			<option value="16pt">16pt</option>
-			<option value="20pt">20pt</option>
-			<option value="24pt">24pt</option>
-			<option value="32pt">32pt</option>
-			<option value="48pt">48pt</option>
-			<option value="64pt">64pt</option>
-			<option value="72pt">72pt</option>
-			<option value="80pt">80pt</option>
-			<option value="96pt">96pt</option>
-			<option value="120pt">120pt</option>
-		</select>
-		<input id="text" class="text_tool" type="text" title="Change text contents" size="35"/>
-	</div>
+    <!-- Buttons when multiple elements are selected -->
+    <div id="multiselected_panel">
+        <img class="tool_sep" src="%(htdocs)s/images/sep.png" alt="|"/>
+        <img class="tool_button" id="tool_clone_multi" src="%(htdocs)s/images/clone.png" title="Clone Elements [C]" alt="Clone"/>
+        <img class="tool_button" id="tool_delete_multi" src="%(htdocs)s/images/delete.png" title="Delete Selected Elements [Delete/Backspace]" alt="Delete"/>
+        <img class="tool_sep" src="%(htdocs)s/images/sep.png" alt="|"/>
+        <img class="tool_button" id="tool_alignleft" src="%(htdocs)s/images/align-left.png" title="Align Left" alt="Left"/>
+        <img class="tool_button" id="tool_aligncenter" src="%(htdocs)s/images/align-center.png" title="Align Center" alt="Center"/>
+        <img class="tool_button" id="tool_alignright" src="%(htdocs)s/images/align-right.png" title="Align Right" alt="Right"/>
+        <img class="tool_button" id="tool_aligntop" src="%(htdocs)s/images/align-top.png" title="Align Top" alt="Top"/>
+        <img class="tool_button" id="tool_alignmiddle" src="%(htdocs)s/images/align-middle.png" title="Align Middle" alt="Middle"/>
+        <img class="tool_button" id="tool_alignbottom" src="%(htdocs)s/images/align-bottom.png" title="Align Bottom" alt="Bottom"/>
+        <span class="selected_tool">relative to:</span>
+        <select id="align_relative_to" class="selected_tool" title="Align relative to ...">
+        <option value="selected">selected objects</option>
+        <option value="largest">largest object</option>
+        <option value="smallest">smallest object</option>
+        <option value="page">page</option>
+        </select>
+    </div>
+
+    <div id="rect_panel">
+        <img class="tool_sep" src="%(htdocs)s/images/sep.png" alt="|"/>
+        <label class="rect_tool">x:</label>
+        <input id="rect_x" class="rect_tool attr_changer" title="Change rectangle X coordinate" alt="x" size="3"/>
+        <label class="rect_tool">y:</label>
+        <input id="rect_y" class="rect_tool attr_changer" title="Change rectangle Y coordinate" alt="y" size="3"/>
+        <label class="rect_tool">width:</label>
+        <input id="rect_width" class="rect_tool attr_changer" title="Change rectangle width" alt="width" size="3"/>
+        <label class="rect_tool">height:</label>
+        <input id="rect_height" class="rect_tool attr_changer" title="Change rectangle height" alt="height" size="3"/>
+        <label class="rect_tool">Corner Radius:</label>
+        <input id="rect_rx" size="3" value="0" class="rect_tool" type="text" title="Change Rectangle Corner Radius" alt="Corner Radius"/>
+    </div>
+
+    <div id="circle_panel">
+        <img class="tool_sep" src="%(htdocs)s/images/sep.png" alt="|"/>
+        <label class="circle_tool">cx:</label>
+        <input id="circle_cx" class="circle_tool attr_changer" title="Change circle's cx coordinate" alt="cx" size="3"/>
+        <label class="circle_tool">cy:</label>
+        <input id="circle_cy" class="circle_tool attr_changer" title="Change circle's cy coordinate" alt="cy" size="3"/>
+        <label class="circle_tool">r:</label>
+        <input id="circle_r" class="circle_tool attr_changer" title="Change circle's radius" alt="r" size="3"/>
+    </div>
+
+    <div id="ellipse_panel">
+        <img class="tool_sep" src="%(htdocs)s/images/sep.png" alt="|"/>
+        <label class="ellipse_tool">cx:</label>
+        <input id="ellipse_cx" class="ellipse_tool attr_changer" title="Change ellipse's cx coordinate" alt="cx" size="3"/>
+        <label class="ellipse_tool">cy:</label>
+        <input id="ellipse_cy" class="ellipse_tool attr_changer" title="Change ellipse's cy coordinate" alt="cy" size="3"/>
+        <label class="ellipse_tool">rx:</label>
+        <input id="ellipse_rx" class="ellipse_tool attr_changer" title="Change ellipse's x radius" alt="rx" size="3"/>
+        <label class="ellipse_tool">ry:</label>
+        <input id="ellipse_ry" class="ellipse_tool attr_changer" title="Change ellipse's y radius" alt="ry" size="3"/>
+    </div>
+
+    <div id="line_panel">
+        <img class="tool_sep" src="%(htdocs)s/images/sep.png" alt="|"/>
+        <label class="line_tool">x1:</label>
+        <input id="line_x1" class="line_tool attr_changer" title="Change line's starting x coordinate" alt="x1" size="3"/>
+        <label class="line_tool">y1:</label>
+        <input id="line_y1" class="line_tool attr_changer" title="Change line's starting y coordinate" alt="y1" size="3"/>
+        <label class="line_tool">x2:</label>
+        <input id="line_x2" class="line_tool attr_changer" title="Change line's ending x coordinate" alt="x2" size="3"/>
+        <label class="line_tool">y2:</label>
+        <input id="line_y2" class="line_tool attr_changer" title="Change line's ending y coordinate" alt="x1" size="3"/>
+    </div>
+
+    <div id="text_panel">
+        <img class="tool_sep" src="%(htdocs)s/images/sep.png" alt="|"/>
+        <label class="text_tool">x:</label>
+        <input id="text_x" class="text_tool attr_changer" title="Change text X coordinate" alt="x" size="3"/>
+        <label class="text_tool">y:</label>
+        <input id="text_y" class="text_tool attr_changer" title="Change text Y coordinate" alt="y" size="3"/>
+        <img class="tool_button" id="tool_bold" src="%(htdocs)s/images/bold.png" title="Bold Text [B]" alt="Bold"/>
+        <img class="tool_button" id="tool_italic" src="%(htdocs)s/images/italic.png" title="Italic Text [I]" alt="Italic"/>
+        <select id="font_family" class="text_tool" title="Change Font Family">
+            <option selected="selected" value="serif">serif</option>
+            <option value="sans-serif">sans-serif</option>
+            <option value="cursive">cursive</option>
+            <option value="fantasy">fantasy</option>
+            <option value="monospace">monospace</option>
+        </select>
+        <select id="font_size" class="text_tool" title="Change Font Size">
+            <option value="6pt">6pt</option>
+            <option value="8pt">8pt</option>
+            <option value="10pt">10pt</option>
+            <option selected="selected" value="12pt">12pt</option>
+            <option value="14pt">14pt</option>
+            <option value="16pt">16pt</option>
+            <option value="20pt">20pt</option>
+            <option value="24pt">24pt</option>
+            <option value="32pt">32pt</option>
+            <option value="48pt">48pt</option>
+            <option value="64pt">64pt</option>
+            <option value="72pt">72pt</option>
+            <option value="80pt">80pt</option>
+            <option value="96pt">96pt</option>
+            <option value="120pt">120pt</option>
+        </select>
+        <input id="text" class="text_tool" type="text" title="Change text contents" size="35"/>
+    </div>
 </div> <!-- tools_top -->
 
 <div id="tools_left" class="tools_panel">
-	<img class="tool_button_current" id="tool_select" src="%(htdocs)s/images/select.png" title="Select Tool [1]" alt="Select"/><br/>
-	<img class="tool_button" id="tool_path" src="%(htdocs)s/images/path.png" title="Pencil Tool [2]" alt="Pencil"/><br/>
-	<img class="tool_button" id="tool_line" src="%(htdocs)s/images/line.png" title="Line Tool [3]" alt="Line"/><br/>
-	<img class="tool_button" id="tools_rect_show" src="%(htdocs)s/images/square.png" title="Square/Rect Tool [4/Shift+4]" alt="Square"/><br/>
-	<img class="tool_button" id="tools_ellipse_show" src="%(htdocs)s/images/circle.png" title="Ellipse/Circle Tool [5/Shift+5]" alt="Circle"/><br/>
-	<img class="tool_button" id="tool_text" src="%(htdocs)s/images/text.png" title="Text Tool [6]" alt="Text"/>
-	<img class="tool_button" id="tool_poly" src="%(htdocs)s/images/polygon.png" title="Poly Tool [7]" alt="Poly"/>
+    <img class="tool_button_current" id="tool_select" src="%(htdocs)s/images/select.png" title="Select Tool [1]" alt="Select"/><br/>
+    <img class="tool_button" id="tool_path" src="%(htdocs)s/images/path.png" title="Pencil Tool [2]" alt="Pencil"/><br/>
+    <img class="tool_button" id="tool_line" src="%(htdocs)s/images/line.png" title="Line Tool [3]" alt="Line"/><br/>
+    <img class="tool_button" id="tools_rect_show" src="%(htdocs)s/images/square.png" title="Square/Rect Tool [4/Shift+4]" alt="Square"/>
+    <img class="flyout_arrow_horiz" src="%(htdocs)s/images/flyouth.png"/>
+    <img class="tool_button" id="tools_ellipse_show" src="%(htdocs)s/images/circle.png" title="Ellipse/Circle Tool [5/Shift+5]" alt="Circle"/><br/>
+    <img class="flyout_arrow_horiz" src="%(htdocs)s/images/flyouth.png"/>
+    <img class="tool_button" id="tool_text" src="%(htdocs)s/images/text.png" title="Text Tool [6]" alt="Text"/>
+    <img class="tool_button" id="tool_poly" src="%(htdocs)s/images/polygon.png" title="Poly Tool [7]" alt="Poly"/>
 </div> <!-- tools_left -->
 
 <div id="tools_bottom" class="tools_panel">
 
-	<div id="tools_bottom_1">
-		<select id="resolution">
-			<option selected="selected">640x480</option>
-			<option>800x600</option>
-			<option>1024x768</option>
-			<option>1280x960</option>
-			<option>1600x1200</option>
-		</select>
-	</div>
+    <div id="tools_bottom_1">
+        <select id="resolution">
+            <option selected="selected">640x480</option>
+            <option>800x600</option>
+            <option>1024x768</option>
+            <option>1280x960</option>
+            <option>1600x1200</option>
+            <option>Fit to Content</option>
+            <option>Custom</option>
+        </select>
+    </div>
 
-	<div id="tools_bottom_2">
-		<table>
-		<tr>
-			<td>fill:</td>
-			<td><div id="fill_color" class="color_block"  title="Change fill color"></div></td>
-			<td><div id="fill_opacity">100 %%</div></td>
-		</tr><tr>
-			<td>stroke:</td>
-			<td><div id="stroke_color" class="color_block" title="Change stroke color"></div></td>
-			<td><div id="stroke_opacity">100 %%</div></td>
-			<td>
-				<input id="stroke_width" title="Change stroke width" alt="Stroke Width" size="2" value="5" type="text"/>
-			</td>
-			<td>
-				<select id="stroke_style" title="Change stroke dash style">
-					<option selected="selected" value="none">---</option>
-					<option value="2,2">...</option>
-					<option value="5,5">- -</option>
-					<option value="5,2,2,2">- .</option>
-					<option value="5,2,2,2,2,2">- ..</option>
-				</select>
-			</td>
-		</tr>
-		</table>
-	</div>
+    <div id="tools_bottom_2">
+        <table>
+        <tr>
+            <td>fill:</td>
+            <td><div id="fill_color" class="color_block"  title="Change fill color"></div></td>
+            <td><div id="fill_opacity">100%%</div></td>
+        </tr><tr>
+            <td>stroke:</td>
+            <td><div id="stroke_color" class="color_block" title="Change stroke color"></div></td>
+            <td><div id="stroke_opacity">100 %%</div></td>
+            <td>
+                <input id="stroke_width" title="Change stroke width" alt="Stroke Width" size="2" value="5" type="text"/>
+            </td>
+            <td>
+                <select id="stroke_style" title="Change stroke dash style">
+                    <option selected="selected" value="none">---</option>
+                    <option value="2,2">...</option>
+                    <option value="5,5">- -</option>
+                    <option value="5,2,2,2">- .</option>
+                    <option value="5,2,2,2,2,2">- ..</option>
+                </select>
+            </td>
+        </tr>
+        </table>
+    </div>
 
-	<div id="tools_bottom_3">
-		<div id="palette_holder"><div id="palette" title="Click to change fill color, shift-click to change stroke color"></div></div>
-		<div id="copyright">Powered by <a href="http://svg-edit.googlecode.com/" target="_blank">SVG-edit v2.3-preAlpha</a></div>
-	</div>
+    <div id="tools_bottom_3">
+        <div id="palette_holder"><div id="palette" title="Click to change fill color, shift-click to change stroke color"></div></div>
+        <div id="copyright">Powered by <a href="http://svg-edit.googlecode.com/" target="_blank">SVG-edit v2.3-Alpha</a></div>
+    </div>
 </div>
 
 <!-- hidden divs -->
 <div id="color_picker"></div>
 
 <div id="tools_rect" class="tools_flyout">
-	<div id="tool_square" class="tool_flyout_button" title="Square"></div>
-	<div id="tool_rect" class="tool_flyout_button" title="Rectangle"></div>
-	<div id="tool_fhrect" class="tool_flyout_button" title="Free-Hand Rectangle"></div>
+    <div id="tool_square" class="tool_flyout_button" title="Square"></div>
+    <div id="tool_rect" class="tool_flyout_button" title="Rectangle"></div>
+    <div id="tool_fhrect" class="tool_flyout_button" title="Free-Hand Rectangle"></div>
 </div>
 
 <div id="tools_ellipse" class="tools_flyout">
-	<div id="tool_circle" class="tool_flyout_button" title="Circle"></div>
-	<div id="tool_ellipse" class="tool_flyout_button" title="Ellipse"></div>
-	<div id="tool_fhellipse" class="tool_flyout_button" title="Free-Hand Ellipse"></div>
+    <div id="tool_circle" class="tool_flyout_button" title="Circle"></div>
+    <div id="tool_ellipse" class="tool_flyout_button" title="Ellipse"></div>
+    <div id="tool_fhellipse" class="tool_flyout_button" title="Free-Hand Ellipse"></div>
 </div>
 
 <div id="tools_stacking" class="tools_flyout_v">
-	<div id="tool_stacktop" class="tool_flyout_button" title="Move to Top [Shift+Up]"></div>
-	<div id="tool_stackbottom" class="tool_flyout_button" title="Move to Bottom [Shift+Down]"></div>
+    <div id="tool_stacktop" class="tool_flyout_button" title="Move to Top [Shift+Up]"></div>
+    <div id="tool_stackbottom" class="tool_flyout_button" title="Move to Bottom [Shift+Down]"></div>
 </div>
 
 <div id="tools_align" class="tools_flyout_v">
-	<div id="tool_aligntop" class="tool_flyout_button" title="Align to Top"></div>
-	<div id="tool_alignbottom" class="tool_flyout_button" title="Align to Bottom"></div>
-	<div id="tool_alignmiddle" class="tool_flyout_button" title="Align to Middle"></div>
-	<div id="tool_alignleft" class="tool_flyout_button" title="Align to Left"></div>
-	<div id="tool_alignright" class="tool_flyout_button" title="Align to Right"></div>
-	<div id="tool_aligncenter" class="tool_flyout_button" title="Align to Center"></div>
+    <div id="tool_aligntop" class="tool_flyout_button" title="Align to Top"></div>
+    <div id="tool_alignbottom" class="tool_flyout_button" title="Align to Bottom"></div>
+    <div id="tool_alignmiddle" class="tool_flyout_button" title="Align to Middle"></div>
+    <div id="tool_alignleft" class="tool_flyout_button" title="Align to Left"></div>
+    <div id="tool_alignright" class="tool_flyout_button" title="Align to Right"></div>
+    <div id="tool_aligncenter" class="tool_flyout_button" title="Align to Center"></div>
 </div>
 
 </div> <!-- svg_editor -->
 
 <div id="svg_source_editor">
-	<div id="svg_source_overlay"></div>
-	<div id="svg_source_container">
-		<div id="tool_source_back" class="toolbar_button"></div>
-		<form>
-			<textarea id="svg_source_textarea"></textarea>
-		</form>
-	</div>
+    <div id="svg_source_overlay"></div>
+    <div id="svg_source_container">
+        <div id="tool_source_back" class="toolbar_button">
+            <button id="tool_source_save">Save</button>
+            <button id="tool_source_cancel">Cancel</button>
+        </div>
+        <form>
+            <textarea id="svg_source_textarea"></textarea>
+        </form>
+    </div>
 </div>
 
-<script type="text/javascript">
-$(document).ready(svg_edit_setup);
-</script>
-
 """ % {"htdocs": htdocs,
        "filecontent": filecontent,
        }
--- a/htdocs/svg-edit/editor/svg-editor.css	Thu Aug 27 23:24:24 2009 +0200
+++ b/htdocs/svg-edit/editor/svg-editor.css	Fri Aug 28 09:39:07 2009 +0200
@@ -3,6 +3,9 @@
 }
 
 #svg_editor {
+    position: relative;
+    width: 660px;
+    height: 640px;
 	font-size: 8pt;
 	font-family: Verdana, Helvetica, Arial;
 	color: #000000;
@@ -26,6 +29,7 @@
 }
 
 #svg_editor #svgcanvas {
+    position: relative;
 	background-color: #FFFFFF;
 	text-align: center;
 	vertical-align: middle;
@@ -35,6 +39,7 @@
 }
 
 #svg_editor div#palette_holder {
+    position: relative;
 	overflow-x: scroll;
 	overflow-y: hidden;
 	height: 31px;
@@ -57,11 +62,12 @@
 }
 
 #svg_editor div#workarea {
-	position:absolute;
-	top: 70px;
+	position: relative;
+    width: 100%;
+	top: 80px;
 	left: 40px;
 	right: 2px;
-	bottom: 60px;
+	bottom: 0px;
 	background-color: #A0A0A0;
 	border: 1px solid #808080;
 	overflow: auto;
@@ -74,6 +80,7 @@
 }
 
 #svg_editor #logo {
+    display: None;
 	position: absolute;
 	top: 4px;
 	left: 4px;
@@ -91,7 +98,7 @@
 	left: 38px;
 	right: 2px;
 	top: 2px;
-	height: 68px;
+	height: 58px;
 	border-bottom: none;
 }
 
@@ -103,7 +110,7 @@
 	position: absolute;
 	border-right: none;
 	width: 36px;
-	top: 68px;
+	top: 78px;
 	left: 2px;
 }
 
@@ -192,6 +199,7 @@
 }
 
 #svg_editor .tool_button_current {
+    position: relative;
 	border-left: 1px solid #808080;
 	border-top: 1px solid #808080;
 	border-right: 1px solid #FFFFFF;
@@ -200,11 +208,13 @@
 }
 
 #svg_editor .tool_button_disabled {
+    position: relative;
 	opacity: 0.5;
 	cursor: default;
 }
 
 #svg_editor .tool_sep {
+    position: relative;
 	width: 2px;
 	height: 24px;
 	margin: 2px;
@@ -249,6 +259,7 @@
 /* TODO: figure out what more-specific selector causes me to write this atrocity and not
          simply .tool_flyout_button */
 #svg_editor #tools_rect .tool_flyout_button, #svg_editor #tools_ellipse .tool_flyout_button {
+    position: relative;
 	float: left;
 	background-color: #E8E8E8;
 	border-left: 1px solid #FFFFFF;
@@ -268,14 +279,16 @@
 }
 
 #svg_editor #tools_bottom {
-	position: absolute;
+	position: relative;
+    top: 80px;
 	left: 40px;
-	right: 2px;
-	bottom: 2px;
-	height: 60px;
+	right: 0px;
+	bottom: 0px;
+	height: 0px;
 }
 
 #svg_editor #tools_bottom_1 {
+    display: none;
 	width: 115px;
 	float: left;
 }
@@ -286,6 +299,7 @@
 }
 
 #svg_editor #tools_bottom_3 {
+    position: relative;
 }
 
 #svg_editor #copyright {
--- a/htdocs/svg-edit/editor/svg-editor.js	Thu Aug 27 23:24:24 2009 +0200
+++ b/htdocs/svg-edit/editor/svg-editor.js	Fri Aug 28 09:39:07 2009 +0200
@@ -10,7 +10,22 @@
 
 	var isMac = false; //(navigator.platform.indexOf("Mac") != -1);
 	var modKey = ""; //(isMac ? "meta+" : "ctrl+");
+    var htdocs = document.getElementById("htdocs").innerHTML.replace('<!-- ', '').replace(' -->', '');
+    var svg = document.getElementById("svgdata");
 	var svgCanvas = new SvgCanvas(document.getElementById("svgcanvas"));
+    var filecontent =  svg.innerHTML;
+     // because moin uses currently HTML 4.0.1 we send the data as a comment in the HTML code
+    filecontent = filecontent.replace('<!-- ', '').replace(' -->', '');
+    if (filecontent != '') {
+         if (!svgCanvas.setSvgString(filecontent)) {
+             if( !confirm('There were parsing errors in your SVG source.\nRevert back to original SVG source?') ) {
+                return false;
+             }
+         }
+         svgCanvas.clearSelection();
+    }
+
+
 
 	var setSelectMode = function() {
 		$('.tool_button_current').removeClass('tool_button_current').addClass('tool_button');
@@ -36,7 +51,17 @@
 	// with a gradient will appear black in Firefox, etc.  See bug 308590
 	// https://bugzilla.mozilla.org/show_bug.cgi?id=308590
 	var saveHandler = function(window,svg) {
-		window.open("data:image/svg+xml;base64," + Utils.encode64(svg));
+        var titlename = window.content.parent.document.title.split('-')[0];
+        titlename = titlename.replace(' ', '');
+        var svg_data = Utils.encode64(svg);
+        var pagename = titlename.split(':')[0];
+        var svg_target = titlename.split(':')[1];
+        $.post(
+               pagename,
+               {'action': "SvgEditor", 'do': "save", 'target': svg_target, 'svg_data': svg_data}
+               );
+
+	//	window.open("data:image/svg+xml;base64," + Utils.encode64(svg));
 	};
 
 	// called when we've selected a different element
@@ -393,21 +418,21 @@
 			flyoutspeed = 'normal';
 			svgCanvas.setMode('square');
 		}
-		$('#tools_rect_show').attr('src', 'images/square.png');
+		$('#tools_rect_show').attr('src', htdocs + 'images/square.png');
 	};
 
 	var clickRect = function(){
 		if (toolButtonClick('#tools_rect_show')) {
 			svgCanvas.setMode('rect');
 		}
-		$('#tools_rect_show').attr('src', 'images/rect.png');
+		$('#tools_rect_show').attr('src', htdocs + 'images/rect.png');
 	};
 
 	var clickFHRect = function(){
 		if (toolButtonClick('#tools_rect_show')) {
 			svgCanvas.setMode('fhrect');
 		}
-		$('#tools_rect_show').attr('src', 'images/freehand-square.png');
+		$('#tools_rect_show').attr('src', htdocs + 'images/freehand-square.png');
 	};
 
 	var clickCircle = function(){
@@ -415,21 +440,21 @@
 			flyoutspeed = 'normal';
 			svgCanvas.setMode('circle');
 		}
-		$('#tools_ellipse_show').attr('src', 'images/circle.png');
+		$('#tools_ellipse_show').attr('src', htdocs + 'images/circle.png');
 	};
 
 	var clickEllipse = function(){
 		if (toolButtonClick('#tools_ellipse_show')) {
 			svgCanvas.setMode('ellipse');
 		}
-		$('#tools_ellipse_show').attr('src', 'images/ellipse.png');
+		$('#tools_ellipse_show').attr('src', htdocs + 'images/ellipse.png');
 	};
 
 	var clickFHEllipse = function(){
 		if (toolButtonClick('#tools_ellipse_show')) {
 			svgCanvas.setMode('fhellipse');
 		}
-		$('#tools_ellipse_show').attr('src', 'images/freehand-circle.png');
+		$('#tools_ellipse_show').attr('src', htdocs + 'images/freehand-circle.png');
 	};
 
 	var clickText = function(){