Don't use a data-url

Pass the SVG to the editor, using
  editor.svgCanvas.setSvgString(selected);
instead. (Suggested by Jeff Schiller)
Fix a bug with line and freehand tools caused
by activating foreignObject tool. (Again, fix
due to Jeff)
Sync with SVG-Edit.
This commit is contained in:
Jacques Distler 2010-02-12 12:34:56 -06:00
parent e744a697c2
commit 52d85c6d01
5 changed files with 110 additions and 77 deletions

View file

@ -82,11 +82,11 @@ function setupSVGedit(path){
f.insert({top: SVGeditButton});
SVGeditButton.disabled = true;
Event.observe(SVGeditButton, 'click', function(){
var editor = window.open(path, 'Edit SVG graphic', 'status=1,resizable=1,scrollbars=1');
if (selected) {
var editor = window.open(path +'?source=data:image/svg+xml;base64,' + window.btoa(selected),
'Editing Existing SVG Graphic', 'status=1,resizable=1,scrollbars=1');
} else {
var editor = window.open(path, 'Creating New SVG graphic', 'status=1,resizable=1,scrollbars=1');
editor.addEventListener("load", function() {
editor.svgCanvas.setSvgString(selected);
}, true);
}
SVGeditButton.disabled = true;
SVGeditButton.value = 'Create SVG graphic';