diff --git a/editor/extensions/ext-server_moinsave.js b/editor/extensions/ext-server_moinsave.js index 759710f1..c71efa65 100644 --- a/editor/extensions/ext-server_moinsave.js +++ b/editor/extensions/ext-server_moinsave.js @@ -32,7 +32,7 @@ svgEditor.addExtension("server_opensave", { var c = $('#export_canvas')[0]; c.width = svgCanvas.contentW; c.height = svgCanvas.contentH; - $.getScript('canvg/canvg.js', function() { + svgEditor.buildCanvgCallback(function () { canvg(c, svg, {renderCallback: function() { var datauri = c.toDataURL('image/png'); // var uiStrings = svgEditor.uiStrings; @@ -48,7 +48,7 @@ svgEditor.addExtension("server_opensave", { .appendTo('body') .submit().remove(); }}); - }); + })(); alert("Saved! Return to Item View!"); top.window.location = '/'+name; } diff --git a/editor/extensions/ext-server_opensave.js b/editor/extensions/ext-server_opensave.js index 2bd952aa..b4ccf293 100644 --- a/editor/extensions/ext-server_opensave.js +++ b/editor/extensions/ext-server_opensave.js @@ -68,41 +68,41 @@ svgEditor.addExtension("server_opensave", { c.width = svgCanvas.contentW; c.height = svgCanvas.contentH; - canvg(c, data.svg, {renderCallback: function() { - var pre, filename, suffix, - datauri = quality ? c.toDataURL(mimeType, quality) : c.toDataURL(mimeType), - // uiStrings = svgEditor.uiStrings, - note = ''; - - // Check if there are issues - if (issues.length) { - pre = "\n \u2022 "; - note += ("\n\n" + pre + issues.join(pre)); - } - - if(note.length) { - alert(note); - } - - filename = getFileNameFromTitle(); - suffix = '.' + data.type.toLowerCase(); - - if (clientDownloadSupport(filename, suffix, datauri)) { - return; - } + svgEditor.buildCanvgCallback(function () { + canvg(c, data.svg, {renderCallback: function() { + var pre, filename, suffix, + datauri = quality ? c.toDataURL(mimeType, quality) : c.toDataURL(mimeType), + // uiStrings = svgEditor.uiStrings, + note = ''; + + // Check if there are issues + if (issues.length) { + pre = "\n \u2022 "; + note += ("\n\n" + pre + issues.join(pre)); + } + + if(note.length) { + alert(note); + } + + filename = getFileNameFromTitle(); + suffix = '.' + data.type.toLowerCase(); + + if (clientDownloadSupport(filename, suffix, datauri)) { + return; + } - $('