diff --git a/src/Common.js b/src/Common.js index a824e61..2099328 100644 --- a/src/Common.js +++ b/src/Common.js @@ -46,7 +46,7 @@ export class HighlightedText extends PureComponent {
{parts.map((p,idx)=>( { - PID_RE.test(p) ? {this.props.show_pid(p)}}>{p} : + PID_RE.test(p) ? {e.preventDefault(); this.props.show_pid(p);}}>{p} : NICKNAME_RE.test(p) ? {p} : p } diff --git a/src/Flows.css b/src/Flows.css index 09759fd..e3d9bd4 100644 --- a/src/Flows.css +++ b/src/Flows.css @@ -23,7 +23,7 @@ align-items: flex-start; width: calc(100% - 625px); margin-left: -25px; - padding-left: 20px; + padding-left: 18px; overflow-x: auto; } @@ -63,7 +63,7 @@ .left-container .flow-reply { flex: 0 0 300px; max-height: 15em; - margin-right: -5px; + margin-right: -7px; overflow-y: hidden; } diff --git a/src/Flows.js b/src/Flows.js index bfd1c4d..e3a48a5 100644 --- a/src/Flows.js +++ b/src/Flows.js @@ -94,8 +94,15 @@ function FlowItem(props) {- {props.info.type==='image' ? : null} - {props.info.type==='audio' ?
: null} + {props.info.type==='image' && + + {props.img_clickable ? +
+ } + {props.info.type==='audio' &&: +
+ } +
} ); } @@ -209,7 +216,8 @@ class FlowSidebar extends PureComponent { } - + {this.state.replies.map((reply)=>( @@ -283,7 +291,8 @@ class FlowItemRow extends PureComponent { if(!CLICKABLE_TAGS[event.target.tagName.toLowerCase()]) this.show_sidebar(); }}> - + {this.state.reply_status==='loading' &&加载中} {this.state.reply_status==='failed' && diff --git a/src/UserAction.js b/src/UserAction.js index 36655a0..ce02879 100644 --- a/src/UserAction.js +++ b/src/UserAction.js @@ -5,8 +5,8 @@ import './UserAction.css'; import {API_BASE} from './Common'; const LOGIN_BASE=window.location.protocol==='https:' ? '/login_proxy' : 'http://www.pkuhelper.com/services/login'; -const MAX_IMG_PX=1000; -const MAX_IMG_FILESIZE=100000; +const MAX_IMG_PX=2000; +const MAX_IMG_FILESIZE=256000; export const TokenCtx=React.createContext({ value: null, diff --git a/src/flows_api.js b/src/flows_api.js index 2d85ddd..542aabc 100644 --- a/src/flows_api.js +++ b/src/flows_api.js @@ -100,8 +100,10 @@ export const API={ ) .then((res)=>res.json()) .then((json)=>{ - if(json.code!==0) + if(json.code!==0) { + if(json.msg) alert(json.msg); throw new Error(json); + } return json; }); }, @@ -114,8 +116,10 @@ export const API={ ) .then((res)=>res.json()) .then((json)=>{ - if(json.code!==0) + if(json.code!==0) { + if(json.msg) alert(json.msg); throw new Error(json); + } return json; }); }, @@ -127,8 +131,10 @@ export const API={ ) .then((res)=>res.json()) .then((json)=>{ - if(json.code!==0) + if(json.code!==0) { + if(json.msg) alert(json.msg); throw new Error(json); + } return json; }); }