mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-14 15:11:24 +00:00
Merge branch 'master' of github.com:leanote/desktop-app
This commit is contained in:
8
node_modules/nedb_proxy.js
generated
vendored
8
node_modules/nedb_proxy.js
generated
vendored
@@ -24,13 +24,12 @@ function DBProxy(dbname) {
|
||||
this.dbname = dbname;
|
||||
};
|
||||
|
||||
var token = 1;
|
||||
var token = 0;
|
||||
var token2Callback = {};
|
||||
|
||||
DBProxy.prototype.send = function(params, callback, method) {
|
||||
token++;
|
||||
var m = {
|
||||
token: token,
|
||||
token: ++token,
|
||||
method: method,
|
||||
dbname: this.dbname,
|
||||
// 转为json字符串, 如果{[a], [a]}, 在main接收后变成了 {[a], [null]}, 对象引用问题
|
||||
@@ -84,6 +83,7 @@ DBProxy.prototype.remove = function (params, callback) {
|
||||
ipc.on('db-exec-ret', function(event, m) {
|
||||
var token = m.token;
|
||||
var callback = token2Callback[token];
|
||||
delete token2Callback[token];
|
||||
// console.log('clent 接收到消息');
|
||||
// console.log(m);
|
||||
// console.log('--------------');
|
||||
@@ -93,4 +93,4 @@ ipc.on('db-exec-ret', function(event, m) {
|
||||
callback && callback(m.err, m.ret);
|
||||
});
|
||||
|
||||
module.exports = DBProxy;
|
||||
module.exports = DBProxy;
|
||||
|
@@ -903,7 +903,7 @@ Note.renderChangedNote = function(changedNote) {
|
||||
$leftNoteNav.find(".desc").html(trimTitle(changedNote.Desc));
|
||||
}
|
||||
if (changedNote.ImgSrc) {
|
||||
$thumb = $leftNoteNav.find(".item-thumb");
|
||||
var $thumb = $leftNoteNav.find(".item-thumb");
|
||||
// 有可能之前没有图片
|
||||
if ($thumb.length > 0) {
|
||||
$thumb.find("img").attr("src", Note.fixImageSrc(changedNote.ImgSrc));
|
||||
@@ -2500,8 +2500,6 @@ Note.initContextmenu = function() {
|
||||
this.menu.append(this.exports);
|
||||
}
|
||||
|
||||
T = this;
|
||||
|
||||
this.enable = function(name, ok) {
|
||||
this[name].enabled = ok;
|
||||
}
|
||||
|
@@ -710,7 +710,7 @@ Notebook.changeNotebook = function(notebookId, callback, needRendNoteId) {
|
||||
|
||||
var url = "/note/listNotes/";
|
||||
var param = { notebookId: notebookId };
|
||||
|
||||
var cacheNotes = null;
|
||||
// 废纸篓
|
||||
if (Notebook.isTrashNotebookId(notebookId)) {
|
||||
url = "/note/listTrashNotes";
|
||||
|
@@ -1037,7 +1037,7 @@ LeaAce = {
|
||||
return true;
|
||||
} else {
|
||||
// 找到父是pre
|
||||
$pre = $node.closest("pre");
|
||||
var $pre = $node.closest("pre");
|
||||
if ($pre.length == 0) {
|
||||
return false;
|
||||
}
|
||||
@@ -1061,7 +1061,7 @@ LeaAce = {
|
||||
return false;
|
||||
} else {
|
||||
// 找到父是pre
|
||||
$pre = $node.closest("pre");
|
||||
var $pre = $node.closest("pre");
|
||||
if ($pre.length == 0) {
|
||||
return false;
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ var lang = {
|
||||
}
|
||||
|
||||
var curLang = Config['lang'] || sysLang || defaultLang;
|
||||
langData = me.readJson('public/langs/' + curLang + '.js');
|
||||
var langData = me.readJson('public/langs/' + curLang + '.js');
|
||||
if(!langData) {
|
||||
langData = me.readJson('public/langs/' + defaultLang + '.js');
|
||||
if (!langData) {
|
||||
@@ -67,4 +67,4 @@ var lang = {
|
||||
}
|
||||
};
|
||||
|
||||
lang.init();
|
||||
lang.init();
|
||||
|
Reference in New Issue
Block a user