Browse Source

add copy tooltip and fix reply

dev
xmcp 6 years ago
parent
commit
9c390f3b79
  1. 15
      src/Flows.css
  2. 3
      src/Flows.js

15
src/Flows.css

@ -155,3 +155,18 @@
.box-id {
color: #666666;
}
.box-id a:hover::before {
content: "复制全文";
position: relative;
width: 5em;
height: 1.3em;
line-height: 1.3em;
margin-bottom: -1.3em;
border-radius: 3px;
text-align: center;
top: -1.5em;
display: block;
color: white;
background-color: rgba(0,0,0,.6);
pointer-events: none;
}

3
src/Flows.js

@ -10,7 +10,7 @@ import {TokenCtx, ReplyForm} from './UserAction';
import {API} from './flows_api';
const IMAGE_BASE='http://www.pkuhelper.com:10301/services/pkuhole/images/';
const AUDIO_BASE='/audio_proxy/';
const AUDIO_BASE='http://www.pkuhelper.com:10301/services/pkuhole/audios/';
const SEARCH_PAGESIZE=50;
const CLICKABLE_TAGS={a: true, audio: true};
@ -256,6 +256,7 @@ class FlowSidebar extends PureComponent {
do_reply(name,event) {
if(event.target.tagName.toLowerCase()!=='a') {
let text=this.reply_ref.current.get();
if(/^\s*(Re (洞主|\b[A-Z][a-z]+){0,2}:)?\s*$/.test(text)) // text is nearly empty so we can replace it
this.reply_ref.current.set_and_focus('Re '+name+': ');
}
}

Loading…
Cancel
Save