This commit is contained in:
xmcp
2019-03-09 12:26:37 +08:00
parent 19273f5cd2
commit f53087d56c
5 changed files with 33 additions and 18 deletions

View File

@@ -1,4 +1,5 @@
import React, {Component, PureComponent} from 'react';
import {PKUHELPER_ROOT} from './flows_api';
import TimeAgo from 'react-timeago';
import Linkify from 'react-linkify';
@@ -9,7 +10,7 @@ import './Common.css';
const chinese_format=buildFormatter(chineseStrings);
export const API_BASE=window.location.protocol==='https:' ? '/api_proxy' : 'http://www.pkuhelper.com:10301/services/pkuhole';
export const API_BASE=PKUHELPER_ROOT+'services/pkuhole';
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(?: \d+)?|洞主)(?![A-Za-z])/gi;
@@ -92,12 +93,10 @@ export class SafeTextarea extends Component {
text: '',
});
}
set_and_focus(text) {
set(text) {
this.change_callback(text);
this.setState({
text: text,
},()=>{
this.area_ref.current.focus();
});
}
get() {