diff --git a/src/Config.js b/src/Config.js index b2b0dc1..c3b67d3 100644 --- a/src/Config.js +++ b/src/Config.js @@ -3,8 +3,10 @@ import React, { PureComponent } from 'react'; import './Config.css'; const BUILTIN_IMGS = { + 'https://www.tsinghua.edu.cn/images/footer.jpg': + '清华紫(默认)', 'https://cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/bg/gbp.jpg': - '寻觅繁星(默认)', + '寻觅繁星', 'https://cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/bg/eriri.jpg': '平成著名画师', 'https://cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/bg/yurucamp.jpg': @@ -21,13 +23,14 @@ const BUILTIN_IMGS = { const DEFAULT_CONFIG = { background_img: - 'https://cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/bg/gbp.jpg', + 'https://www.tsinghua.edu.cn/images/footer.jpg', background_color: '#113366', pressure: false, easter_egg: true, color_scheme: 'default', - fold: true, + no_c_post: false, block_words: [], + whitelist_cw: [] }; export function load_config() { @@ -370,7 +373,7 @@ export class ConfigUI extends PureComponent {
- 修改设置后{' '}
+ 部分设置修改后需要{' '}
{
window.location.reload();
@@ -407,6 +410,16 @@ export class ConfigUI extends PureComponent {
parse={(string) => string.split('\n')}
/>
新功能建议或问题反馈请在
GitHub
diff --git a/src/Flows.js b/src/Flows.js
index 6d20b26..ffc8f76 100644
--- a/src/Flows.js
+++ b/src/Flows.js
@@ -666,7 +666,7 @@ class FlowItemRow extends PureComponent {
super(props);
this.needFold = props.info.cw &&
(props.search_param === '热榜' || !props.search_param) &&
- window.config.fold &&
+ (window.config.whitelist_cw.indexOf('*')==-1 && window.config.whitelist_cw.indexOf(props.info.cw)==-1) &&
props.mode !== 'attention' && props.mode !== 'attention_finished';
this.state = {
replies: [],
@@ -674,8 +674,8 @@ class FlowItemRow extends PureComponent {
reply_error: null,
info: Object.assign({}, props.info, { variant: {} }),
hidden: window.config.block_words.some((word) =>
- props.info.text.includes(word),
- ) || this.needFold,
+ props.info.text.includes(word),
+ ) || this.needFold,
attention:
props.attention_override === null ? false : props.attention_override,
cached: true, // default no display anything
@@ -897,7 +897,7 @@ class FlowItemRow extends PureComponent {
)}
- {this.needFold ? '已隐藏' : '已屏蔽'}
+ {this.needFold ? '已折叠' : '已屏蔽'}
@@ -1073,7 +1073,7 @@ export class Flow extends PureComponent {
this.setState((prev, props) => ({
loaded_pages: prev.loaded_pages - 1,
loading_status: 'failed',
- error_msg: prev.loaded_pages>1 ? '找不到更多了' : '' + err,
+ error_msg: prev.loaded_pages > 1 ? '找不到更多了' : '' + err,
}));
};
@@ -1095,10 +1095,10 @@ export class Flow extends PureComponent {
json.data.forEach((x) => {
if (x.comments) {
let comment_json = {
- 'code': 0,
- 'attention': x.attention,
- 'data': x.comments
- }
+ code: 0,
+ attention: x.attention,
+ data: x.comments,
+ };
//console.log('My cache', comment_json, x.pid, x.reply)
cache().put(x.pid, parseInt(x.reply, 10), comment_json);
}
diff --git a/src/UserAction.js b/src/UserAction.js
index cf79c05..2a60da9 100644
--- a/src/UserAction.js
+++ b/src/UserAction.js
@@ -25,8 +25,8 @@ const MAX_IMG_DIAM = 8000;
const MAX_IMG_PX = 5000000;
const MAX_IMG_FILESIZE = 450000 * BASE64_RATE;
-const REPOSITORY = 'https://a.com/b';
-const EMAIL = 'a@b.com';
+const REPOSITORY = 'https://github.com/newthuhole';
+const EMAIL = 'hole_thu@riseup.net';
export const TokenCtx = React.createContext({
value: null,
@@ -39,6 +39,11 @@ export function InfoSidebar(props) {
@@ -88,7 +85,8 @@ export function InfoSidebar(props) {
+