diff --git a/README.md b/README.md index 5b2eb90f..0f406543 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # AsHole -React版P大树洞,[hole.xmcp.ml](http://hole.xmcp.ml) - - +React 版 P大树洞,[hole.xmcp.ml](http://hole.xmcp.ml) 与 PKU Helper 客户端比较,本项目…… @@ -31,10 +29,15 @@ React版P大树洞,[hole.xmcp.ml](http://hole.xmcp.ml) - 精确显示发帖时间 - 复制树洞链接 - 3D Touch 支持 -- 自定义背景图片(没有提供相关 UI,请自行修改 `localStorage['REPLACE_ERIRI_WITH_URL']`) +- 自定义背景图片(请修改 Flag `REPLACE_ERIRI_WITH_URL=http://...`) +- 检测被删除的树洞(请修改 Flag `DELETION_DETECT=on`) +- 刷树洞负关注数(请修改 Flag `STAR_BRUSH=on`) +- 用 Token 登录(请修改 Flag `TOKEN=...`) **不支持** PKU Helper 树洞**支持**的以下功能: - 搜索时筛选有图片、语音的树洞 - 发表语音树洞 - 关注的树洞有回复时推送提醒 + +*注:设置 Flag 请在搜索框输入 `//setflag KEY=value`* \ No newline at end of file diff --git a/src/Flows.css b/src/Flows.css index e3d9bd47..036bfb47 100644 --- a/src/Flows.css +++ b/src/Flows.css @@ -12,6 +12,10 @@ text-align: center; } +.box-danger { + background-color: #faa; +} + .left-container .flow-item { display: inline-block; width: 600px; diff --git a/src/Flows.js b/src/Flows.js index e3a48a56..799710fe 100644 --- a/src/Flows.js +++ b/src/Flows.js @@ -189,12 +189,36 @@ class FlowSidebar extends PureComponent { } } + star_brush() { + let count=prompt('Count:'); + if(count) { + let reqs=[]; + for(let i=parseInt(count);i;i--) + reqs.push(API.set_attention(this.state.info.pid,false,this.props.token)); + Promise.all(reqs) + .then(()=>{ + alert('Completed!') + }) + .catch((e)=>{ + alert('Failed!\n\n'+e); + }) + } + } + render() { + const star_brush=localStorage['STAR_BRUSH']==='on'; + if(this.state.loading_status==='loading') return (
加载中……
); return (使用提示:
@@ -59,7 +61,8 @@ class ControlBar extends PureComponent { componentDidMount() { if(window.location.hash) { let text=window.location.hash.substr(1); - text=text.substr(0,text.lastIndexOf('?')); // fuck wechat '#param?nsukey=...' + if(text.lastIndexOf('?')!==-1) + text=text.substr(0,text.lastIndexOf('?')); // fuck wechat '#param?nsukey=...' this.setState({ search_text: text, }, ()=>{ @@ -76,6 +79,13 @@ class ControlBar extends PureComponent { on_keypress(event) { if(event.key==='Enter') { + let flag_res=flag_re.exec(this.state.search_text); + if(flag_res) { + localStorage[flag_res[1]]=flag_res[2]; + alert('Set Flag '+flag_res[1]+'='+flag_res[2]); + return; + } + const mode=this.state.search_text.startsWith('#') ? 'single' : 'search'; this.set_mode(mode,this.state.search_text||null); }