mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-17 00:15:12 +00:00
tag 基本ok, TODO tag sync
This commit is contained in:
28
node_modules/web.js
generated
vendored
Normal file
28
node_modules/web.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
var fs = require('fs');
|
||||
|
||||
// noteJS端与web端的接口
|
||||
// web -> Node -> Web -> web
|
||||
// 该Node相当于一个转发的接口, Node -> web
|
||||
// 为什么要这样? 因为Note操作Tag, 而Note的操作由note.js引起, 这样会返回很多数据, 包括note, tags, 给前端来处理
|
||||
// 为什么不分开到各个Note, Tag nodejs中来调用Web呢? 这样避免过多的嵌套
|
||||
var Web = {
|
||||
Notebook: null,
|
||||
Note: null,
|
||||
Tag: null,
|
||||
|
||||
// 注入前端变量
|
||||
set: function(notebook, note, tag) {
|
||||
var me = this;
|
||||
me.Notebook = notebook;
|
||||
me.Note = note;
|
||||
me.Tag = tag;
|
||||
},
|
||||
|
||||
// 删除笔记时, 更新左侧导航标签的count
|
||||
// TODO test
|
||||
updateTagCount: function(tag) {
|
||||
var me = this;
|
||||
me.Tag.updateTagCount(tag);
|
||||
}
|
||||
};
|
||||
module.exports = Web;
|
Reference in New Issue
Block a user