From 6f50f5d55ce07cd251ed4509452d2fc2144bc88f Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Fri, 12 Feb 2010 20:29:59 +0000 Subject: [PATCH] Made default save behaviour alert the user on how to saveand when necessary inform of FF bug (on first time saved/bug encountered) git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1385 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svg-editor.js | 54 ++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 29 deletions(-) diff --git a/editor/svg-editor.js b/editor/svg-editor.js index aac1d8e8..1facc531 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -175,35 +175,31 @@ function svg_edit_setup() { // Creates and opens an HTML page that provides a link to the SVG, a preview, and the markup. // Also includes warning about Mozilla bug #308590 when applicable - var title = svgCanvas.getImageTitle() || "Untitled"; - var res = svgCanvas.getResolution(); - var str = encodeURIComponent(svg); - var note = ''; - // Check if FF and has - if(navigator.userAgent.indexOf('Gecko/') !== -1 && svg.indexOf('\ -\ -

Download

\ -

Download image (Follow link, then choose \"Save As\" on your browser)

\ -

Preview

" + note + -"\ -

Markup

\ -\ -"; - window.open("data:text/html;charset=utf-8;base64," + Utils.encode64(htmlpage)); + var win = window.open("data:image/svg+xml;base64," + Utils.encode64(svg)); + + // Alert will only appear the first time saved OR the first time the bug is encountered + var done = $.pref('save_notice_done'); + if(done !== "all") { + + var note = 'Select "Save As..." in your browser to save this image as an SVG file.'; + + // Check if FF and has + if(navigator.userAgent.indexOf('Gecko/') !== -1) { + if(svg.indexOf('