diff --git a/README.md b/README.md
index 09a6014..9dc6f32 100644
--- a/README.md
+++ b/README.md
@@ -24,6 +24,7 @@ React 版 P大树洞,[pkuhelper.pku.edu.cn/hole](http://pkuhelper.pku.edu.cn/h
- 显示无限条搜索结果
- 智能调整上传图片的质量
- 用颜色区分不同人的回复
+- 自动显示提到的树洞
- 突出显示未读树洞
- 精确显示发帖时间
- 复制树洞链接和全文
@@ -36,15 +37,3 @@ React 版 P大树洞,[pkuhelper.pku.edu.cn/hole](http://pkuhelper.pku.edu.cn/h
- 搜索时筛选有图片、语音的树洞
- 发表语音树洞
-- 关注的树洞有回复时推送提醒
-
-**附:进行自定义的方法**
-
-在搜索框中输入类似 `//setflag KEY=value` 的内容(注意大小写、全半角和空格),然后重新打开页面即可生效。
-
-目前可以自定义的功能包括:
-
-- 检测瀑布流中被删除的树洞和树洞被删除的评论(`//setflag DELETION_DETECT=on`)
-- 自定义背景图片(`//setflag REPLACE_ERIRI_WITH_URL=http://...`)
-- 禁用重压屏幕(3D Touch)或按住 Esc 键返回(`//setflag DISABLE_PRESSURE=on`)
-- 禁用自动显示引用树洞功能(`//setflag DISABLE_QUOTE=on`)
\ No newline at end of file
diff --git a/public/index.html b/public/index.html
index e75933a..215ad9f 100644
--- a/public/index.html
+++ b/public/index.html
@@ -29,7 +29,14 @@
var _czc=_czc||[];
_czc.push(["_setAccount","1274501752"]);
_czc.push(["_setCustomVar","has_token",localStorage['TOKEN']?'yes':'no',1]);
- _czc.push(["_setCustomVar","background_image",localStorage['REPLACE_ERIRI_WITH_URL']||'null',0]);
+ try {
+ var config=JSON.parse(localStorage['hole_config']||'{}');
+ for(var key in config)
+ if(config.hasOwnProperty(key))
+ _czc.push(["_setCustomVar","config_"+key,JSON.stringify(config[key]),0]);
+ } catch(e) {
+ console.trace(e);
+ }
var cnzz_s_tag = document.createElement('script');
cnzz_s_tag.type = 'text/javascript';
cnzz_s_tag.async = true;
diff --git a/public/static/eriri_bg.jpg b/public/static/bg/eriri.jpg
similarity index 100%
rename from public/static/eriri_bg.jpg
rename to public/static/bg/eriri.jpg
diff --git a/public/static/bg/minecraft.jpg b/public/static/bg/minecraft.jpg
new file mode 100644
index 0000000..b5ba49a
Binary files /dev/null and b/public/static/bg/minecraft.jpg differ
diff --git a/public/static/bg/sif.jpg b/public/static/bg/sif.jpg
new file mode 100644
index 0000000..2fc0636
Binary files /dev/null and b/public/static/bg/sif.jpg differ
diff --git a/public/static/bg/yurucamp.jpg b/public/static/bg/yurucamp.jpg
new file mode 100644
index 0000000..faf9e3c
Binary files /dev/null and b/public/static/bg/yurucamp.jpg differ
diff --git a/src/App.js b/src/App.js
index e5f7532..c18da70 100644
--- a/src/App.js
+++ b/src/App.js
@@ -4,6 +4,7 @@ import {Title} from './Title';
import {Sidebar} from './Sidebar';
import {PressureHelper} from './PressureHelper';
import {TokenCtx,ISOP_APPKEY} from './UserAction';
+import {load_config,bgimg_style} from './Config';
import ImasuguApp from './imasugu/src/App';
@@ -37,6 +38,7 @@ function DeprecatedAlert(props) {
class App extends Component {
constructor(props) {
super(props);
+ load_config();
this.state={
sidebar_title: '',
sidebar_content: null, // determine status of sidebar
@@ -97,9 +99,7 @@ class App extends Component {
},
}}>
+ 背景图片: + + + {img_select==='##other' && + + } + {img_select==='##color' && + + } +
+ ++ +
++ {this.props.description} +
+树洞网页版 by @xmcp
-- This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. -
-- This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -
-树洞网页版 by @xmcp
++ This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. +
++ This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +
- { eriri_easteregg ? - 3月20日是看板娘英梨梨的生日 : + { final_exam_egg && window.config.easter_egg ? + 期末加油 : "官方网页版" }
diff --git a/src/color_picker.js b/src/color_picker.js index 90f5a15..4900cea 100644 --- a/src/color_picker.js +++ b/src/color_picker.js @@ -12,10 +12,13 @@ export class ColorPicker { name=name.toLowerCase(); if(name==='洞主') return 'hsl(0,0%,97%)'; + if(!window.config.color_picker) + return 'hsl(0,0%,85%)'; + if(!this.names[name]) { this.current_h+=golden_ratio_conjugate; this.current_h%=1; - this.names[name]=`hsl(${this.current_h*360}, 40%, 85%)`; + this.names[name]=`hsl(${this.current_h*360}, 40%, 87%)`; } return this.names[name]; }