Commit 88a1e04b authored by campaign's avatar campaign

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

parents 0fa37456 90b9d590
......@@ -17,6 +17,9 @@
<script src="../lang/zh-cn/zh-cn.js" charset="utf-8"></script>
<script src="../lib/zip.js" charset="utf-8"></script>
<script>
zip.inflateJSPath = '../lib/inflate.js';
</script>
<script src="../lib/jquery.xml2json.js" charset="utf-8"></script>
<script src="../lib/baidu-frontia-js-full-1.0.0.js" charset="utf-8"></script>
<script src="../social/draftmanager.js" charset="utf-8"></script>
......
......@@ -15,6 +15,10 @@
<script src="lang/zh-cn/zh-cn.js" charset="utf-8"></script>
<script src="lib/zip.js" charset="utf-8"></script>
<script>
zip.inflateJSPath = 'lib/inflate.js';
</script>
<script src="lib/jquery.xml2json.js" charset="utf-8"></script>
<script src="lib/baidu-frontia-js-full-1.0.0.js" charset="utf-8"></script>
<script src="social/draftmanager.js" charset="utf-8"></script>
......
......@@ -39,7 +39,7 @@
var ERR_HTTP_RANGE = "HTTP Range not supported.";
var CHUNK_SIZE = 512 * 1024;
var INFLATE_JS = "../lib/inflate.js";
var INFLATE_JS = "inflate.js";
var DEFLATE_JS = "deflate.js";
var appendABViewSupported;
......@@ -510,7 +510,7 @@
}
if (obj.zip.useWebWorkers) {
worker = new Worker(INFLATE_JS);
worker = new Worker(obj.zip.inflateJSPath || INFLATE_JS);//INFLATE_JS
launchWorkerProcess(worker, reader, writer, offset, size, oninflateappend, onprogress, oninflateend, onreaderror, onwriteerror);
} else
launchProcess(new obj.zip.Inflater(), reader, writer, offset, size, oninflateappend, onprogress, oninflateend, onreaderror, onwriteerror);
......@@ -959,6 +959,7 @@
}, onerror);
},
workerScriptsPath : "",
inflateJSPath:"",
useWebWorkers : true
};
......
......@@ -104,15 +104,38 @@ kity.extendClass( Minder, {
var stoped = this._fire( new MinderEvent( 'beforeimport', params, true ) );
if ( stoped ) return this;
//*******************
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;
}
var start = ts(new Date(), '开始解析');
//*******************
json = params.json || ( params.json = protocal.decode( local ) );
if ( typeof json === 'object' && 'then' in json ) {
var self = this;
json.then( local, function ( data ) {
self._afterImportData( data, params );
//*******************
var dur = ts(new Date(), '解析和转化格式结束') - start;
console.log('--- 共'+dur+'ms ---');
//*******************
} );
} else {
this._afterImportData( json, params );
//*******************
var dur = ts(new Date(), '解析和转化格式结束') - start;
console.log('--- 共'+dur+'ms ---');
//*******************
}
return this;
},
......
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