From b539919550142c44aaa44ade3ad51781a870578c Mon Sep 17 00:00:00 2001 From: hole-thu Date: Fri, 4 Sep 2020 23:20:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=BE=E7=BD=AE=EF=BC=88?= =?UTF-8?q?=E6=8A=98=E5=8F=A0=E8=B1=81=E5=85=8D=E3=80=81=E5=BF=BD=E7=95=A5?= =?UTF-8?q?=E6=89=80=E6=9C=89=E6=8A=98=E5=8F=A0=E6=B4=9E=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Config.js | 29 +++++++++++++++++++++-------- src/Flows.js | 18 +++++++++--------- src/UserAction.js | 24 +++++++++++------------- src/flows_api.js | 5 ++++- src/infrastructure/widgets.css | 16 +++++++++------- src/infrastructure/widgets.js | 15 +++++++++------ 6 files changed, 63 insertions(+), 44 deletions(-) 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')} />


+ array.join('\n')} + sift={(array) => array.filter((v) => v)} + 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 { )}

@@ -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) {
+ + + + +    { props.show_sidebar('设置', ); @@ -52,14 +57,6 @@ export function InfoSidebar(props) { -    - - - -

@@ -88,7 +85,8 @@ export function InfoSidebar(props) {

-

联系我们:{EMAIL}

+

意见反馈请加tag #意见反馈 或到github后端的issus区。

+

联系我们:{EMAIL}

@@ -102,7 +100,7 @@ export function InfoSidebar(props) { GitHub {' '} - 开源 + 开源。

新T树洞 网页版基于 @@ -121,7 +119,7 @@ export function InfoSidebar(props) { IcoMoon - 等开源项目 + 等开源项目。

diff --git a/src/flows_api.js b/src/flows_api.js index 4f27dac..7b855cd 100644 --- a/src/flows_api.js +++ b/src/flows_api.js @@ -118,7 +118,10 @@ export const API = { get_list: async (page, token) => { let response = await fetch( - API_BASE + '/getlist' + token_param(token) + '&p=' + page, + API_BASE + '/getlist' + + token_param(token) + + '&p=' + page + + (window.config.no_c_post ? '&no_cw' : '') ); return handle_response(response); }, diff --git a/src/infrastructure/widgets.css b/src/infrastructure/widgets.css index 5fc7ddf..4808015 100644 --- a/src/infrastructure/widgets.css +++ b/src/infrastructure/widgets.css @@ -301,13 +301,15 @@ a.app-switcher-item, .app-switcher-item a { } a.button { - -webkit-appearance: button; - -moz-appearance: button; - appearance: button; + -webkit-appearance: button; + -moz-appearance: button; + appearance: button; - text-decoration: none; - color: initial; + text-decoration: none; + color: initial; - min-width: 6em; - font-size: 0.85em; + min-width: 6em; + font-size: 0.85em; + + padding: 5px; } diff --git a/src/infrastructure/widgets.js b/src/infrastructure/widgets.js index 4d3400a..c73385b 100644 --- a/src/infrastructure/widgets.js +++ b/src/infrastructure/widgets.js @@ -76,27 +76,30 @@ class LoginPopupSelf extends Component { 通过第三方验证登陆T大树洞

- - 闭社 + + +  闭社