Skip to content

Commit d88ffb5

Browse files
committed
init files
1 parent e3ce041 commit d88ffb5

File tree

402 files changed

+113442
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

402 files changed

+113442
-0
lines changed

.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
config.js
2+
.cov
3+
coverage
4+
node_modules
5+
.naeindex
6+
public/user_data
7+
coverage.html
8+
.monitor
9+
10+
*.min.*.js
11+
*.min.*.css
12+
assets.json
13+
14+
# Ignore Mac OS desktop services store
15+
.DS_Store
16+
17+
# Ignore Windows desktop setting file
18+
desktop.ini
19+
20+
*.log
21+
22+
.idea

.jshintrc

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"predef": [
3+
"phantom",
4+
"module",
5+
"require",
6+
"__dirname",
7+
"process",
8+
"console",
9+
"it",
10+
"describe",
11+
"before",
12+
"beforeEach",
13+
"after",
14+
"afterEach",
15+
"ace",
16+
"$"
17+
],
18+
19+
"browser": true,
20+
"node": true,
21+
"es5": true,
22+
"bitwise": true,
23+
"curly": true,
24+
"eqeqeq": true,
25+
"forin": false,
26+
"immed": true,
27+
"latedef": true,
28+
"newcap": true,
29+
"noarg": true,
30+
"noempty": true,
31+
"nonew": true,
32+
"plusplus": false,
33+
"undef": true,
34+
"strict": false,
35+
"trailing": false,
36+
"globalstrict": true,
37+
"nonstandard": true,
38+
"white": true,
39+
"indent": 2,
40+
"expr": true,
41+
"multistr": true,
42+
"onevar": false,
43+
"unused": "vars"
44+
}

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
language: node_js
2+
node_js:
3+
- '0.10'
4+
services:
5+
- mongodb

History.md

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
2+
0.3.6 / 2013-11-22
3+
==================
4+
5+
* fix #237 if topic not exists, do not modified it.
6+
* Merge pull request #230 from JacksonTian/fix_null
7+
* 修复给空值设置属性的错误
8+
* Merge pull request #224 from JacksonTian/config_ga
9+
* 将Google tracker可配置化
10+
* Merge pull request #223 from jiyinyiyong/ga
11+
* add Google Analytics
12+
* Merge pull request #217 from leizongmin/master
13+
* 编辑器进入全屏模式时,调整一下样式
14+
* hotfix sendAtMail
15+
* fixed "TypeError: Cannot read property author_id of null"
16+
* 使用七牛 gravatar.qiniudn.com 镜像
17+
* Merge pull request #212 from tjwudi/master
18+
* Fix 'title' textarea layout problem.
19+
* Merge pull request #211 from tjwudi/master
20+
* Add OS regular files to .gitignore
21+
* Merge pull request #209 from leizongmin/master
22+
* 解决打开Topic时自动跳到输入框问题
23+
* Merge pull request #205 from jiyinyiyong/master
24+
* Merge pull request #208 from leizongmin/master
25+
* 帖子内容页面,增加表格样式
26+
* 发布帖子使用 EpicEditor 编辑器
27+
* xss白名单 增加thead标签
28+
* Merge pull request #204 from JacksonTian/assets_issue
29+
* limit the length of message to 20
30+
* 兼容未启用压缩功能的情况
31+
* Merge pull request #193 from dead-horse/fix-block-count
32+
* fix block count
33+
* Merge pull request #190 from leizongmin/master
34+
* 修正用户收藏的话题页面,页码链接不正确问题
35+
* Merge pull request #186 from phoenixlzx/master
36+
* Fixed mongoose version
37+
* Merge pull request #182 from JacksonTian/assets_mini
38+
* 替换debug为mini
39+
* Merge pull request #181 from JacksonTian/assets
40+
* 用config.debug判断是否线上状态
41+
* Merge pull request #180 from JacksonTian/assets
42+
* 升级data2xml
43+
* 静态资源重构
44+
* Merge pull request #178 from JacksonTian/typo
45+
* Node.JS => Node.js
46+
* Merge pull request #177 from JacksonTian/style
47+
* 文章页面的样式
48+
* Fix几个样式问题
49+
* fixed #175 stars max size
50+
* fixed require package.json nae not support bug
51+
* Merge pull request #174 from JacksonTian/style
52+
* 去除用标签来制造空格的行为
53+
* 更新样式
54+
* Merge pull request #171 from jiyinyiyong/markdown-p
55+
* limit image height
56+
* limit pre-wrap inside p
57+
* Merge pull request #165 from VitoLau/master
58+
* 更新about faq页面结构
59+
* 调整about和faq页面 padding大小
60+
* Merge pull request #164 from jiyinyiyong/master
61+
* fix: markdown-text use pre-wrap
62+
* format indentations to 2
63+
* limit the with of message links to prevent line breaks
64+
* 修复文字过长没有换行的问题
65+
66+
0.3.5 / 2013-05-30
67+
==================
68+
69+
* Update logo based on the new official one (@finian)
70+
* UI more flatter; use "white-space:pre" to show spaces (@jiyinyiyong)
71+
* fixed #161 xss process after markdown transfer
72+
* 修复reply2的逻辑;暂时屏蔽标签功能
73+
* use fixed-width font in reply
74+
* a text align and a padding
75+
* add padding to the read messages
76+
* 点击回复数直接跳到最后一个回复
77+
* 支持html
78+
* fixed #154 消息跳转没有直接跳转到回复
79+
* fixed #146 修复tag编辑bug
80+
* 增加nae config
81+
* 增加邮件提示内容
82+
* read file sync package.json
83+
84+
0.3.4 / 2013-05-27
85+
==================
86+
87+
* user markd instead showdown, use ace (@fengmk2)
88+
* 使用加粗的边缘线; 过滤粉红色的边缘线; 加深 panel header 颜色; 去掉 scrollbar 定制 (@jiyinyiyong)
89+
* 指定xss模块的配置信息,禁止HTML标签的style和class属性 (@lezongmin)
90+
* shanzhai'd Github T3T (@jiyinyiyong)
91+
* @jiyinyiyong 修改界面布局 fixed #139
92+
* 添加话题详情主要内容的行高 (@kerngven)
93+
* 增加POST提交时间间隔限制 (@leizongmin)
94+
* 中英文间用空格
95+
* 发帖页面优化
96+
* 文本框高度不要闪烁
97+
* use bootstrap 2; hide tags
98+
* see the demo of new UI
99+
* 搜索页面,如果回复时间过长,会产生断行的情况
100+
* unit test cases
101+
* #132 Add https:// validate on user.js cnodejs/nodeclub#132 (@meteormatt)
102+
* Add 0.10 for travis
103+
* fixed #107 update user links
104+
105+
0.3.3 / 2013-03-11
106+
==================
107+
108+
* Merge pull request #126 from cnodejs/updateSignFlow
109+
* 修复topic更新bug;修复@某人 bug
110+
* reply2也可以定位到
111+
* 修复node 0.6 test cases
112+
* 修复删除评论异常
113+
* 修复 exports.updateLastReply 没有callback的bug
114+
* 管理员可以帮忙激活账号
115+
* Merge pull request #125 from JacksonTian/refine
116+
* Fix http to https
117+
* 重构注册和发帖以及发邮件的部分
118+
* Merge pull request #117 from JacksonTian/get_post
119+
* 去除掉req.method的判断,分拆方法
120+
* Merge pull request #122 from JacksonTian/proxy
121+
* 分离controller和数据操作业务逻辑
122+
* 改完下划线驼峰为小驼峰式风格
123+
* Merge pull request #116 from JacksonTian/codingstyle
124+
* Coding style refine.
125+
* Merge pull request #113 from JacksonTian/master
126+
* 添加依赖服务状态图标
127+
* Merge pull request #112 from JacksonTian/refine
128+
* 修正rewire.reset()导致的单元测试异常
129+
* Refine coding style
130+
* Merge pull request #111 from JacksonTian/master
131+
* Merge pull request #110 from JacksonTian/reset_history
132+
* Update Authors
133+
* 恢复History.md文件
134+
* Merge pull request #104 from ccding/master
135+
* fix issue #27: lower case email address for gravatar
136+
* Merge pull request #103 from ccding/master
137+
* fix issue #92: email address with gmail label ("+" encode)
138+
* fixed topic delete not post method security problem.
139+
* empty author
140+
* fixed author empty bug
141+
* Merge pull request #99 from leizongmin/master
142+
* 将Markdown中的H标题解析放到代码块解析后面
143+
* Merge pull request #96 from leizongmin/master
144+
* 修正无法正确解析http://127.0.0.1这样的IP地址链接
145+
* fixed font
146+
* fixed color style
147+
* Merge pull request #87 from jiyinyiyong/rebased
148+
* Merge pull request #91 from leizongmin/master
149+
* 使用xss模块来过滤主题及回复内容
150+
* update to 0.3.2
151+
* Merge remote branch 'cnode/master'
152+
* fix escape
153+
* Merge pull request #89 from dead-horse/master
154+
* fix test
155+
* use in node-validator
156+
* Merge remote branch 'cnode/master'
157+
* support block code
158+
* Merge pull request #88 from dead-horse/master
159+
* fix
160+
* change @me to markdown
161+
* fix @ bug in topic content
162+
* Merge pull request #86 from dead-horse/master
163+
* not escape html in
164+
* add preview
165+
* remove tags in topics of home page
166+
* some css
167+
* 合并通知按钮
168+
* use escape replace of xss()
169+
* fixed test cases
170+
* Merge pull request #85 from dead-horse/master
171+
* 过滤url允许绝对路径
172+
173+
0.3.2 / 2012-03-04
174+
==================
175+
176+
* ensure IncomingForm.UPLOAD_DIR
177+
* ensure upload image dir exists
178+
* fixed csrf bug in mark message read
179+
* remove customHost
180+
* add .naeignore files
181+
* * merge cnodeclub to nodeclub; * add more settings for custom site; * fixed upload.js not worked bug;
182+
* Merge pull request #4 from dead-horse/master
183+
* Merge pull request #11 from thebrecht/master
184+
* 话题回复数纳入二级回复,样式调整
185+
* 支持table,邮件提醒
186+
* 加入亂數產生新密碼
187+
* fix style
188+
* bugs fixed
189+
* Merge pull request #3 from LeToNode/master
190+
* Merge pull request #6 from ericzhang-cn/master
191+
* markdown语法粗体应为两个星号,原描述有误
192+
* Merge pull request #2 from roymax/master
193+
* change to async
194+
* change to async
195+
* Update README.md
196+
* 修复`[email protected]`格式的注册邮箱不能成功激活的问题
197+
* commit
198+
* project init
199+
* first commit

Makefile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
TESTS = $(shell find test -type f -name "*.test.js")
2+
TEST_TIMEOUT = 5000
3+
MOCHA_REPORTER = spec
4+
NPM_REGISTRY = "--registry=http://registry.npm.taobao.org"
5+
6+
7+
all: test
8+
9+
install:
10+
@npm install $(NPM_REGISTRY)
11+
12+
pretest:
13+
@if ! test -f config.js; then \
14+
cp config.default.js config.js; \
15+
fi
16+
17+
test: install pretest
18+
@NODE_ENV=test ./node_modules/mocha/bin/mocha \
19+
--reporter $(MOCHA_REPORTER) \
20+
--timeout $(TEST_TIMEOUT) \
21+
$(TESTS)
22+
23+
test-cov cov: install pretest
24+
@NODE_ENV=test node \
25+
node_modules/.bin/istanbul cover --preserve-comments \
26+
./node_modules/.bin/_mocha \
27+
-- \
28+
--reporter $(MOCHA_REPORTER) \
29+
--timeout $(TEST_TIMEOUT) \
30+
$(TESTS)
31+
32+
build:
33+
@./node_modules/loader/bin/build views .
34+
35+
start: install build
36+
@nohup ./node_modules/.bin/pm2 start app.js -i max --name "cnode" >> cnode.log 2>&1 &
37+
38+
restart: install build
39+
@nohup ./node_modules/.bin/pm2 restart "cnode" >> cnode.log 2>&1 &
40+
41+
.PHONY: install test cov test-cov build start restart

apis.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/**
2+
* Module dependencies.
3+
*/
4+
5+
var sign = require('./controllers/sign');
6+
var site = require('./controllers/site');
7+
var user = require('./controllers/user');
8+
var message = require('./controllers/message');
9+
var topic = require('./controllers/topic');
10+
var reply = require('./controllers/reply');
11+
var rss = require('./controllers/rss');
12+
var assets = require('./controllers/static');
13+
var tools = require('./controllers/tools');
14+
var auth = require('./middlewares/auth');
15+
var limit = require('./middlewares/limit');
16+
var status = require('./controllers/status');
17+
var github = require('./controllers/github');
18+
var search = require('./controllers/search');
19+
var passport = require('passport');
20+
var configMiddleware = require('./middlewares/conf');
21+
var config = require('./config');
22+
23+
var getUploadToken = function(req, res) {
24+
var qiniu = require('qiniu');
25+
qiniu.conf.ACCESS_KEY = config.qiniu.accessKey;
26+
qiniu.conf.SECRET_KEY = config.qiniu.secretKey;
27+
var putPolicy = new qiniu.rs.PutPolicy(config.qiniu.bucket);
28+
var result = {
29+
token: putPolicy.token(),
30+
host: config.qiniu.bucketHost
31+
};
32+
res.json(result);
33+
};
34+
35+
module.exports = function (app) {
36+
app.post('/api/topic/update', auth.signinRequired, topic.ajax_update);
37+
app.post('/api/topic/create', auth.signinRequired, limit.postInterval, topic.pagePut);
38+
app.post('/api/topic/like', auth.signinRequired, topic.like);
39+
app.post('/api/topic/unlike', auth.signinRequired, topic.un_like);
40+
app.post('/api/topic/forward', auth.signinRequired, topic.forward);
41+
app.get('/api/topic/repliesLimit', auth.signinRequired, reply.getPageTopicRepliesLimit);
42+
app.get('/api/topic/replies', auth.signinRequired, reply.getPageTopicReplies);
43+
44+
app.post('/api/topic/:topic_id/ajaxReply', auth.userRequired, limit.postInterval, reply.ajax_add);
45+
app.post('/api/topic/:topic_id/ajaxReply2', auth.userRequired, limit.postInterval, reply.ajax_add_reply2);
46+
app.post('/api/setting/avatar', auth.userRequired, user.ajax_avatar);
47+
48+
// token
49+
app.post('/api/token.json', auth.userRequired, getUploadToken);
50+
}

0 commit comments

Comments
 (0)