From b599a2a54b4f3e7d3c492fbbdceb4b49ce5dcf17 Mon Sep 17 00:00:00 2001 From: Bruno Heridet Date: Sat, 16 Feb 2013 15:36:19 +0000 Subject: [PATCH] fixed old Chrome bug handling for svg saving git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2413 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svg-editor.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/editor/svg-editor.js b/editor/svg-editor.js index d7665aec..9ec96fcd 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -627,15 +627,14 @@ // can just provide their own custom save handler and might not want the XML prolog svg = '\n' + svg; - // Opens the SVG in new window, with warning about Mozilla bug #308590 when applicable - var ua = navigator.userAgent; - - // Chrome 5 (and 6?) don't allow saving, show source instead ( http://code.google.com/p/chromium/issues/detail?id=46735 ) - // IE9 doesn't allow standalone Data URLs ( https://connect.microsoft.com/IE/feedback/details/542600/data-uri-images-fail-when-loaded-by-themselves ) - if ((~ua.indexOf('Chrome') && $.browser.version >= 533) || ~ua.indexOf('MSIE')) { + // IE9 doesn't allow standalone Data URLs + // https://connect.microsoft.com/IE/feedback/details/542600/data-uri-images-fail-when-loaded-by-themselves + if (svgedit.browser.isIE()) { showSourceEditor(0, true); return; } + + // Opens the SVG in new window 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 @@ -644,8 +643,9 @@ var note = uiStrings.notification.saveFromBrowser.replace('%s', 'SVG'); // Check if FF and has - if (ua.indexOf('Gecko/') !== -1) { + if (svgedit.browser.isGecko()) { if (svg.indexOf('