leanote protocol移到main进程, 所有图片的操作通过db_client进行操作

This commit is contained in:
life
2015-12-18 13:10:40 +08:00
parent 31b1eba870
commit 13873a64c0
19 changed files with 580 additions and 468 deletions

12
node_modules/db.js generated vendored
View File

@@ -1,6 +1,7 @@
var Datastore = require('nedb');
var path = require('path');
var Evt = require('evt');
var dbClient = require('db_client');
// 数据库初始化
// var dbPath = require('nw.gui').App.dataPath + '/nedb';
@@ -26,10 +27,17 @@ var db = {
},
// 为特定用户初始化自己的表
initDBForUser: function (userId) {
initDBForUser: function (userId, curUser) {
var me = this;
var dbNames = ['notebooks', 'notes', 'tags', 'images', 'attachs', 'noteHistories'];
var dbNames = ['notebooks', 'notes', 'tags', /*'images',*/ 'attachs', 'noteHistories'];
this.initIt(me, dbNames, userId);
// init dbClient -> main db
var baseDBPath = dbPath;
if (userId) {
baseDBPath += '/' + userId;
}
dbClient.init(curUser, baseDBPath);
},
// 过时