sync attach [ok]

todo conflicts copy attach
This commit is contained in:
life
2015-01-31 22:04:20 +08:00
parent c309427fed
commit 00aac7c96a
9 changed files with 301 additions and 60 deletions

9
node_modules/file.js generated vendored
View File

@@ -162,13 +162,17 @@ var File = {
},
// 笔记添加/修改后会有LocalFileId <=> FileId映射
updateFileForce: function(files) {
// 这个只对image有用
updateImageForce: function(files) {
if(!files) {
// callback && callback(false);
return;
}
for(var i in files) {
var file = files[i];
if(file.IsAttach) {
continue;
}
if(!file.FileId || !file.LocalFileId) {
continue;
}
@@ -207,6 +211,7 @@ var File = {
Name: rename,
UserId: User.getCurActiveUserId(),
Title: name,
IsDirty: true, // 先添加的肯定是dirty, 什么时候不是dirty ? sync 和 send changes后
Type: ext,
Size: fileStat && fileStat.size,
IsDirty: true, // 本地是新添加的, ServerFileId = 0
@@ -221,7 +226,7 @@ var File = {
// 删除不存在的attachs
deleteNotExistsAttach: function(noteId, attachs) {
var me = this;
console.log('--');
// console.log('--');
Attachs.find({NoteId: noteId}, function(err, everAttachs) {
if(err) {
return;