diff --git a/src/Common.js b/src/Common.js
index 4a10249..0e5ea4f 100644
--- a/src/Common.js
+++ b/src/Common.js
@@ -18,14 +18,17 @@ function pad2(x) {
return x<10 ? '0'+x : ''+x;
}
+export function format_time(time) {
+ return `${time.getMonth()+1}-${pad2(time.getDate())} ${time.getHours()}:${pad2(time.getMinutes())}:${pad2(time.getSeconds())}`;
+}
+
export function Time(props) {
const time=new Date(props.stamp*1000);
return (
- {time.getMonth()+1}-{time.getDate()}
- {time.getHours()}:{pad2(time.getMinutes())}
+ {format_time(time)}
);
}
@@ -102,7 +105,7 @@ export function PromotionBar(props) {
return is_ios ? (
- 在 Safari 中将本网站 添加到主屏幕 更好用哦
+ 用 Safari 将本网站 添加到主屏幕 更好用
) : null;
}
\ No newline at end of file
diff --git a/src/Flows.css b/src/Flows.css
index 036bfb4..9416beb 100644
--- a/src/Flows.css
+++ b/src/Flows.css
@@ -113,6 +113,10 @@
}
}
+.box-header {
+ font-size: small;
+}
+
.flow-item-row p.img {
text-align: center;
}
@@ -129,10 +133,6 @@
margin: 0 .5em;
}
-.box-id {
- opacity: .6;
-}
-
.flow-item-dot {
position: relative;
top: calc(-.5em - 5px);
@@ -143,4 +143,8 @@
border-radius: 50%;
background-color: orange;
box-shadow: 0 0 5px rgba(0,0,0,.4);
+}
+
+.box-content {
+ margin: .5em 0;
}
\ No newline at end of file
diff --git a/src/Flows.js b/src/Flows.js
index 7297b40..4359ae7 100644
--- a/src/Flows.js
+++ b/src/Flows.js
@@ -1,7 +1,7 @@
import React, {Component, PureComponent} from 'react';
import copy from 'copy-to-clipboard';
import {ColorPicker} from './color_picker';
-import {Time, TitleLine, HighlightedText} from './Common';
+import {format_time, Time, TitleLine, HighlightedText} from './Common';
import './Flows.css';
import LazyLoad from 'react-lazyload';
import {AudioWidget} from './AudioWidget';
@@ -38,6 +38,7 @@ function load_single_meta(show_sidebar,token) {
)
})
@@ -62,7 +63,9 @@ function Reply(props) {
#{props.info.cid}
-
+
+
+
);
}
@@ -70,7 +73,12 @@ function Reply(props) {
function FlowItem(props) {
function copy_link(event) {
event.preventDefault();
- copy(event.target.href);
+ copy(
+ `${event.target.href}\n`+
+ `(${format_time(new Date(props.info.timestamp*1000))} ${props.info.likenum}赞 ${props.info.reply}回复)\n`+
+ `${props.info.text}${props.info.type==='image'?' [图片]':props.info.type==='audio'?' [语音]':''}\n`+
+ props.replies.map((r)=>(r.text)).join('\n')
+ );
}
return (
@@ -93,16 +101,18 @@ function FlowItem(props) {
-
- {props.info.type==='image' &&
-
- {props.img_clickable ?
-
:
-
- }
-
- }
- {props.info.type==='audio' && }
+
+
+ {props.info.type==='image' &&
+
+ {props.img_clickable ?
+
:
+
+ }
+
+ }
+ {props.info.type==='audio' &&
}
+
);
}
@@ -129,9 +139,6 @@ class FlowSidebar extends PureComponent {
.then((json)=>{
this.setState((prev,props)=>({
replies: json.data,
- info: Object.assign({}, prev.info, {
- reply: ''+json.data.length,
- }),
attention: !!json.attention,
loading_status: 'done',
}), ()=>{
@@ -213,20 +220,20 @@ class FlowSidebar extends PureComponent {
return (
+ 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) &&
+
+ {parseInt(this.state.info.reply)-this.state.replies.length} 条回复被删除
+
+ }
{this.state.replies.map((reply)=>(
))}
- {this.props.token &&
-
+ {!!this.props.token ?
+
:
+
登录后可以回复树洞
}
)
@@ -283,9 +296,6 @@ class FlowItemRow extends PureComponent {
.then((json)=>{
this.setState((prev,props)=>({
replies: json.data,
- info: Object.assign({}, prev.info, {
- reply: ''+json.data.length,
- }),
attention: !!json.attention,
reply_status: 'done',
}),callback);
@@ -305,6 +315,7 @@ class FlowItemRow extends PureComponent {
);
}
@@ -316,7 +327,7 @@ class FlowItemRow extends PureComponent {
this.show_sidebar();
}}>
+ color_picker={this.color_picker} show_pid={this.show_pid} replies={this.state.replies} />
{this.state.reply_status==='loading' &&
加载中
}
{this.state.reply_status==='failed' &&
@@ -349,7 +360,8 @@ function FlowChunk(props) {
}
-
+
))}
diff --git a/src/Sidebar.css b/src/Sidebar.css
index b48465e..caeadc4 100644
--- a/src/Sidebar.css
+++ b/src/Sidebar.css
@@ -24,7 +24,7 @@
height: 100%;
width: calc(100% - 700px);
padding: 1em;
- background-color: rgba(255,255,255,.8);
+ background-color: rgba(255,255,255,.7);
z-index: 21;
overflow-y: auto;
}
diff --git a/src/UserAction.js b/src/UserAction.js
index ce7a8dd..6bafab3 100644
--- a/src/UserAction.js
+++ b/src/UserAction.js
@@ -102,32 +102,34 @@ export class LoginForm extends Component {
请勿泄露 Token,它代表您的登录状态,与您的账户唯一对应且泄露后无法重置
:
- 登录后可以使用关注、回复等功能
+
+
登录后可以使用关注、回复等功能
+
+
+
+
+
+
+
+
+
+ 登录请求会被发送到北大统一验证接口和 PKU Helper 服务器
+ 我们不会记录或使用您的登录信息
+
+
}
-
-
-
-
-
-
-
-
-
- 登录请求会被发送到北大统一验证接口和 PKU Helper 服务器
- 我们不会记录或使用您的登录信息
-
}
)
diff --git a/src/index.css b/src/index.css
index 9bdd6ec..a36c35c 100644
--- a/src/index.css
+++ b/src/index.css
@@ -20,7 +20,7 @@ body, textarea, pre {
-webkit-overflow-scrolling: touch;
}
-p {
+p, pre {
margin: 0;
}