From 6ffa7b9222ecf68c4e4c6d70b986ba872860ba49 Mon Sep 17 00:00:00 2001
From: xmcp
Date: Thu, 3 Oct 2019 23:12:48 +0800
Subject: [PATCH] update
---
package-lock.json | 5 -----
package.json | 1 -
public/index.html | 1 +
src/BalanceShower.js | 6 ++++--
src/Common.css | 2 +-
src/Config.js | 2 +-
src/Flows.css | 2 +-
src/Title.js | 4 ++--
src/index.css | 2 +-
src/text_splitter.js | 4 ++--
10 files changed, 13 insertions(+), 16 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index b17c672..fea1fff 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -10400,11 +10400,6 @@
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.9.0.tgz",
"integrity": "sha512-tJBzzzIgnnRfEm046qRcURvwQnZVXmuCbscxUO5RWrGTXpon2d4c8mI0D8WE6ydVIm29JiLB6+RslkIvym9Rjw=="
},
- "react-lazyload": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/react-lazyload/-/react-lazyload-2.3.0.tgz",
- "integrity": "sha512-0z3qmL+qtSERdfKFpn0yKXm+1Gg1ZLZBXnCzHhSGiu1L8iDARuCkbOypxEx9+ETxZvMnXj98xvWCs5jyXTuM2w=="
- },
"react-scripts": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-3.1.1.tgz",
diff --git a/package.json b/package.json
index 7d72df3..e7184f9 100644
--- a/package.json
+++ b/package.json
@@ -8,7 +8,6 @@
"pressure": "^2.1.2",
"react": "^16.9.0",
"react-dom": "^16.9.0",
- "react-lazyload": "latest",
"react-scripts": "^3.1.1",
"react-timeago": "^4.1.9"
},
diff --git a/public/index.html b/public/index.html
index ce420d2..d33c801 100644
--- a/public/index.html
+++ b/public/index.html
@@ -32,6 +32,7 @@
_czc.push(["_setAccount","1274501752"]);
_czc.push(["_setCustomVar","has_token",localStorage['TOKEN']?'yes':'no',1]);
_czc.push(["_setCustomVar","standalone",((window.matchMedia('(display-mode: standalone)').matches) || (window.navigator.standalone))?'yes':'no',1]);
+ _czc.push(["_setCustomVar","build_info","%REACT_APP_BUILD_INFO%"||'---']);
try {
var config=JSON.parse(localStorage['hole_config']||'{}');
for(var key in config)
diff --git a/src/BalanceShower.js b/src/BalanceShower.js
index 97f7c97..a68f037 100644
--- a/src/BalanceShower.js
+++ b/src/BalanceShower.js
@@ -15,9 +15,11 @@ export class BalanceShower extends PureComponent {
};
}
- do_load(token) {
+ do_load(e,token) {
if(this.state.loading_status==='loading')
return;
+ if(e.target.closest('a')) // clicking at a link
+ return;
if(!token || !window.config.easter_egg) {
this.setState({
loading_status: 'idle',
@@ -71,7 +73,7 @@ export class BalanceShower extends PureComponent {
render() {
return (
{(token)=>(
- this.do_load(token.value)}>
+
this.do_load(e,token.value)}>
{this.render_popover()}
{this.props.children}
diff --git a/src/Common.css b/src/Common.css
index 9dcc83c..5891e20 100644
--- a/src/Common.css
+++ b/src/Common.css
@@ -12,7 +12,7 @@
}
.root-dark-mode .bg-img {
- opacity: .6;
+ opacity: .65;
}
.black-outline {
diff --git a/src/Config.js b/src/Config.js
index 3e72483..fe851ea 100644
--- a/src/Config.js
+++ b/src/Config.js
@@ -152,7 +152,7 @@ class ConfigColorScheme extends PureComponent {
#color_scheme
- 选择浅色或深色模式,或者与系统颜色模式一致
+ 选择浅色或深色模式,深色模式下将会调暗图片亮度
)
diff --git a/src/Flows.css b/src/Flows.css
index 64a6486..2d4a88a 100644
--- a/src/Flows.css
+++ b/src/Flows.css
@@ -161,7 +161,7 @@
}
.root-dark-mode .flow-item-row p.img img {
- filter: brightness(.85);
+ filter: brightness(85%);
}
.box-header-badge {
diff --git a/src/Title.js b/src/Title.js
index aec7245..8eaead5 100644
--- a/src/Title.js
+++ b/src/Title.js
@@ -39,8 +39,8 @@ const HELP_TEXT=(
setTimeout(()=>{
window.location.reload(true);
},200);
- }}>强制检查更新
- ({process.env.REACT_APP_BUILD_INFO||'---'} {process.env.NODE_ENV})
+ }}>强制检查更新
+ ({process.env.REACT_APP_BUILD_INFO||'---'} {process.env.NODE_ENV} 会自动在后台检查更新并在下次访问时更新)
This program is free software: you can redistribute it and/or modify
diff --git a/src/index.css b/src/index.css
index 2e26d85..9f46326 100644
--- a/src/index.css
+++ b/src/index.css
@@ -19,7 +19,7 @@ a {
color: #00c;
}
-.root-dark-mode .left-container a, .root-dark-mode .sidebar a, .root-dark-mode .sidebar-title a {
+.root-dark-mode .left-container a, .root-dark-mode .sidebar a, .root-dark-mode .sidebar-title a, .root-dark-mode .balance-popover a {
color: #9bf;
}
diff --git a/src/text_splitter.js b/src/text_splitter.js
index 241c5e7..02f1b16 100644
--- a/src/text_splitter.js
+++ b/src/text_splitter.js
@@ -1,6 +1,6 @@
// regexp should match the WHOLE segmented part
-export const PID_RE=/(^|[^\d\u20e3\ufe0e\ufe0f])([1-9]\d{4,5})(?![\d\u20e3\ufe0e\ufe0f])/g;
-export const URL_PID_RE=/((?:https?:\/\/)?pkuhelper\.pku\.edu\.cn\/hole\/?#(?:#|%23)([1-9]\d{4,5}))(?!\d|\u20e3|\ufe0e|\ufe0f)/g;
+export const PID_RE=/(^|[^\d\u20e3\ufe0e\ufe0f])([2-9]\d{4,5}|1\d{4,6})(?![\d\u20e3\ufe0e\ufe0f])/g;
+export const URL_PID_RE=/((?:https?:\/\/)?pkuhelper\.pku\.edu\.cn\/hole\/?#(?:#|%23)([2-9]\d{4,5}|1\d{4,6}))(?!\d|\u20e3|\ufe0e|\ufe0f)/g;
export const NICKNAME_RE=/(^|[^A-Za-z])((?:(?:Angry|Baby|Crazy|Diligent|Excited|Fat|Greedy|Hungry|Interesting|Jolly|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;
export const URL_RE=/(^|[^.@a-zA-Z0-9_])((?:https?:\/\/)?(?:(?:[\w-]+\.)+[a-zA-Z]{2,3}|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?::\d{1,5})?(?:\/[\w~!@#$%^&*()\-_=+[\]{};:,./?|]*)?)(?![a-zA-Z0-9])/gi;