From 6d4ec994f0f288da4a8a6b43e8ae8a588f3da2a5 Mon Sep 17 00:00:00 2001 From: Brett Zamir Date: Mon, 10 Feb 2014 05:54:17 +0000 Subject: [PATCH] Clarify exportImage option in comments git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2672 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svg-editor.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 1a027393..0fe2d6bd 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -178,7 +178,7 @@ } }; - // Extension mechanisms must call setCustomHandlers with two functions: opts.open and opts.save + // Extension mechanisms may call setCustomHandlers with three functions: opts.open, opts.save, and opts.exportImage // opts.open's responsibilities are: // - invoke a file chooser dialog in 'open' mode // - let user pick a SVG file @@ -187,6 +187,12 @@ // - accept the string contents of the current document // - invoke a file chooser dialog in 'save' mode // - save the file to location chosen by the user + // opts.exportImage's responsibilities (with regard to the object it is supplied in its 2nd argument) are: + // - inform user of any issues supplied via the "issues" property + // - convert the "svg" property SVG string into an image for export; + // utilize the properties "type" (currently 'PNG', 'JPEG', 'BMP', + // 'WEBP'), "mimeType", and "quality" (for 'JPEG' and 'WEBP' + // types) to determine the proper output. Editor.setCustomHandlers = function(opts) { Editor.ready(function() { if (opts.open) {