This commit is contained in:
life
2015-03-13 00:20:58 +08:00
parent 5527cd6d47
commit 7f11dd63ee
13 changed files with 58 additions and 24 deletions

13
node_modules/common.js generated vendored
View File

@@ -30,6 +30,13 @@ var Common = {
this._uuid++;
return ((new Date()).getTime()) + '_' + this._uuid;
},
// 得到目录分隔符
getPathSep: function() {
if(process.platform.indexOf('win') != -1) {
return "\"";
}
return '/';
},
isOk: function(ret) {
if(!ret) {
return ret;
@@ -109,14 +116,16 @@ var Common = {
if(!fullFilePath) {
return ret;
}
var strs = fullFilePath.split('/');
var strs = fullFilePath.split(this.getPathSep());
if(strs.length == 1) {
ret.name = strs;
ret.name = strs[0];
} else {
ret.name = strs[strs.length - 1];
strs.pop();
ret.path = strs.join('/');
}
// console.log("---");
// console.log(ret);
var names = ret.name.split('.');
if(names.length > 1) {
ret.ext = names[names.length - 1];

3
node_modules/sync.js generated vendored
View File

@@ -89,6 +89,7 @@ var Sync = {
},
// 停止同步
// 第一次note.html -> login.html(使得_stop: true), -> note.html fullSync一看是stop
_stop: false,
stop: function() {
var me = this;
@@ -489,6 +490,7 @@ var Sync = {
// 全量同步
fullSync: function(callback) {
var me = this;
me._stop = false;
me._initSyncInfo();
// Web.syncNotebookFinish();
@@ -569,6 +571,7 @@ var Sync = {
},
incrSync: function(again) {
var me = this;
me._stop = false;
me._initSyncInfo();
// again表示重来