changeset 402:50a89a6cdf6a

SvgEditor: fixed url for clickable tools
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Tue, 25 Aug 2009 22:20:21 +0200
parents b1a9b182d9fd
children e8fb1a159800
files data/plugin/action/SvgEditor.py htdocs/svg-edit/CHANGES.current htdocs/svg-edit/editor/svg-editor.js
diffstat 3 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/action/SvgEditor.py	Tue Aug 25 20:58:13 2009 +0200
+++ b/data/plugin/action/SvgEditor.py	Tue Aug 25 22:20:21 2009 +0200
@@ -67,6 +67,7 @@
 """ % {"htdocs": htdocs} 
 
     html = """
+<div id="htdocs"><!-- %(htdocs)s/ --></div>    
 <div id="svg_editor">
 <div id="workarea">
 <style id="styleoverrides" type="text/css"></style>
--- a/htdocs/svg-edit/CHANGES.current	Tue Aug 25 20:58:13 2009 +0200
+++ b/htdocs/svg-edit/CHANGES.current	Tue Aug 25 22:20:21 2009 +0200
@@ -11,7 +11,6 @@
 
 ToDo
  * adjust coordinates for drawing tools (offset probably from relative)
- * fix wrong url for square and circle 
 
 SVG-edit is a lightweight, web-based, Javascript-driven SVG editor that works in any modern browser: initial version of svg-edit Revision r448 (http://code.google.com/p/svg-edit/) for moin-1.9 added
 
--- a/htdocs/svg-edit/editor/svg-editor.js	Tue Aug 25 20:58:13 2009 +0200
+++ b/htdocs/svg-edit/editor/svg-editor.js	Tue Aug 25 22:20:21 2009 +0200
@@ -10,7 +10,7 @@
 
 	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;
@@ -412,21 +412,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(){
@@ -434,21 +434,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(){