Commit e51f17ac authored by techird's avatar techird

Merge branch 'dev' of github.com:fex-team/kityminder into dev

parents d1cb7060 e0c85ec1
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="keywords" content="思维导图,脑图,minder,mind,kity"> <meta name="keywords" content="思维导图,脑图,minder,mind,kity">
<meta name="description" content="在线思维导图工具" <meta name="description" content="在线思维导图工具">
<script src="../lib/jquery-2.1.0.min.js" charset="utf-8"></script> <script src="../lib/jquery-2.1.0.min.js" charset="utf-8"></script>
<script src="../lib/ZeroClipboard.min.js" charset="utf-8"></script> <script src="../lib/ZeroClipboard.min.js" charset="utf-8"></script>
<script type="text/javascript"> <script type="text/javascript">
......
...@@ -11,7 +11,7 @@ KM.registerToolbarUI( 'saveto', function ( name ) { ...@@ -11,7 +11,7 @@ KM.registerToolbarUI( 'saveto', function ( name ) {
value: [], value: [],
autowidthitem: [], autowidthitem: [],
enabledRecord: false, enabledRecord: false,
enabledSelected:false enabledSelected: false
}, },
$combox = null, $combox = null,
comboboxWidget = null; comboboxWidget = null;
...@@ -70,9 +70,12 @@ KM.registerToolbarUI( 'saveto', function ( name ) { ...@@ -70,9 +70,12 @@ KM.registerToolbarUI( 'saveto', function ( name ) {
if ( typeof ( data ) == 'string' ) { if ( typeof ( data ) == 'string' ) {
var url = 'data:text/plain; utf-8,' + encodeURIComponent( data ); var url = 'data:text/plain; utf-8,' + encodeURIComponent( data );
if ( ie_ver() > 0 ) { if ( ie_ver() > 0 ) {
alert( '11111111' );
console.log( p.fileExtension );
if ( p.fileExtension === '.km' ) { if ( p.fileExtension === '.km' ) {
console.log( "KM" );
doSave( 'application/x-javascript', data, me.getMinderTitle() ); doSave( 'application/x-javascript', data, me.getMinderTitle() );
} else( p.fileExtension === '.svg' ) {
doSave( 'image/svg+xml', data, filename );
} else { } else {
doSave( 'text/html', data, filename ); doSave( 'text/html', data, filename );
} }
...@@ -81,7 +84,6 @@ KM.registerToolbarUI( 'saveto', function ( name ) { ...@@ -81,7 +84,6 @@ KM.registerToolbarUI( 'saveto', function ( name ) {
} }
} else if ( data && data.then ) { } else if ( data && data.then ) {
data.then( function ( url ) { data.then( function ( url ) {
console.log( url );
if ( ie_ver() > 0 ) { if ( ie_ver() > 0 ) {
//doSave( 'application/base64', url.replace( 'image/octet-stream,', '' ), filename ); //doSave( 'application/base64', url.replace( 'image/octet-stream,', '' ), filename );
} else { } else {
......
...@@ -2,6 +2,7 @@ KityMinder.registerProtocal( "png", function () { ...@@ -2,6 +2,7 @@ KityMinder.registerProtocal( "png", function () {
function loadImage( url, callback ) { function loadImage( url, callback ) {
var image = new Image(); var image = new Image();
image.onload = callback; image.onload = callback;
console.log( url );
image.src = url; image.src = url;
} }
...@@ -27,7 +28,7 @@ KityMinder.registerProtocal( "png", function () { ...@@ -27,7 +28,7 @@ KityMinder.registerProtocal( "png", function () {
ctx = canvas.getContext( '2d' ), ctx = canvas.getContext( '2d' ),
blob, DomURL, url, img, finishCallback; blob, DomURL, url, img, finishCallback;
bgUrl = bgUrl.replace( /"/g, '' );
renderContainer.translate( -renderBox.x, -renderBox.y ); renderContainer.translate( -renderBox.x, -renderBox.y );
svgXml = km.getPaper().container.innerHTML; svgXml = km.getPaper().container.innerHTML;
...@@ -73,7 +74,6 @@ KityMinder.registerProtocal( "png", function () { ...@@ -73,7 +74,6 @@ KityMinder.registerProtocal( "png", function () {
var url = canvas.toDataURL( 'png' ); var url = canvas.toDataURL( 'png' );
return url.replace( 'image/png', 'image/octet-stream' ); return url.replace( 'image/png', 'image/octet-stream' );
} }
loadImage( url, function () { loadImage( url, function () {
var svgImage = this; var svgImage = this;
loadImage( bgUrl, function () { loadImage( bgUrl, function () {
......
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