Commit 715ca4ef authored by campaign's avatar campaign

Merge remote-tracking branch 'origin/dev' into dev

parents 9639cc69 23a2a747
...@@ -20,7 +20,8 @@ module.exports = function ( grunt ) { ...@@ -20,7 +20,8 @@ module.exports = function ( grunt ) {
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %>\n' + ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %>\n' +
' * ====================================================\n' + ' * ====================================================\n' +
' */\n\n', ' */\n\n',
buildPath = 'dev/import.php', buildPath = 'import.js',
srcPath = 'src/',
distPath = 'dist/'; distPath = 'dist/';
var getPath = function ( readFile ) { var getPath = function ( readFile ) {
...@@ -30,7 +31,7 @@ module.exports = function ( grunt ) { ...@@ -30,7 +31,7 @@ module.exports = function ( grunt ) {
sources = sources[ 1 ].replace( /\/\/.*\n/g, '\n' ).replace( /'|"|\n|\t|\s/g, '' ); sources = sources[ 1 ].replace( /\/\/.*\n/g, '\n' ).replace( /'|"|\n|\t|\s/g, '' );
sources = sources.split( "," ); sources = sources.split( "," );
sources.forEach( function ( filepath, index ) { sources.forEach( function ( filepath, index ) {
sources[ index ] = filepath; sources[ index ] = srcPath + filepath;
} ); } );
return sources; return sources;
...@@ -63,7 +64,8 @@ module.exports = function ( grunt ) { ...@@ -63,7 +64,8 @@ module.exports = function ( grunt ) {
}, },
files: ( function () { files: ( function () {
var files = {}; var files = {};
files[ distPath + 'kityminder.all.js' ] = distPath + 'kityminder.all.min.js'; files[ distPath + 'kityminder.all.min.js' ] = distPath + 'kityminder.all.js';
console.log(files);
return files; return files;
} )() } )()
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* 开发版本的文件导入 * 开发版本的文件导入
*/ */
(function (){ (function (){
var paths = [ var paths = new Array(
'core/kityminder.js' 'core/kityminder.js'
,'core/utils.js' ,'core/utils.js'
,'core/command.js' ,'core/command.js'
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
,'protocal/json.js' ,'protocal/json.js'
,'protocal/png.js' ,'protocal/png.js'
,'protocal/svg.js' ,'protocal/svg.js'
], ),
baseURL = 'src/'; baseURL = 'src/';
for (var i=0,pi;pi = paths[i++];) { for (var i=0,pi;pi = paths[i++];) {
document.write('<script type="text/javascript" src="'+ baseURL + pi +'"></script>'); document.write('<script type="text/javascript" src="'+ baseURL + pi +'"></script>');
......
Subproject commit cb261f4cedd745233d9e022a72f76ddf8d8e129b Subproject commit e144ccd9270712497804915d13ec92f6593299b0
...@@ -106,16 +106,22 @@ kity.extendClass( Minder, { ...@@ -106,16 +106,22 @@ kity.extendClass( Minder, {
//******************* //*******************
function ts(d, str){ function ts(d, str, last){
var h = d.getHours(), var h = d.getHours(),
m = d.getMinutes(), m = d.getMinutes(),
s = d.getSeconds(), s = d.getSeconds(),
ms = d.getMilliseconds(); ms = d.getMilliseconds();
console.log('--- '+str+': '+(h+':'+m+':'+s+' '+ms)+' ---');
if(last){
console.log('--- '+str+': '+(d-last)+' ---');
}else{
console.log('--- '+str+' ---');
}
return d; return d;
} }
var start = ts(new Date(), '开始解析'); var t1 = ts(new Date(), '开始解析');
//******************* //*******************
json = params.json || ( params.json = protocal.decode( local ) ); json = params.json || ( params.json = protocal.decode( local ) );
...@@ -123,18 +129,21 @@ kity.extendClass( Minder, { ...@@ -123,18 +129,21 @@ kity.extendClass( Minder, {
if ( typeof json === 'object' && 'then' in json ) { if ( typeof json === 'object' && 'then' in json ) {
var self = this; var self = this;
json.then( local, function ( data ) { json.then( local, function ( data ) {
//*******************
var t2 = ts(new Date(), '解压解析耗时', t1);
//*******************
self._afterImportData( data, params ); self._afterImportData( data, params );
//******************* //*******************
var dur = ts(new Date(), '解析和转化格式结束') - start; ts(new Date(), '渲染耗时', t2);
console.log('--- 共'+dur+'ms ---');
//******************* //*******************
} ); } );
} else { } else {
//*******************
var t2 = ts(new Date(), '解压解析耗时', t1);
//*******************
this._afterImportData( json, params ); this._afterImportData( json, params );
//******************* //*******************
var dur = ts(new Date(), '解析和转化格式结束') - start; ts(new Date(), '渲染耗时', t2);
console.log('--- 共'+dur+'ms ---');
//******************* //*******************
} }
return this; 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