Commit 283ee6b3 authored by Akikonata's avatar Akikonata

added

parent e601b7b8
......@@ -67,6 +67,7 @@ $dependency = Array(
,'src/protocal/plain.js'
,'src/protocal/json.js'
,'src/protocal/png.js'
,'src/protocal/svg.js'
);
$content = "";
......
......@@ -89,6 +89,24 @@ KM.registerToolbarUI( 'saveto', function ( name ) {
};
img.src = url;
return "png";
} else if ( res.value === "svg" ) {
var svghtml = $( "#kityminder .kmui-editor-body" ).html();
// var svg = new Blob( [ svghtml ], {
// type: "image/svg+xml;charset=utf-8"
// } );
var saveFile = function ( data, filename ) {
var save_link = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'a' );
//save_link.href = data;
save_link.href = 'data:image/svg+xml; utf-8,' + svghtml;
save_link.download = filename;
var event = document.createEvent( 'MouseEvents' );
event.initMouseEvent( 'click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null );
save_link.dispatchEvent( event );
};
var filename = 'kityminder_' + ( new Date() ).getTime() + '.svg';
saveFile( svg, filename );
return "svg";
}
var data = me.exportData( res.value );
var p = KityMinder.findProtocal( res.value );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment