Commit e1f18476 authored by Ronny's avatar Ronny

添加zip文件解压时间戳

parent 40a5f5a1
...@@ -115,7 +115,7 @@ kity.extendClass( Minder, { ...@@ -115,7 +115,7 @@ kity.extendClass( Minder, {
return d; return d;
} }
var start = ts(new Date(), '开始解析'); window.start = ts(new Date(), '开始解析');
//******************* //*******************
json = params.json || ( params.json = protocal.decode( local ) ); json = params.json || ( params.json = protocal.decode( local ) );
...@@ -126,14 +126,14 @@ kity.extendClass( Minder, { ...@@ -126,14 +126,14 @@ kity.extendClass( Minder, {
self._afterImportData( data, params ); self._afterImportData( data, params );
//******************* //*******************
var dur = ts(new Date(), '解析和转化格式结束') - start; var dur = ts(new Date(), '解析和转化格式结束') - window.start;
console.log('--- 共'+dur+'ms ---'); console.log('--- 共'+dur+'ms ---');
//******************* //*******************
} ); } );
} else { } else {
this._afterImportData( json, params ); this._afterImportData( json, params );
//******************* //*******************
var dur = ts(new Date(), '解析和转化格式结束') - start; var dur = ts(new Date(), '解析和转化格式结束') - window.start;
console.log('--- 共'+dur+'ms ---'); console.log('--- 共'+dur+'ms ---');
//******************* //*******************
} }
......
...@@ -22,6 +22,17 @@ KityMinder.registerProtocal( 'mindmanager', function () { ...@@ -22,6 +22,17 @@ KityMinder.registerProtocal( 'mindmanager', function () {
'100': [ 'ProgressIcon', 5 ] '100': [ 'ProgressIcon', 5 ]
}; };
//*******************
function ts(d, str){
var h = d.getHours(),
m = d.getMinutes(),
s = d.getSeconds(),
ms = d.getMilliseconds();
console.log('--- '+str+': '+(h+':'+m+':'+s+' '+ms)+' ---');
return d;
}
//*******************
function processTopic( topic, obj ) { function processTopic( topic, obj ) {
//处理文本 //处理文本
obj.data = { obj.data = {
...@@ -88,6 +99,10 @@ KityMinder.registerProtocal( 'mindmanager', function () { ...@@ -88,6 +99,10 @@ KityMinder.registerProtocal( 'mindmanager', function () {
entries.forEach( function ( entry ) { entries.forEach( function ( entry ) {
if ( entry.filename == 'Document.xml' ) { if ( entry.filename == 'Document.xml' ) {
entry.getData( new zip.TextWriter(), function ( text ) { entry.getData( new zip.TextWriter(), function ( text ) {
//*******************
var dur = ts(new Date(), '解压完成') - window.start;
console.log('--- 解压用了'+dur+'ms ---');
//*******************
var km = xml2km( $.parseXML( text ) ); var km = xml2km( $.parseXML( text ) );
callback && callback( km ); callback && callback( km );
} ); } );
......
...@@ -94,7 +94,11 @@ KityMinder.registerProtocal( 'xmind', function () { ...@@ -94,7 +94,11 @@ KityMinder.registerProtocal( 'xmind', function () {
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 dur = ts(new Date(), '解压完成') - window.start;
console.log('--- 解压用了'+dur+'ms ---');
//*******************
var km = xml2km( $.parseXML(text) );
callback && callback( km ); callback && callback( km );
}); });
} }
......
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