Commit e17578be authored by Ronny's avatar Ronny

添加链接支持

parent 5844741a
...@@ -41,6 +41,11 @@ KityMinder.registerProtocal( 'freemind', function () { ...@@ -41,6 +41,11 @@ KityMinder.registerProtocal( 'freemind', function () {
} }
} }
// 处理超链接
if(topic.LINK){
obj.data.hyperlink = topic.LINK;
}
//处理子节点 //处理子节点
if( topic.node ){ if( topic.node ){
...@@ -64,22 +69,23 @@ KityMinder.registerProtocal( 'freemind', function () { ...@@ -64,22 +69,23 @@ KityMinder.registerProtocal( 'freemind', function () {
var json = $.xml2json(xml); var json = $.xml2json(xml);
var result = {}; var result = {};
processTopic(json.node, result); processTopic(json.node, result);
console.log(result);
return result; return result;
} }
return { return {
fileDescription: 'xmind格式文件', fileDescription: 'xmind格式文件',
fileExtension: '.xmind', fileExtension: '.xmind',
decode: function ( local ) { decode: function ( local ) {
var json = xml2km( local ); var json = xml2km( local );
return json; return json;
}, },
// recognize: recognize, // recognize: recognize,
recognizePriority: -1 recognizePriority: -1
}; };
} ); } );
...@@ -43,6 +43,11 @@ KityMinder.registerProtocal( 'mindmanager', function () { ...@@ -43,6 +43,11 @@ KityMinder.registerProtocal( 'mindmanager', function () {
} }
} }
// 处理超链接
if ( topic.Hyperlink ) {
obj.data.hyperlink = topic.Hyperlink.Url;
}
//处理子节点 //处理子节点
if ( topic.SubTopics && topic.SubTopics.Topic ) { if ( topic.SubTopics && topic.SubTopics.Topic ) {
...@@ -64,8 +69,11 @@ KityMinder.registerProtocal( 'mindmanager', function () { ...@@ -64,8 +69,11 @@ KityMinder.registerProtocal( 'mindmanager', function () {
function xml2km( xml ) { function xml2km( xml ) {
var json = $.xml2json( xml ); var json = $.xml2json( xml );
var result = {}; var result = {};
processTopic( json.OneTopic.Topic, result ); processTopic( json.OneTopic.Topic, result );
console.log(result);
return result; return result;
} }
......
...@@ -48,6 +48,11 @@ KityMinder.registerProtocal( 'xmind', function () { ...@@ -48,6 +48,11 @@ KityMinder.registerProtocal( 'xmind', function () {
} }
} }
// 处理超链接
if(topic['xlink:href']){
obj.data.hyperlink = topic['xlink:href'];
}
//处理子节点 //处理子节点
if( topic.children && topic.children.topics && topic.children.topics.topic ){ if( topic.children && topic.children.topics && topic.children.topics.topic ){
var tmp = topic.children.topics.topic; var tmp = topic.children.topics.topic;
...@@ -81,33 +86,33 @@ KityMinder.registerProtocal( 'xmind', function () { ...@@ -81,33 +86,33 @@ KityMinder.registerProtocal( 'xmind', function () {
}, onerror); }, onerror);
} }
return { return {
fileDescription: 'xmind格式文件', fileDescription: 'xmind格式文件',
fileExtension: '.xmind', fileExtension: '.xmind',
decode: function ( local ) { decode: function ( local ) {
return { return {
then : function(local, callback){ then : function(local, callback){
getEntries( local, function( entries ) { getEntries( local, function( entries ) {
entries.forEach(function( entry ) { entries.forEach(function( entry ) {
if(entry.filename == 'content.xml'){ if(entry.filename == 'content.xml'){
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 );
}); });
} }
}); });
}); });
} }
}; };
}, },
// recognize: recognize, // recognize: recognize,
recognizePriority: -1 recognizePriority: -1
}; };
} ); } );
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