笔记本数量问题 , APP端的笔记不能自动保存, APP端的笔记不能自动保存. [ok] 同步删除笔记问题

笔记本数量问题 [ok]
两次粘贴问题 [ok]
APP端的笔记不能自动保存. [ok]
同步删除笔记问题 [ok]
        执行以下操作:APP内添加两篇笔记,手动同步到网页,网页可见.此时在网页中删掉其中一篇笔记后保存,网页可
达到预期效果.回到APP后手动同步, APP内的笔记仍然是2条,未作任何删改.已反复尝试证实. [ok]
This commit is contained in:
life
2015-03-15 01:34:16 +08:00
parent b00c3080b8
commit aba15ad087
11 changed files with 196 additions and 77 deletions

16
node_modules/api.js generated vendored
View File

@@ -611,23 +611,27 @@ var Api = {
return callback(false); return callback(false);
} }
var ret = resp.body; var ret = resp.body;
log('delete note ret'); console.error('delete note ret');
log(ret); console.log('delete note ret');
console.log(ret);
if(Common.isOk(ret)) { if(Common.isOk(ret)) {
// 以后不要再发了 // 以后不要再发了
Note.setNotDirty(note.NoteId); Note.removeNote(note.NoteId);
callback(ret); callback(ret);
} else { } else {
callback(false); callback(false);
try { try {
log('delete note conflict'); console.log('delete note conflict');
// 代表冲突了, 那么本地的删除无效, 设为IsDirty为false, 不删除 // 代表冲突了, 那么本地的删除无效, 设为IsDirty为false, 不删除
// 待以后同步 // 待以后同步
if(ret.Msg == 'conflict') { if(ret.Msg == 'conflict') {
log('delete note conflict: setNotDirtyNotDelete'); console.log('delete note conflict: setNotDirtyNotDelete');
Note.setNotDirtyNotDelete(note.NoteId); Note.setNotDirtyNotDelete(note.NoteId);
} else if(ret.Msg == 'notExists') {
console.log('delete note conflict: remove not exists');
Note.removeNote(note.NoteId);
} else { } else {
log('delete note conflict: setNotDirty'); console.log('delete note conflict: setNotDirty');
Note.setNotDirty(note.NoteId); Note.setNotDirty(note.NoteId);
} }
} catch(e) {} } catch(e) {}

76
node_modules/note.js generated vendored
View File

@@ -44,9 +44,11 @@ var Note = {
var me = this; var me = this;
var userId = User.getCurActiveUserId(); var userId = User.getCurActiveUserId();
noteOrContent['UserId'] = userId; noteOrContent['UserId'] = userId;
console.error("updateNoteOrContent")
console.trace('updateNoteOrContent: '); // console.error("updateNoteOrContent")
console.log(noteOrContent); // console.trace('updateNoteOrContent: ');
// console.log(noteOrContent);
var date = new Date(); var date = new Date();
noteOrContent.UpdatedTime = date; noteOrContent.UpdatedTime = date;
@@ -103,28 +105,36 @@ var Note = {
// 只有title, Content, Tags修改了才算是IsDirty // 只有title, Content, Tags修改了才算是IsDirty
if('Content' in updates && dbNote['Content'] != updates['Content']) { if('Content' in updates && dbNote['Content'] != updates['Content']) {
isDirty = true; isDirty = true;
console.error(' content not same');
console.log(dbNote['Content']);
console.log(updates['Content']);
} else if('Title' in updates && dbNote['Title'] != updates['Title']) { } else if('Title' in updates && dbNote['Title'] != updates['Title']) {
isDirty = true; isDirty = true;
console.error(' title not same');
} else if('Tags' in updates) { } else if('Tags' in updates) {
var dbTags = dbNote['Tags'] || []; var dbTags = dbNote['Tags'] || [];
var nowTags = updates['Tags'] || []; var nowTags = updates['Tags'] || [];
if(dbTags.join(',') != nowTags.join(',')) { if(dbTags.join(',') != nowTags.join(',')) {
isDirty = true; isDirty = true;
console.error(' tag not same');
} }
} }
console.log('update note isDirty: ' + noteOrContent.NoteId); // console.log('update note isDirty: ' + noteOrContent.NoteId);
console.error(isDirty); // console.error(isDirty);
updates['IsDirty'] = isDirty; updates['IsDirty'] = isDirty;
if(isDirty) { if(isDirty) {
console.error("NONO----------"); console.error("NONO---is dirty-------");
// Web.alertWeb("??NONO"); // Web.alertWeb("??NONO");
} }
updates['LocalIsDelete'] = false; updates['LocalIsDelete'] = false;
updates.UpdatedTime = date; updates.UpdatedTime = date;
console.log('finally update:');
console.log(updates);
// Set an existing field's value // Set an existing field's value
Notes.update({NoteId: noteOrContent.NoteId}, { $set: updates }, {}, function (err, numReplaced) { Notes.update({NoteId: noteOrContent.NoteId}, { $set: updates }, {}, function (err, numReplaced) {
if(err) { if(err) {
@@ -251,17 +261,32 @@ var Note = {
clearTrash: function(callback) { clearTrash: function(callback) {
var me = this; var me = this;
var userId = User.getCurActiveUserId(); var userId = User.getCurActiveUserId();
Notes.update({UserId: userId, IsTrash: true}, {$set: {LocalIsDelete: true, IsDirty: true}}, {multi: true}, function(err, n) { Notes.update(
callback && callback(); {UserId: userId, IsTrash: true},
{$set: {LocalIsDelete: true, IsDirty: true}},
{multi: true},
function(err, n) {
// Web.alertWeb(n);
callback && callback();
}); });
}, },
deleteNote: function(noteId, callback) { deleteNote: function(noteId, callback) {
Notes.update({NoteId: noteId}, {$set: {IsTrash: true, IsDirty: true}}, function(err, n) { var me = this;
if(err || !n) { me.getNote(noteId, function(note) {
if(!note) {
callback(false); callback(false);
} else {
callback(true);
} }
Notes.update({NoteId: noteId}, {$set: {IsTrash: true, IsDirty: true}}, function(err, n) {
if(err || !n) {
callback(false);
} else {
callback(true);
// 重新统计
Notebook.reCountNotebookNumberNotes(note.NotebookId);
}
});
}); });
}, },
// 彻底删除笔记, 如果有tags, 则需要更新tags's count // 彻底删除笔记, 如果有tags, 则需要更新tags's count
@@ -561,12 +586,20 @@ var Note = {
// 有可能服务器上删除了是误删 ? // 有可能服务器上删除了是误删 ?
deleteNoteForce: function(noteId, callback) { deleteNoteForce: function(noteId, callback) {
var me = this; var me = this;
Notes.remove({ServerNoteId: noteId}, function(err, n) { me.getNoteByServerNoteId(noteId, function(note) {
if(err) { if(!note) {
callback && callback(false); callback && callback(false);
} else { return;
callback && callback(true);
} }
Notes.remove({_id: note._id}, function(err, n) {
if(err) {
callback && callback(false);
} else {
Notebook.reCountNotebookNumberNotes(note.NotebookId);
callback && callback(true);
}
});
}); });
}, },
// 添加笔记本, note object // 添加笔记本, note object
@@ -610,6 +643,9 @@ var Note = {
// console.log(note.CreatedTime); // console.log(note.CreatedTime);
callback && callback(newDoc); callback && callback(newDoc);
// 重新统计
Notebook.reCountNotebookNumberNotes(note.NotebookId);
// 下载内容, 图片, 附件 // 下载内容, 图片, 附件
me.syncContentAndImagesAndAttachs(newDoc); me.syncContentAndImagesAndAttachs(newDoc);
} }
@@ -721,6 +757,9 @@ var Note = {
console.log(t); console.log(t);
}); });
// 重新统计之
Notebook.reCountNotebookNumberNotes(note.NotebookId);
// 下载内容, 图片, 附件 // 下载内容, 图片, 附件
me.syncContentAndImagesAndAttachs(note); me.syncContentAndImagesAndAttachs(note);
} }
@@ -1185,7 +1224,10 @@ var Note = {
// 在send delete笔记时成功 // 在send delete笔记时成功
setNotDirty: function(noteId) { setNotDirty: function(noteId) {
Notes.update({NoteId: noteId}, {$set:{IsDirty: false}}) Notes.update({NoteId: noteId}, {$set: {IsDirty: false}})
},
removeNote: function(noteId) {
Notes.remove({NoteId: noteId});
}, },
// 在send delete笔记时有冲突, 设为不删除 // 在send delete笔记时有冲突, 设为不删除
setNotDirtyNotDelete: function(noteId) { setNotDirtyNotDelete: function(noteId) {

14
node_modules/notebook.js generated vendored
View File

@@ -3,6 +3,7 @@ var async = require('async');
var User = require('user'); var User = require('user');
var NB = db.notebooks; var NB = db.notebooks;
var Common = require('common'); var Common = require('common');
var Web = require('web');
function log(o) {console.log(o);} function log(o) {console.log(o);}
@@ -199,6 +200,7 @@ var Notebook = {
*/ */
}, },
// addNote, 删除note, 移动note
// 重新统计笔记本的笔记数据 // 重新统计笔记本的笔记数据
reCountNotebookNumberNotes: function(notebookId) { reCountNotebookNumberNotes: function(notebookId) {
db.notes.count({NotebookId: notebookId, IsTrash: false, LocalIsDelete: false}, function(err, count) { db.notes.count({NotebookId: notebookId, IsTrash: false, LocalIsDelete: false}, function(err, count) {
@@ -206,9 +208,7 @@ var Notebook = {
log(err); log(err);
return; return;
} }
log("count"); Web.updateNotebookNumberNotes(notebookId, count);
log(notebookId);
log(count);
NB.update({NotebookId: notebookId}, {$set: {NumberNotes: count}}, {}) NB.update({NotebookId: notebookId}, {$set: {NumberNotes: count}}, {})
}); });
}, },
@@ -404,14 +404,12 @@ var Notebook = {
// notes是服务器的数据, 与本地的有冲突 // notes是服务器的数据, 与本地的有冲突
// 1) 将本地的note复制一份 // 1) 将本地的note复制一份
// 2) 服务器替换之前 // 2) 服务器替换之前
fixConflicts: function(notebookSyncInfo, notebookWeb, callback) { fixConflicts: function(notebookSyncInfo, callback) {
var me = this; var me = this;
if(!notebookWeb) {
return callback && callback();
}
// 处理冲突 // 处理冲突
var conflictNotebooks = notebookSyncInfo.conflicts || []; var conflictNotebooks = notebookSyncInfo.conflicts || [];
log('fix notebook conflicts'); console.log('fix notebook conflicts');
async.eachSeries(conflictNotebooks, function(notebook, cb) { async.eachSeries(conflictNotebooks, function(notebook, cb) {
/* /*
var noteId = note.NoteId; var noteId = note.NoteId;

4
node_modules/sync.js generated vendored
View File

@@ -339,8 +339,8 @@ var Sync = {
} }
Api.getSyncNotes(afterUsn, me._noteMaxEntry, function(notes) { Api.getSyncNotes(afterUsn, me._noteMaxEntry, function(notes) {
log('syncNote') console.log('syncNote---')
log(notes); console.log(notes);
if(Common.isOk(notes)) { if(Common.isOk(notes)) {
me._totalSyncNoteNum += notes.length; me._totalSyncNoteNum += notes.length;
// 证明可能还有要同步的 // 证明可能还有要同步的

7
node_modules/web.js generated vendored
View File

@@ -129,5 +129,12 @@ var Web = {
me.Note.syncProcess('In sync tags...'); me.Note.syncProcess('In sync tags...');
} }
*/ */
// 重新统计后, 显示到web上
updateNotebookNumberNotes: function(notebookId, count) {
var me = this;
me.Notebook.updateNotebookNumberNotes(notebookId, count);
}
}; };
module.exports = Web; module.exports = Web;

View File

@@ -8,7 +8,7 @@
"toolbar": true, "toolbar": true,
"frame": true, "frame": true,
"transparent": true, "transparent": false,
"min_width": 258, "min_width": 258,
"min_height": 326, "min_height": 326,

View File

@@ -35,22 +35,31 @@ Note.notebookIds = {}; // notebookId => true
Note.isReadOnly = false; Note.isReadOnly = false;
// 定时保存信息 // 定时保存信息
Note.intervalTime = 600000; // 600s, 10mins Note.intervalTime = 10 * 1000; // 600s, 10mins
Note.startInterval = function() { Note.startInterval = function() {
console.error("??");
if(Note.interval) {
clearInterval(Note.interval);
}
Note.interval = setInterval(function() { Note.interval = setInterval(function() {
log("自动保存开始..."); console.log("start save interval...");
// changedNote = Note.curChangedSaveIt(false); changedNote = Note.curChangedSaveIt(false);
}, Note.intervalTime); // 600s, 10mins }, Note.intervalTime); // 600s, 10mins
} };
// 停止, 当切换note时 // 停止, 当切换note时
// 但过5000后自动启动 // 但过5000后自动启动
Note.stopInterval = function() { Note.stopInterval = function(notStartAuto) {
clearInterval(Note.interval); clearInterval(Note.interval);
setTimeout(function() { // 是否自动启动, 默认是自动启动
Note.startInterval(); if(!notStartAuto) {
}, Note.intervalTime); setTimeout(function() {
} Note.startInterval();
}, Note.intervalTime);
}
};
// note = {NoteId, Desc, UserId,...} // note = {NoteId, Desc, UserId,...}
Note.addNoteCache = function(note) { Note.addNoteCache = function(note) {
@@ -246,6 +255,10 @@ Note.curHasChanged = function(force) {
// 如果是markdown返回[content, preview] // 如果是markdown返回[content, preview]
var contents = getEditorContent(cacheNote.IsMarkdown); var contents = getEditorContent(cacheNote.IsMarkdown);
if(contents === false) {
// 表示编辑器未初始化, 此时肯定不能保存
return false;
}
var content, preview; var content, preview;
var contentText; var contentText;
if (isArray(contents)) { if (isArray(contents)) {
@@ -325,6 +338,10 @@ Note.curHasChanged = function(force) {
console.log(cacheNote.Content == content); console.log(cacheNote.Content == content);
} }
console.error('hasChanged');
console.log(Note.curNoteId);
console.log(hasChanged);
hasChanged["UserId"] = cacheNote["UserId"] || ""; hasChanged["UserId"] = cacheNote["UserId"] || "";
return hasChanged; return hasChanged;
@@ -447,9 +464,11 @@ Note.curChangedSaveIt = function(force, callback) {
return; return;
} }
console.error(">>");
var hasChanged = Note.curHasChanged(force); var hasChanged = Note.curHasChanged(force);
if(hasChanged.hasChanged || hasChanged.IsNew) { if(hasChanged && (hasChanged.hasChanged || hasChanged.IsNew)) {
// 把已改变的渲染到左边 item-list // 把已改变的渲染到左边 item-list
Note.renderChangedNote(hasChanged); Note.renderChangedNote(hasChanged);
@@ -479,8 +498,8 @@ Note.curChangedSaveIt = function(force, callback) {
// console.error('保存当前的笔记: ' + hasChanged.NoteId); // console.error('保存当前的笔记: ' + hasChanged.NoteId);
// //
console.error("why===================="); // console.error("why====================");
console.trace("why"); // console.trace("why");
NoteService.updateNoteOrContent(hasChanged, function(ret) { NoteService.updateNoteOrContent(hasChanged, function(ret) {
me.saveInProcess[hasChanged.NoteId] = false; me.saveInProcess[hasChanged.NoteId] = false;
@@ -656,14 +675,19 @@ Note.changeNote = function(selectNoteId, isShare, needSaveChanged, callback) {
var target = $(tt('[noteId="?"]', selectNoteId)) var target = $(tt('[noteId="?"]', selectNoteId))
Note.selectTarget(target); Note.selectTarget(target);
// 1 之前的note, 判断是否已改变, 改变了就要保存之
// 这里, 在搜索的时候总是保存, 搜索的话, 比较快, 肯定没有变化, 就不要执行该操作 // 如果 inChangeNoteId == selectNoteId, 表示之前的note的content还在加载中, 此时保存笔记肯定出错
if(needSaveChanged == undefined) { // if(Note.inChangeNoteId != Note.curNoteId) {
needSaveChanged = true;
} // 1 之前的note, 判断是否已改变, 改变了就要保存之
if(needSaveChanged) { // 这里, 在搜索的时候总是保存, 搜索的话, 比较快, 肯定没有变化, 就不要执行该操作
var changedNote = Note.curChangedSaveIt(); if(needSaveChanged == undefined) {
} needSaveChanged = true;
}
if(needSaveChanged) {
var changedNote = Note.curChangedSaveIt();
}
// }
// 2. 设空, 防止在内容得到之前又发生保存 // 2. 设空, 防止在内容得到之前又发生保存
Note.curNoteId = ""; Note.curNoteId = "";
@@ -679,7 +703,7 @@ Note.changeNote = function(selectNoteId, isShare, needSaveChanged, callback) {
isShare = true; isShare = true;
} }
} }
var hasPerm = !isShare || Share.hasUpdatePerm(selectNoteId); // 不是共享, 或者是共享但有权限 var hasPerm = true; // !isShare || Share.hasUpdatePerm(selectNoteId); // 不是共享, 或者是共享但有权限
// 有权限 // 有权限
if(hasPerm) { if(hasPerm) {
@@ -687,7 +711,8 @@ Note.changeNote = function(selectNoteId, isShare, needSaveChanged, callback) {
Note.renderNote(cacheNote); Note.renderNote(cacheNote);
// 这里要切换编辑器 // 这里要切换编辑器
switchEditor(cacheNote.IsMarkdown) switchEditor(cacheNote.IsMarkdown);
Note.hideEditorMask();
} else { } else {
Note.renderNoteReadOnly(cacheNote); Note.renderNoteReadOnly(cacheNote);
} }
@@ -850,8 +875,11 @@ Note.renderNote = function(note) {
Note.renderNoteContent = function(content) { Note.renderNoteContent = function(content) {
// console.error('---------------- note:' + note.Title); // console.error('---------------- note:' + note.Title);
// console.trace(); // console.trace();
setEditorContent(content.Content, content.IsMarkdown, content.Preview); setEditorContent(content.Content, content.IsMarkdown, content.Preview);
// console.log(content.NoteId + " => " + content.Content);
// 只有在renderNoteContent时才设置curNoteId // 只有在renderNoteContent时才设置curNoteId
Note.setCurNoteId(content.NoteId); Note.setCurNoteId(content.NoteId);
@@ -1153,10 +1181,22 @@ Note._syncWarningE = $('#syncWarning');
Note.showSpin = function() { Note.showSpin = function() {
var me = this; var me = this;
me._syncRefreshE.addClass('fa-spin'); me._syncRefreshE.addClass('fa-spin');
// 如果超过30秒还在转, 证明有问题了
setTimeout(function() {
if(me._syncRefreshE.hasClass('fa-spin')) {
me._syncRefreshE.removeClass('fa-spin');
}
}, 30 * 1000);
// 禁止自动保存
me.stopInterval(true);
}; };
Note.hideSpin = function() { Note.hideSpin = function() {
var me = this; var me = this;
me._syncRefreshE.removeClass('fa-spin'); me._syncRefreshE.removeClass('fa-spin');
// 开始自动保存
me.startInterval();
}; };
// nodejs调用 // nodejs调用
Note.syncFinished = function() { Note.syncFinished = function() {
@@ -2534,21 +2574,12 @@ $(function() {
// 附件初始化 // 附件初始化
Attach.init(); Attach.init();
//-----------------
// 点击笔记展示之
// 避免iphone, ipad两次点击
// http://stackoverflow.com/questions/3038898/ipad-iphone-hover-problem-causes-the-user-to-double-click-a-link
$("#noteItemList").on("mouseenter", ".item", function(event) {
if(LEA.isIpad || LEA.isIphone) {
$(this).trigger("click");
}
});
$("#noteItemList").on("click", ".item", function(event) { $("#noteItemList").on("click", ".item", function(event) {
// event.stopPropagation(); // event.stopPropagation();
var noteId = $(this).attr("noteId"); var noteId = $(this).attr("noteId");
// 手机端处理 // 手机端处理
Mobile.changeNote(noteId); // Mobile.changeNote(noteId);
if(!noteId) { if(!noteId) {
return; return;
@@ -2740,19 +2771,33 @@ Note.updateSync = function(notes) {
if(isEmpty(notes)) { if(isEmpty(notes)) {
return; return;
} }
var curNotebookIsTrash = Notebook.curNotebookIsTrash();
for(var i in notes) { for(var i in notes) {
var note = notes[i]; var note = notes[i];
note.InitSync = true; // 需要重新获取内容 note.InitSync = true; // 需要重新获取内容
Note.addNoteCache(note); Note.addNoteCache(note);
// 如果当前修改的是本笔记, 那么重新render之 // 如果当前修改的是本笔记, 那么重新render之
console.log('->>>'); // console.log('->>>');
console.log(Note.curNoteId); // console.log(Note.curNoteId);
if(Note.curNoteId == note.NoteId) { if(Note.curNoteId == note.NoteId) {
// 这里, 如果当前就是更新的, 则重新render, 有个问题, server新内容已经在服务器上了 // 这里, 如果当前就是更新的, 则重新render, 有个问题, server新内容已经在服务器上了
Note.reRenderNote(Note.curNoteId); Note.reRenderNote(Note.curNoteId);
} }
// 如果是trash, 且当前不在trash目录下, 且有该笔记, 则删除之
if(!curNotebookIsTrash && note.IsTrash) {
var target = $(tt('[noteId="?"]', note.NoteId));
if(target.length) {
if(Note.curNoteId == note.NoteId) {
Note.changeToNext(target);
}
target.remove();
}
}
} }
} };
// 删除 // 删除
Note.deleteSync = function(notes) { Note.deleteSync = function(notes) {

View File

@@ -25,6 +25,17 @@ Notebook.getCurNotebook = function() {
return Notebook.cache[Notebook.curNotebookId]; return Notebook.cache[Notebook.curNotebookId];
}; };
// 为了server Web调用
Notebook.updateNotebookNumberNotes = function(notebookId, count) {
var self = this;
var notebook = self.getNotebook(notebookId);
if(!notebook) {
return;
}
notebook.NumberNotes = count;
$("#numberNotes_" + notebookId).html(count);
};
// 笔记本的笔记数量更新 // 笔记本的笔记数量更新
Notebook._updateNotebookNumberNotes = function(notebookId, n) { Notebook._updateNotebookNumberNotes = function(notebookId, n) {
var self = this; var self = this;
@@ -1188,4 +1199,4 @@ Notebook.deleteSync = function(notebooks) {
// 删除 // 删除
me.deleteNotebookFromTree(notebookId); me.deleteNotebookFromTree(notebookId);
} }
} };

View File

@@ -1183,6 +1183,9 @@ var State = {
// 判断是否登录 // 判断是否登录
function initPage() { function initPage() {
win.on('close', function() { win.on('close', function() {
// 先保存之前改变的
Note.curChangedSaveIt();
// 保存状态
State.saveCurState(function() { State.saveCurState(function() {
win.close(true); win.close(true);
}); });

View File

@@ -459,6 +459,7 @@ function previewIsEmpty(preview) {
} }
// 有tinymce得到的content有<html>包围 // 有tinymce得到的content有<html>包围
// false表示编辑器未初始化
function getEditorContent(isMarkdown) { function getEditorContent(isMarkdown) {
if(!isMarkdown) { if(!isMarkdown) {
var editor = tinymce.activeEditor; var editor = tinymce.activeEditor;
@@ -513,11 +514,15 @@ function getEditorContent(isMarkdown) {
} }
} }
return content; return content;
} else {
return false;
} }
} else { } else {
// return [$("#wmd-input").val(), $("#wmd-preview").html()] // return [$("#wmd-input").val(), $("#wmd-preview").html()]
if(MD) { if(MD) {
return [MD.getContent(), '<div>' + $("#preview-contents").html() + '</div>'] return [MD.getContent(), '<div>' + $("#preview-contents").html() + '</div>']
} else {
return false;
} }
} }
} }

14
test.js
View File

@@ -21,7 +21,7 @@ Api.addNotebook({
// Api.uploadImage(); // Api.uploadImage();
User.userId = '54bdc65599c37b0da9000002'; User.userId = '54bdc65599c37b0da9000002';
User.userId = '54d7620d99c37b030600002c'; User.userId = '54d7620d99c37b030600002c';
User.userId = '545b26ad38f4116d08000029'; User.userId = '5503c84c99c37b22a4000003';
// 54d7624205fcd105da00005 // 54d7624205fcd105da00005
@@ -38,18 +38,22 @@ User.init(function() {
}); });
*/ */
/*
Notebook.getDirtyNotebooks(function(notebooks) { Notebook.getDirtyNotebooks(function(notebooks) {
console.log(notebooks); console.log(notebooks);
}) });
*/
// Note.getNoteByServerNoteId('54f1a1f899c37b4faf000001', function(note) { // Note.getNoteByServerNoteId('54f1a1f899c37b4faf000001', function(note) {
// console.log(note); // console.log(note);
// }); // });
// Note.getNotes('', function(ret) { Note.getTrashNotes(function(ret) {
// console.log(ret); console.log(ret);
// }); console.log(ret.length);
});
}); });