Commit 41c9ddf3 authored by Ronny's avatar Ronny

格式错误提示

parent ee997550
...@@ -94,14 +94,17 @@ KityMinder.registerProtocal( 'mindmanager', function () { ...@@ -94,14 +94,17 @@ KityMinder.registerProtocal( 'mindmanager', function () {
then: function ( local, callback ) { then: function ( local, callback ) {
getEntries( local, function ( entries ) { getEntries( local, function ( entries ) {
var hasMainDoc = false;
entries.forEach( function ( entry ) { entries.forEach( function ( entry ) {
if ( entry.filename == 'Document.xml' ) { if ( entry.filename == 'Document.xml' ) {
hasMainDoc = true;
entry.getData( new zip.TextWriter(), function ( text ) { entry.getData( new zip.TextWriter(), function ( text ) {
var km = xml2km( $.parseXML( text ) ); var km = xml2km( $.parseXML( text ) );
callback && callback( km ); callback && callback( km );
} ); } );
} }
} ); } );
!hasMainDoc && alert('找不到文件主文档,请检查文件是否是合法mindmanager格式文件');
} ); } );
} }
}; };
......
...@@ -100,14 +100,18 @@ KityMinder.registerProtocal( 'xmind', function () { ...@@ -100,14 +100,18 @@ KityMinder.registerProtocal( 'xmind', function () {
then : function(local, callback){ then : function(local, callback){
getEntries( local, function( entries ) { getEntries( local, function( entries ) {
var hasMainDoc = false;
entries.forEach(function( entry ) { entries.forEach(function( entry ) {
if(entry.filename == 'content.xml'){ if(entry.filename == 'content.xml'){
hasMainDoc = true;
entry.getData(new zip.TextWriter(), function(text) { entry.getData(new zip.TextWriter(), function(text) {
var km = xml2km($.parseXML(text)); var km = xml2km($.parseXML(text));
callback && callback( km ); callback && callback( km );
}); });
} }
}); });
!hasMainDoc && alert('找不到文件主文档,请检查文件是否是合法xmind格式文件');
}); });
} }
}; };
......
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