diff --git a/public/index.html b/public/index.html index a071bb6..ce420d2 100644 --- a/public/index.html +++ b/public/index.html @@ -6,7 +6,7 @@ - + diff --git a/public/static/fonts_5/icomoon.ttf b/public/static/fonts_5/icomoon.ttf deleted file mode 100644 index 03e2423..0000000 Binary files a/public/static/fonts_5/icomoon.ttf and /dev/null differ diff --git a/public/static/fonts_5/icomoon.woff b/public/static/fonts_5/icomoon.woff deleted file mode 100644 index 9913368..0000000 Binary files a/public/static/fonts_5/icomoon.woff and /dev/null differ diff --git a/public/static/fonts_5/icomoon.css b/public/static/fonts_6/icomoon.css similarity index 74% rename from public/static/fonts_5/icomoon.css rename to public/static/fonts_6/icomoon.css index 98fb8dc..12bde11 100644 --- a/public/static/fonts_5/icomoon.css +++ b/public/static/fonts_6/icomoon.css @@ -1,9 +1,9 @@ @font-face { font-family: 'icomoon'; src: - url('icomoon.ttf?gqzyp6') format('truetype'), - url('icomoon.woff?gqzyp6') format('woff'), - url('icomoon.svg?gqzyp6#icomoon') format('svg'); + url('icomoon.ttf?ycj3uk') format('truetype'), + url('icomoon.woff?ycj3uk') format('woff'), + url('icomoon.svg?ycj3uk#icomoon') format('svg'); font-weight: normal; font-style: normal; } @@ -28,6 +28,9 @@ .icon-send:before { content: "\e900"; } +.icon-textfile:before { + content: "\e926"; +} .icon-history:before { content: "\e94d"; } @@ -43,13 +46,22 @@ .icon-login:before { content: "\e98d"; } +.icon-settings:before { + content: "\e994"; +} .icon-stats:before { content: "\e99b"; } +.icon-locate:before { + content: "\e9b3"; +} .icon-upload:before { content: "\e9c3"; font-size: 1.2em; } +.icon-flag:before { + content: "\e9cc"; +} .icon-attention:before { content: "\e9d3"; } @@ -65,12 +77,19 @@ .icon-about:before { content: "\ea0c"; } +.icon-logout:before { + content: "\ea14"; +} .icon-refresh:before { content: "\ea2e"; } .icon-back:before { content: "\ea44"; } +.icon-order-rev:before { + content: "\ea46"; + font-size: 1.2em; +} .icon-github:before { content: "\eab0"; } diff --git a/public/static/fonts_5/icomoon.svg b/public/static/fonts_6/icomoon.svg similarity index 70% rename from public/static/fonts_5/icomoon.svg rename to public/static/fonts_6/icomoon.svg index 7e6eec1..d55b701 100644 --- a/public/static/fonts_5/icomoon.svg +++ b/public/static/fonts_6/icomoon.svg @@ -8,19 +8,25 @@ + + + + + + \ No newline at end of file diff --git a/public/static/fonts_6/icomoon.ttf b/public/static/fonts_6/icomoon.ttf new file mode 100644 index 0000000..74d79a5 Binary files /dev/null and b/public/static/fonts_6/icomoon.ttf differ diff --git a/public/static/fonts_6/icomoon.woff b/public/static/fonts_6/icomoon.woff new file mode 100644 index 0000000..fe6b6dd Binary files /dev/null and b/public/static/fonts_6/icomoon.woff differ diff --git a/src/Common.css b/src/Common.css index 2448f61..9dcc83c 100644 --- a/src/Common.css +++ b/src/Common.css @@ -1,3 +1,7 @@ +.clickable { + cursor: pointer; +} + .bg-img { position: fixed; z-index: -1; @@ -45,4 +49,13 @@ .root-dark-mode .colored-span { background-color: var(--coloredspan-bgcolor-dark); +} + +.icon+label { + font-size: .9em; + vertical-align: .05em; + cursor: inherit; +} +.icon+label::before { + content: ' '; } \ No newline at end of file diff --git a/src/Common.js b/src/Common.js index fe53dac..868fd3c 100644 --- a/src/Common.js +++ b/src/Common.js @@ -17,7 +17,7 @@ export function build_highlight_re(txt,split) { return txt ? new RegExp(`(${txt.split(split).filter((x)=>!!x).map(escape_regex).join('|')})`,'g') : /^$/g; } -function ColoredSpan(props) { +export function ColoredSpan(props) { return (
- #{this.props.info.cid} + {this.props.do_filter_name ? + {this.props.do_filter_name(this.props.info.name);}}> + #{this.props.info.cid} + : + #{this.props.info.cid} + }   {this.props.info.tag!==null && @@ -191,24 +197,14 @@ class FlowSidebar extends PureComponent { replies: props.replies, loading_status: 'done', error_msg: null, - dz_only: false, + filter_name: null, + rev: false, }; this.color_picker=props.color_picker; this.syncState=props.sync_state||(()=>{}); this.reply_ref=React.createRef(); } - /*componentWillReceiveProps(nextProps) { - this.setState({ - attention: nextProps.attention, - info: nextProps.info, - replies: nextProps.replies, - loading_status: 'done', - }); - this.color_picker=nextProps.color_picker; - this.syncState=nextProps.sync_state||(()=>{}); - }*/ // refactored to use key instead - set_variant(cid,variant) { this.setState((prev)=>{ if(cid) @@ -305,14 +301,20 @@ class FlowSidebar extends PureComponent { } } - toggle_dz_only() { + set_filter_name(name) { + this.setState((prevState)=>({ + filter_name: name===prevState.filter_name ? null : name, + })); + } + + toggle_rev() { this.setState((prevState)=>({ - dz_only: !prevState.dz_only, + rev: !prevState.rev, })); } show_reply_bar(name,event) { - if(this.reply_ref.current && !event.target.closest('a')) { + if(this.reply_ref.current && !event.target.closest('a, .clickable')) { let text=this.reply_ref.current.get(); if(/^\s*(?:Re (?:|洞主|(?:[A-Z][a-z]+ )?(?:[A-Z][a-z]+)):)?\s*$/.test(text)) {// text is nearly empty so we can replace it let should_text='Re '+name+': '; @@ -330,29 +332,39 @@ class FlowSidebar extends PureComponent { let show_pid=load_single_meta(this.props.show_sidebar,this.props.token,this.props.parents.concat([this.state.info.pid])); - let replies_to_show=this.state.dz_only ? this.state.replies.filter((r)=>r.islz) : this.state.replies; + let replies_to_show=this.state.filter_name ? this.state.replies.filter((r)=>r.name===this.state.filter_name) : this.state.replies.slice(); + if(this.state.rev) replies_to_show.reverse(); + + // key for lazyload elem + let view_mode_key=(this.state.rev ? 'y-' : 'n-')+(this.state.filter_name||'null'); return (
{!!this.props.token && - 举报 -  /  + + + +    } - 刷新回复 -  /  - {this.state.dz_only ? '查看全部' : '只看洞主'} + + + +    + + + {!!this.props.token && -  /  +    { this.toggle_attention(); }}> {this.state.attention ? -  已关注 : -  未关注 + : + } @@ -375,12 +387,22 @@ class FlowSidebar extends PureComponent { {parseInt(this.state.info.reply)-this.state.replies.length} 条回复被删除
} + {!!this.state.filter_name && +
+

+ {this.set_filter_name(null)}}>还原 +  当前只看  + {this.state.filter_name} +

+
+ } {replies_to_show.map((reply)=>( - + {this.show_reply_bar(reply.name,e);}}> {this.set_variant(reply.cid,variant);}} + do_filter_name={this.set_filter_name.bind(this)} /> diff --git a/src/Title.js b/src/Title.js index 8e6505d..aec7245 100644 --- a/src/Title.js +++ b/src/Title.js @@ -151,11 +151,17 @@ class ControlBar extends PureComponent { {this.props.show_sidebar( '设置', - )}}>网页版树洞设置 -  /  - 树洞规范 -  /  - 意见反馈 + )}}> + + +    + + + +    + + +
{HELP_TEXT}
diff --git a/src/UserAction.css b/src/UserAction.css index 1c75e8b..6e2135d 100644 --- a/src/UserAction.css +++ b/src/UserAction.css @@ -30,6 +30,7 @@ } .reply-form button { flex: 0 0 3em; + margin-right: 0; } .post-form-bar { @@ -51,6 +52,7 @@ } .post-form-bar button { flex: 0 0 8em; + margin-right: 0; } .post-form-img-tip { font-size: small; diff --git a/src/UserAction.js b/src/UserAction.js index 29dc2cc..8e0dfad 100644 --- a/src/UserAction.js +++ b/src/UserAction.js @@ -197,7 +197,9 @@ export class LoginForm extends Component {

您已登录。 - +

diff --git a/src/index.css b/src/index.css index ffdd16c..2e26d85 100644 --- a/src/index.css +++ b/src/index.css @@ -27,6 +27,7 @@ input, textarea { border-radius: 5px; border: 1px solid black; outline: none; + margin: 0; } input { padding: 0 1em;