fix
This commit is contained in:
11308
package-lock.json
generated
11308
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -12,7 +12,7 @@ const chinese_format=buildFormatter(chineseStrings);
|
|||||||
export const API_BASE=window.location.protocol==='https:' ? '/api_proxy' : 'http://www.pkuhelper.com/services/pkuhole';
|
export const API_BASE=window.location.protocol==='https:' ? '/api_proxy' : 'http://www.pkuhelper.com/services/pkuhole';
|
||||||
|
|
||||||
const PID_RE=/(^|[^\d])([1-9]\d{4,5})(?!\d)/g;
|
const PID_RE=/(^|[^\d])([1-9]\d{4,5})(?!\d)/g;
|
||||||
const NICKNAME_RE=/(^|[^A-Za-z])((?:(?:Angry|Baby|Crazy|Diligent|Excited|Fat|Greedy|Hungry|Interesting|Japanese|Kind|Little|Magic|Naïve|Old|Powerful|Quiet|Rich|Superman|THU|Undefined|Valuable|Wifeless|Xiangbuchulai|Young|Zombie)\s)?(?:Alice|Bob|Carol|Dave|Eve|Francis|Grace|Hans|Isabella|Jason|Kate|Louis|Margaret|Nathan|Olivia|Paul|Queen|Richard|Susan|Thomas|Uma|Vivian|Winnie|Xander|Yasmine|Zach)|You Win|洞主)(?![A-Za-z])/gi;
|
const NICKNAME_RE=/(^|[^A-Za-z])((?:(?:Angry|Baby|Crazy|Diligent|Excited|Fat|Greedy|Hungry|Interesting|Japanese|Kind|Little|Magic|Naïve|Old|Powerful|Quiet|Rich|Superman|THU|Undefined|Valuable|Wifeless|Xiangbuchulai|Young|Zombie)\s)?(?:Alice|Bob|Carol|Dave|Eve|Francis|Grace|Hans|Isabella|Jason|Kate|Louis|Margaret|Nathan|Olivia|Paul|Queen|Richard|Susan|Thomas|Uma|Vivian|Winnie|Xander|Yasmine|Zach)|You Win(?: \d+)?|洞主)(?![A-Za-z])/gi;
|
||||||
|
|
||||||
function pad2(x) {
|
function pad2(x) {
|
||||||
return x<10 ? '0'+x : ''+x;
|
return x<10 ? '0'+x : ''+x;
|
||||||
|
|||||||
@@ -119,6 +119,7 @@
|
|||||||
|
|
||||||
.flow-item-row p.img {
|
.flow-item-row p.img {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
margin-top: .5em;
|
||||||
}
|
}
|
||||||
.flow-item-row p.img img {
|
.flow-item-row p.img img {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
@@ -147,4 +148,8 @@
|
|||||||
|
|
||||||
.box-content {
|
.box-content {
|
||||||
margin: .5em 0;
|
margin: .5em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box-id {
|
||||||
|
color: #666666;
|
||||||
}
|
}
|
||||||
14
src/Flows.js
14
src/Flows.js
@@ -131,7 +131,7 @@ class FlowSidebar extends PureComponent {
|
|||||||
this.syncState=props.sync_state||(()=>{});
|
this.syncState=props.sync_state||(()=>{});
|
||||||
}
|
}
|
||||||
|
|
||||||
load_replies() {
|
load_replies(update_count=true) {
|
||||||
this.setState({
|
this.setState({
|
||||||
loading_status: 'loading',
|
loading_status: 'loading',
|
||||||
});
|
});
|
||||||
@@ -139,6 +139,9 @@ class FlowSidebar extends PureComponent {
|
|||||||
.then((json)=>{
|
.then((json)=>{
|
||||||
this.setState((prev,props)=>({
|
this.setState((prev,props)=>({
|
||||||
replies: json.data,
|
replies: json.data,
|
||||||
|
info: update_count ? Object.assign({}, prev.info, {
|
||||||
|
reply: ''+json.data.length,
|
||||||
|
}) : prev.info,
|
||||||
attention: !!json.attention,
|
attention: !!json.attention,
|
||||||
loading_status: 'done',
|
loading_status: 'done',
|
||||||
}), ()=>{
|
}), ()=>{
|
||||||
@@ -249,7 +252,7 @@ class FlowSidebar extends PureComponent {
|
|||||||
</div>
|
</div>
|
||||||
<FlowItem info={this.state.info} attention={this.state.attention} img_clickable={true}
|
<FlowItem info={this.state.info} attention={this.state.attention} img_clickable={true}
|
||||||
color_picker={this.color_picker} show_pid={this.show_pid} replies={this.state.replies} />
|
color_picker={this.color_picker} show_pid={this.show_pid} replies={this.state.replies} />
|
||||||
{(this.props.deletion_detect && parseInt(this.state.info.reply)!==this.state.replies.length) &&
|
{(this.props.deletion_detect && parseInt(this.state.info.reply)>this.state.replies.length) &&
|
||||||
<div className="box box-tip flow-item box-danger">
|
<div className="box box-tip flow-item box-danger">
|
||||||
{parseInt(this.state.info.reply)-this.state.replies.length} 条回复被删除
|
{parseInt(this.state.info.reply)-this.state.replies.length} 条回复被删除
|
||||||
</div>
|
</div>
|
||||||
@@ -283,11 +286,11 @@ class FlowItemRow extends PureComponent {
|
|||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
if(parseInt(this.state.info.reply,10)) {
|
if(parseInt(this.state.info.reply,10)) {
|
||||||
this.load_replies();
|
this.load_replies(null,/*update_count=*/false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
load_replies(callback) {
|
load_replies(callback,update_count=true) {
|
||||||
console.log('fetching reply',this.state.info.pid);
|
console.log('fetching reply',this.state.info.pid);
|
||||||
this.setState({
|
this.setState({
|
||||||
reply_status: 'loading',
|
reply_status: 'loading',
|
||||||
@@ -296,6 +299,9 @@ class FlowItemRow extends PureComponent {
|
|||||||
.then((json)=>{
|
.then((json)=>{
|
||||||
this.setState((prev,props)=>({
|
this.setState((prev,props)=>({
|
||||||
replies: json.data,
|
replies: json.data,
|
||||||
|
info: update_count ? Object.assign({}, prev.info, {
|
||||||
|
reply: ''+json.data.length,
|
||||||
|
}) : prev.info,
|
||||||
attention: !!json.attention,
|
attention: !!json.attention,
|
||||||
reply_status: 'done',
|
reply_status: 'done',
|
||||||
}),callback);
|
}),callback);
|
||||||
|
|||||||
@@ -32,6 +32,11 @@
|
|||||||
left: 700px;
|
left: 700px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sidebar-title {
|
||||||
|
text-shadow: 0 0 3px white;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 1200px) {
|
@media screen and (max-width: 1200px) {
|
||||||
.sidebar {
|
.sidebar {
|
||||||
width: 550px;
|
width: 550px;
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ export function Sidebar(props) {
|
|||||||
<div className={props.content ? 'sidebar-on' : ''}>
|
<div className={props.content ? 'sidebar-on' : ''}>
|
||||||
<div className="sidebar-shadow" onClick={props.do_close} />
|
<div className="sidebar-shadow" onClick={props.do_close} />
|
||||||
<div className="sidebar">
|
<div className="sidebar">
|
||||||
<p>
|
<p className="sidebar-title">
|
||||||
<a onClick={props.do_close}>×</a>
|
<a onClick={props.do_close}> × </a>
|
||||||
{props.title}
|
{props.title}
|
||||||
</p>
|
</p>
|
||||||
{props.content}
|
{props.content}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -33,8 +33,9 @@
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.control-bar input {
|
.control-search {
|
||||||
flex: auto;
|
flex: auto;
|
||||||
color: black;
|
color: black;
|
||||||
background-color: rgba(255,255,255,.5);
|
background-color: rgba(255,255,255,.5);
|
||||||
|
margin: 0 .5em;
|
||||||
}
|
}
|
||||||
@@ -118,7 +118,7 @@ class ControlBar extends PureComponent {
|
|||||||
<span className="icon icon-attention" />
|
<span className="icon icon-attention" />
|
||||||
</a>
|
</a>
|
||||||
}
|
}
|
||||||
<input value={this.state.search_text} placeholder="搜索 或 #PID"
|
<input className="control-search" value={this.state.search_text} placeholder="搜索 或 #PID"
|
||||||
onChange={this.on_change_bound} onKeyPress={this.on_keypress_bound}
|
onChange={this.on_change_bound} onKeyPress={this.on_keypress_bound}
|
||||||
/>
|
/>
|
||||||
<a className="control-btn" onClick={()=>{
|
<a className="control-btn" onClick={()=>{
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export class LoginForm extends Component {
|
|||||||
'&msg='+md5(param+ISOP_APPCODE),
|
'&msg='+md5(param+ISOP_APPCODE),
|
||||||
{mode: 'no-cors'}
|
{mode: 'no-cors'}
|
||||||
);
|
);
|
||||||
alert('短信验证码应该会发到您的手机上,请注意查收!');
|
alert('如果学号存在,短信验证码将会发到您的手机上,请注意查收!');
|
||||||
}
|
}
|
||||||
|
|
||||||
do_login(set_token) {
|
do_login(set_token) {
|
||||||
|
|||||||
Reference in New Issue
Block a user