mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-14 23:22:40 +00:00
async noteContent, images, attachs
This commit is contained in:
40
node_modules/note.js
generated
vendored
40
node_modules/note.js
generated
vendored
@@ -1100,26 +1100,28 @@ var Note = {
|
||||
// 异步操作
|
||||
syncContentAndImagesAndAttachs: function(note) {
|
||||
var me = this;
|
||||
// 内容
|
||||
console.log("syncContentAndImagesAndAttachs..................." + note.NoteId);
|
||||
me.getNoteContent(note.NoteId, function(noteAndContent) {
|
||||
if(noteAndContent) {
|
||||
console.log('sync content ' + note.NoteId + ' ok');
|
||||
var content = noteAndContent.Content;
|
||||
Web.contentSynced(note.NoteId, note.Content);
|
||||
// 图片
|
||||
if(content) {
|
||||
me.syncImages(content);
|
||||
setTimeout(function() {
|
||||
// 内容
|
||||
console.log("syncContentAndImagesAndAttachs..................." + note.NoteId);
|
||||
me.getNoteContent(note.NoteId, function(noteAndContent) {
|
||||
if(noteAndContent) {
|
||||
console.log('sync content ' + note.NoteId + ' ok');
|
||||
var content = noteAndContent.Content;
|
||||
Web.contentSynced(note.NoteId, note.Content);
|
||||
// 图片
|
||||
if(content) {
|
||||
me.syncImages(content);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 附件
|
||||
var attachs = note.Attachs || [];
|
||||
for(var i in attachs) {
|
||||
var attach = attachs[i];
|
||||
me.downloadAttachFromServer(note.NoteId, attach.ServerFileId, attach.FileId);
|
||||
}
|
||||
// 附件
|
||||
var attachs = note.Attachs || [];
|
||||
for(var i in attachs) {
|
||||
var attach = attachs[i];
|
||||
me.downloadAttachFromServer(note.NoteId, attach.ServerFileId, attach.FileId);
|
||||
}
|
||||
}, 500);
|
||||
},
|
||||
|
||||
// 同步图片
|
||||
@@ -1130,7 +1132,7 @@ var Note = {
|
||||
return;
|
||||
}
|
||||
console.log('syncImages..................');
|
||||
console.log(content);
|
||||
// console.log(content);
|
||||
// 得到图片id
|
||||
var reg = new RegExp(Evt.localUrl + "/api/file/getImage\\?fileId=(.{24})\"", 'g');
|
||||
// var a = 'abdfileId="xxx" alksdjfasdffileId="life"';
|
||||
|
Reference in New Issue
Block a user