Commit 653d3005 authored by Akikonata's avatar Akikonata

test

parent 8f752790
...@@ -54,6 +54,13 @@ KM.registerToolbarUI( 'saveto', function ( name ) { ...@@ -54,6 +54,13 @@ KM.registerToolbarUI( 'saveto', function ( name ) {
if ( trident && rv != -1 ) iev = 11; if ( trident && rv != -1 ) iev = 11;
return iev; return iev;
}; };
var doSave = function ( d, filename ) {
var winname = window.open( '', '_blank', 'height=1,width=1,top=200,left=300' );
winname.document.open( 'text/html', 'replace' );
winname.document.writeln( d );
winname.document.execCommand( 'saveas', '', filename );
winname.close();
};
comboboxWidget.on( 'comboboxselect', function ( evt, res ) { comboboxWidget.on( 'comboboxselect', function ( evt, res ) {
var data = me.exportData( res.value ); var data = me.exportData( res.value );
var p = KityMinder.findProtocal( res.value ); var p = KityMinder.findProtocal( res.value );
...@@ -61,20 +68,17 @@ KM.registerToolbarUI( 'saveto', function ( name ) { ...@@ -61,20 +68,17 @@ 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 ) {
console.log( "IE" ); doSave( data, filename );
var iframe = document.createElement( 'iframe' );
//iframe.style.display = 'none';
document.appendChild( iframe );
iframe.src = filename;
iframe.contentDocument.body.innerHTML = data;
iframe.contentDocument.execCommand( "SaveAs" );
//document.removeChild( iframe );
} else { } else {
doDownload( url, filename ); doDownload( url, filename );
} }
} else if ( data && data.then ) { } else if ( data && data.then ) {
data.then( function ( url ) { data.then( function ( url ) {
if ( ie_ver() > 0 ) {
doSave( data, filename );
} else {
doDownload( url, filename ); doDownload( url, filename );
}
} ); } );
} }
} ).on( "beforeshow", function () { } ).on( "beforeshow", 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