mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-15 15:41:19 +00:00
win
This commit is contained in:
13
node_modules/common.js
generated
vendored
13
node_modules/common.js
generated
vendored
@@ -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
3
node_modules/sync.js
generated
vendored
@@ -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表示重来
|
||||
|
Reference in New Issue
Block a user