diff --git a/docs/index.html b/docs/index.html index 7e81af5e..635c3177 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1 +1 @@ -
\ No newline at end of file + \ No newline at end of file diff --git a/editor/extensions/ext-server_open.js b/editor/extensions/ext-server_open.js new file mode 100644 index 00000000..7cd23a5b --- /dev/null +++ b/editor/extensions/ext-server_open.js @@ -0,0 +1,94 @@ +/* + * ext-server_open.js + * + * Licensed under the Apache License, Version 2 + * + * Copyright(c) 2010 Alexis Deveria + * + */ + +svgEditor.addExtension("server_open", { + callback: function() { + // Do nothing if client support is found + if(window.FileReader) return; + + // Change these to appropriate script file + var open_svg_action = 'extensions/fileopen.php?type=load_svg'; + var import_svg_action = 'extensions/fileopen.php?type=import_svg'; + var import_img_action = 'extensions/fileopen.php?type=import_img'; + + // Set up function for PHP uploader to use + svgEditor.processFile = function(str64, type) { + var xmlstr = svgCanvas.Utils.decode64(str64); + + switch ( type ) { + case 'load_svg': + svgCanvas.clear(); + svgCanvas.setSvgString(xmlstr); + svgEditor.updateCanvas(); + break; + case 'import_svg': + svgCanvas.importSvgString(xmlstr); + svgEditor.updateCanvas(); + break; + } + } + + // Create upload form + var open_svg_form = $('