From 7ec9326ce00d08f9d957981f2edff6df26f24a28 Mon Sep 17 00:00:00 2001 From: jinlin <jinlin> Date: 星期四, 26 九月 2024 13:25:02 +0800 Subject: [PATCH] 修改 --- web/public/SVGOrigin/Method-Draw-master/method-draw/extensions/ext-server_opensave.js | 62 +++++++++++++++--------------- 1 files changed, 31 insertions(+), 31 deletions(-) diff --git a/web/public/SVGOrigin/Method-Draw-master/method-draw/extensions/ext-server_opensave.js b/web/public/SVGOrigin/Method-Draw-master/method-draw/extensions/ext-server_opensave.js index 140e920..5e4dddf 100644 --- a/web/public/SVGOrigin/Method-Draw-master/method-draw/extensions/ext-server_opensave.js +++ b/web/public/SVGOrigin/Method-Draw-master/method-draw/extensions/ext-server_opensave.js @@ -12,17 +12,17 @@ //var save_svg_action = 'extensions/filesave.php'; //var save_png_action = 'extensions/filesave.php'; - + // Create upload target (hidden iframe) var target = $('<iframe name="output_frame" />').hide().appendTo('body'); - + //methodDraw.setCustomHandlers({ // save: function(win, data) { // var svg = "<?xml version=\"1.0\"?>\n" + data; - // + // // var title = svgCanvas.getDocumentTitle(); // var filename = title.replace(/[^a-z0-9\.\_\-]+/gi, '_'); - // + // // var form = $('<form>').attr({ // method: 'post', // action: save_svg_action, @@ -34,33 +34,33 @@ // }, // pngsave: function(win, data) { // var issues = data.issues; - // + // // if(!$('#export_canvas').length) { // $('<canvas>', {id: 'export_canvas'}).hide().appendTo('body'); // } // var c = $('#export_canvas')[0]; - // + // // c.width = svgCanvas.contentW; // c.height = svgCanvas.contentH; // canvg(c, data.svg, {renderCallback: function() { // var datauri = c.toDataURL('image/png'); - // + // // var uiStrings = methodDraw.uiStrings; // var note = ''; - // + // // // Check if there's issues // if(issues.length) { // var pre = "\n \u2022 "; // note += ("\n\n" + pre + issues.join(pre)); - // } - // + // } + // // if(note.length) { // alert(note); // } - // + // // var title = svgCanvas.getDocumentTitle(); // var filename = title.replace(/[^a-z0-9\.\_\-]+/gi, '_'); - // + // // var form = $('<form>').attr({ // method: 'post', // action: save_png_action, @@ -71,33 +71,33 @@ // .submit().remove(); // }}); // - // + // // } //}); - + // Do nothing if client support is found if(window.FileReader) return; - + var cancelled = false; - + // 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 methodDraw.processFile = function(str64, type) { if(cancelled) { cancelled = false; return; } - + $('#dialog_box').hide(); - + if(type != 'import_img') { var xmlstr = svgCanvas.Utils.decode64(str64); } - + switch ( type ) { case 'load_svg': svgCanvas.clear(); @@ -106,14 +106,14 @@ break; case 'import_svg': svgCanvas.importSvgString(xmlstr); - methodDraw.updateCanvas(); + methodDraw.updateCanvas(); break; case 'import_img': svgCanvas.setGoodImage(str64); break; } } - + // Create upload form var open_svg_form = $('<form>'); open_svg_form.attr({ @@ -122,31 +122,31 @@ action: open_svg_action, target: 'output_frame' }); - + // Create import form var import_svg_form = open_svg_form.clone().attr('action', import_svg_action); - + // Create image form var import_img_form = open_svg_form.clone().attr('action', import_img_action); - - // It appears necessory to rebuild this input every time a file is + + // It appears necessory to rebuild this input every time a file is // selected so the same file can be picked and the change event can fire. function rebuildInput(form) { form.empty(); var inp = $('<input type="file" name="svg_file">').appendTo(form); - - + + function submit() { // This submits the form, which returns the file data using methodDraw.uploadSVG form.submit(); - + rebuildInput(form); $.process_cancel("Uploading...", function() { cancelled = true; $('#dialog_box').hide(); }); } - + if(form[0] == open_svg_form[0]) { inp.change(function() { // This takes care of the "are you sure" dialog box @@ -165,7 +165,7 @@ }); } } - + // Create the input elements rebuildInput(open_svg_form); rebuildInput(import_svg_form); -- Gitblit v1.9.1