From de3008d3e4f1bd517b01d32d4d3839fcc63ee162 Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Fri, 5 Feb 2010 22:55:54 -0600 Subject: [PATCH] Some SVG-edit tweaks Remove the XML prolog. Fix focus on save. --- public/javascripts/page_helper.js | 4 ++++ public/svg-edit/editor/svgcanvas.js | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/public/javascripts/page_helper.js b/public/javascripts/page_helper.js index e773f99f..d769c4f4 100644 --- a/public/javascripts/page_helper.js +++ b/public/javascripts/page_helper.js @@ -87,6 +87,7 @@ function setupSVGedit(path){ } else { var editor = window.open(path, 'Spoons!'); } + editor.focus(); }); } var t = $('content'); @@ -131,6 +132,9 @@ function setupSVGedit(path){ Event.observe(window, "message", function(event){ if(event.origin !== my_loc) { return;} t.value = before + event.data + after; + t.focus(); + SVGeditButton.disabled = true; + SVGeditButton.value = 'Create SVG graphic'; }); } diff --git a/public/svg-edit/editor/svgcanvas.js b/public/svg-edit/editor/svgcanvas.js index cda8bc37..cc3bc0a9 100644 --- a/public/svg-edit/editor/svgcanvas.js +++ b/public/svg-edit/editor/svgcanvas.js @@ -1,4 +1,4 @@ -/* +/* * svgcanvas.js * * Licensed under the Apache License, Version 2 @@ -5223,9 +5223,8 @@ function BatchCommand(text) { if(opts) $.extend(save_options, opts); save_options.apply = true; - var str = "\n"; // no need for doctype, see http://jwatt.org/svg/authoring/#doctype-declaration - str += svgCanvasToString(); + var str = svgCanvasToString(); call("saved", str); };