diff --git a/asset-manifest.json b/asset-manifest.json index 887335d..12aaf47 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,15 +1,15 @@ { "files": { "main.css": "//cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/css/main.e52316e2.chunk.css", - "main.js": "//cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/js/main.0d7867f8.chunk.js", - "main.js.map": "//cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/js/main.0d7867f8.chunk.js.map", + "main.js": "//cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/js/main.574777f2.chunk.js", + "main.js.map": "//cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/js/main.574777f2.chunk.js.map", "runtime~main.js": "//cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/js/runtime~main.a9c024a1.js", "runtime~main.js.map": "//cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/js/runtime~main.a9c024a1.js.map", "static/css/2.a9aba727.chunk.css": "//cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/css/2.a9aba727.chunk.css", "static/js/2.eab2fdd1.chunk.js": "//cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/js/2.eab2fdd1.chunk.js", "static/js/2.eab2fdd1.chunk.js.map": "//cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/js/2.eab2fdd1.chunk.js.map", "index.html": "./index.html", - "precache-manifest.3d0f07e47d76d374d36901f0541b3057.js": "//cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/precache-manifest.3d0f07e47d76d374d36901f0541b3057.js", + "precache-manifest.9da6cbd8d9a5eabfaa513852bf845dee.js": "//cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/precache-manifest.9da6cbd8d9a5eabfaa513852bf845dee.js", "service-worker.js": "./service-worker.js", "static/css/2.a9aba727.chunk.css.map": "//cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/css/2.a9aba727.chunk.css.map", "static/css/main.e52316e2.chunk.css.map": "//cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/css/main.e52316e2.chunk.css.map", diff --git a/index.html b/index.html index 8075dcd..34083dd 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -
\n {props.text}\n
\n )\n}\n\nexport function GlobalTitle(props) {\n return (\n{props.text}
\n\n// {!!dropdown_cur_app ?\n// app_elem((()=>{\n// let [id,title,_url,icon_normal,icon_hover,_new_tab]=dropdown_cur_app;\n// return [id,title+'▾',null,icon_normal,icon_hover,false];\n// })(),true) :\n// app_elem(['-placeholder-elem','更多▾',null,appicon_dropdown,appicon_dropdown_rev,false],true)\n// }\n//
\n// {this.state.apps.dropdown.map((app)=>{\n// let ref=React.createRef();\n// return (\n//{\n// if(!e.target.closest('a') && ref.current)\n// ref.current.click();\n// }}>\n// {app_elem(app,true,ref)}\n//
\n// );\n// })}\n//\n 接收验证码来登录 T大树洞\n
\n\n \n \n {/*this.do_sendcode('sms')}>*/}\n {/* 短信 */}\n {/**/}\n {/*/*/}\n this.do_sendcode('mail')}>\n 发送邮件 \n \n \n
\n\n \n \n
\n\n 从其他设备导入登录状态\n
\n\n \n \n
\n\n \n
\n\n {this.props.parts.map((part,idx)=>{\n let [rule,p]=part;\n return (\n {\n rule==='url_pid' ? /## :\n rule==='url' ? {p} :\n rule==='pid' ? {e.preventDefault(); this.props.show_pid(p.substring(1));}}>{p} :\n rule==='nickname' ? {p} :\n rule==='search' ? {p} :\n p\n }\n );\n })}\n
\n )\n }\n}\n\n// props: text, show_pid, color_picker\nexport class HighlightedMarkdown extends Component {\n render() {\n const props = this.props\n const processDefs = new HtmlToReact.ProcessNodeDefinitions(React)\n const processInstructions = [\n {\n shouldProcessNode: (node) => node.name === 'img', // disable images\n processNode (node) {\n return (正在下载……
);\n else if(this.state.state==='decoding')\n return (正在解码……
);\n else if(this.state.state==='loaded')\n return ();\n }\n}","import React, {Component, PureComponent} from 'react';\n\nimport './Config.css';\n\nconst BUILTIN_IMGS={\n 'https://cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/bg/gbp.jpg': '寻觅繁星(默认)',\n 'https://cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/bg/eriri.jpg': '平成著名画师',\n 'https://cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/bg/yurucamp.jpg': '露营天下第一',\n 'https://cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/bg/minecraft.jpg': '麦恩·库拉夫特',\n 'https://cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/bg/cyberpunk.jpg': '赛博城市',\n 'https://cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/bg/bj.jpg': '城市的星光',\n 'https://cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/bg/sif.jpg': '梦开始的地方',\n};\n\nconst DEFAULT_CONFIG={\n background_img: 'https://cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/bg/cyberpunk.jpg',\n background_color: '#113366',\n pressure: false,\n easter_egg: true,\n color_scheme: 'default',\n};\n\nexport function load_config() {\n let config=Object.assign({},DEFAULT_CONFIG);\n let loaded_config;\n try {\n loaded_config=JSON.parse(localStorage['hole_config']||'{}');\n } catch(e) {\n alert('设置加载失败,将重置为默认设置!\\n'+e);\n delete localStorage['hole_config'];\n loaded_config={};\n }\n\n // unrecognized configs are removed\n Object.keys(loaded_config).forEach((key)=>{\n if(config[key]!==undefined)\n config[key]=loaded_config[key];\n });\n\n console.log('config loaded',config);\n window.config=config;\n}\nexport function save_config() {\n localStorage['hole_config']=JSON.stringify(window.config);\n load_config();\n}\n\nexport function bgimg_style(img,color) {\n if(img===undefined) img=window.config.background_img;\n if(color===undefined) color=window.config.background_color;\n return {\n background: 'transparent center center',\n backgroundImage: img===null ? 'unset' : 'url(\"'+encodeURI(img)+'\")',\n backgroundColor: color,\n backgroundSize: 'cover',\n };\n}\n\nclass ConfigBackground extends PureComponent {\n constructor(props) {\n super(props);\n this.state={\n img: window.config.background_img,\n color: window.config.background_color,\n };\n }\n\n save_changes() {\n this.props.callback({\n background_img: this.state.img,\n background_color: this.state.color,\n });\n }\n\n on_select(e) {\n let value=e.target.value;\n this.setState({\n img: value==='##other' ? '' :\n value==='##color' ? null : value,\n },this.save_changes.bind(this));\n }\n on_change_img(e) {\n this.setState({\n img: e.target.value,\n },this.save_changes.bind(this));\n }\n on_change_color(e) {\n this.setState({\n color: e.target.value,\n },this.save_changes.bind(this));\n }\n\n render() {\n let img_select= this.state.img===null ? '##color' :\n Object.keys(BUILTIN_IMGS).indexOf(this.state.img)===-1 ? '##other' : this.state.img;\n return (\n\n 背景图片:\n \n \n {img_select==='##other' &&\n \n }\n {img_select==='##color' &&\n \n }\n
\n \n\n 夜间模式:\n \n #color_scheme\n
\n\n 选择浅色或深色模式,深色模式下将会调暗图片亮度\n
\n\n \n
\n\n {this.props.description}\n
\n这些功能仍在测试,可能不稳定(全部重置)
\n修改设置后 {window.location.reload()}}>刷新页面 方可生效
\n加载中……
);\n else if(this.state.loading_status==='failed')\n return ();\n else if(this.state.loading_status==='done')\n return this.state.msg.map((msg)=>(\n{msg.content}\n
\n T大树洞 网页版 by @thuhole,\n 基于 \n GPLv3\n 协议在 GitHub 开源\n
\n\n T大树洞 网页版的诞生离不开 \n P大树洞网页版 by @xmcp\n 、\n React\n 、\n IcoMoon\n 等开源项目\n
\n\n {\n if('serviceWorker' in navigator) {\n navigator.serviceWorker.getRegistrations()\n .then((registrations)=>{\n for(let registration of registrations) {\n console.log('unregister',registration);\n registration.unregister();\n }\n });\n }\n cache().clear();\n setTimeout(()=>{\n window.location.reload(true);\n },200);\n }}>强制检查更新\n (当前版本:【{process.env.REACT_APP_BUILD_INFO||'---'} {process.env.NODE_ENV}】 会自动在后台检查更新并在下次访问时更新)\n
\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n
\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the \n GNU General Public License\n for more details.\n
\n\n 您已登录。\n \n
\n
*/}\n {/*根据计算中心要求,访问授权三个月内有效,过期需重新登录。*/}\n {/*T大树洞将会单向加密(i.e. 哈希散列)您的邮箱后再存入数据库,因此您的发帖具有较强的匿名性。具体可见我们的后端开源代码。*/}\n {/*
*/}\n {/**/}\n {/* {this.props.show_sidebar(*/}\n {/* '系统消息',*/}\n {/*
*/}\n {/* /!*当您发送的内容违规时,我们将用系统消息提示您*!/*/}\n {/*
\n 复制 User Token
\n 复制 User Token 可以在新设备登录,切勿告知他人。若怀疑被盗号请重新邮箱验证码登录以重置Token。{/*,若怀疑被盗号请尽快
\n \n
\n\n T大树洞 面向T大学生,通过T大邮箱验证您的身份并提供服务。\n
\nload_single_meta(show_sidebar,token)(pid,true)}>重新加载
\n{''+e}
\n#{this.props.info.cid}
\n {!!this.props.do_filter_name &&\n {this.props.do_filter_name(this.props.info.name);}}>\n \n \n }\n \n {this.props.info.tag!==null &&\n \n {this.props.info.tag}\n \n }\n \n #{props.info.pid}
\n \n {props.info.tag!==null &&\n \n {props.info.tag}\n \n }\n \n \n {props.img_clickable ?\n :\n
\n }\n
最新回复
\n }\n加载中……
);\n\n let show_pid=load_single_meta(this.props.show_sidebar,this.props.token);\n\n let replies_to_show=this.state.filter_name ? this.state.replies.filter((r)=>r.name===this.state.filter_name) : this.state.replies.slice();\n if(this.state.rev) replies_to_show.reverse();\n\n // key for lazyload elem\n let view_mode_key=(this.state.rev ? 'y-' : 'n-')+(this.state.filter_name||'null');\n\n let replies_cnt={[DZ_NAME]:1};\n replies_to_show.forEach((r)=>{\n if(replies_cnt[r.name]===undefined)\n replies_cnt[r.name]=0;\n replies_cnt[r.name]++;\n });\n\n // hide main thread when filtered\n let main_thread_elem=(this.state.filter_name && this.state.filter_name!==DZ_NAME) ? null : (\n\n {this.set_filter_name(null)}}>还原\n 当前只看 \n
回复加载失败
\n{this.state.error_msg}
\n{this.state.reply_error}
\n{this.state.error_msg}
\n{this.load_page(this.state.loaded_pages+1)}}>重新加载
\n{this.state.error_msg}
\n\n props.show_sidebar(\n 'T大树洞',\n
\n
\n {props.text}\n
\n )\n}\n\nexport function GlobalTitle(props) {\n return (\n{props.text}
\n\n// {!!dropdown_cur_app ?\n// app_elem((()=>{\n// let [id,title,_url,icon_normal,icon_hover,_new_tab]=dropdown_cur_app;\n// return [id,title+'▾',null,icon_normal,icon_hover,false];\n// })(),true) :\n// app_elem(['-placeholder-elem','更多▾',null,appicon_dropdown,appicon_dropdown_rev,false],true)\n// }\n//
\n// {this.state.apps.dropdown.map((app)=>{\n// let ref=React.createRef();\n// return (\n//{\n// if(!e.target.closest('a') && ref.current)\n// ref.current.click();\n// }}>\n// {app_elem(app,true,ref)}\n//
\n// );\n// })}\n//\n 接收验证码来登录 T大树洞\n
\n\n \n \n {/*this.do_sendcode('sms')}>*/}\n {/* 短信 */}\n {/**/}\n {/*/*/}\n this.do_sendcode('mail')}>\n 发送邮件 \n \n \n
\n\n \n \n
\n\n 从其他设备导入登录状态\n
\n\n \n \n
\n\n \n
\n\n {this.props.parts.map((part,idx)=>{\n let [rule,p]=part;\n return (\n {\n rule==='url_pid' ? /## :\n rule==='url' ? {p} :\n rule==='pid' ? {e.preventDefault(); this.props.show_pid(p.substring(1));}}>{p} :\n rule==='nickname' ? {p} :\n rule==='search' ? {p} :\n p\n }\n );\n })}\n
\n )\n }\n}\n\n// props: text, show_pid, color_picker\nexport class HighlightedMarkdown extends Component {\n render() {\n const props = this.props\n const processDefs = new HtmlToReact.ProcessNodeDefinitions(React)\n const processInstructions = [\n {\n shouldProcessNode: (node) => node.name === 'img', // disable images\n processNode (node) {\n return (正在下载……
);\n else if(this.state.state==='decoding')\n return (正在解码……
);\n else if(this.state.state==='loaded')\n return ();\n }\n}","import React, {Component, PureComponent} from 'react';\n\nimport './Config.css';\n\nconst BUILTIN_IMGS={\n 'https://cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/bg/gbp.jpg': '寻觅繁星(默认)',\n 'https://cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/bg/eriri.jpg': '平成著名画师',\n 'https://cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/bg/yurucamp.jpg': '露营天下第一',\n 'https://cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/bg/minecraft.jpg': '麦恩·库拉夫特',\n 'https://cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/bg/cyberpunk.jpg': '赛博城市',\n 'https://cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/bg/bj.jpg': '城市的星光',\n 'https://cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/bg/sif.jpg': '梦开始的地方',\n};\n\nconst DEFAULT_CONFIG={\n background_img: 'https://cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/bg/cyberpunk.jpg',\n background_color: '#113366',\n pressure: false,\n easter_egg: true,\n color_scheme: 'default',\n};\n\nexport function load_config() {\n let config=Object.assign({},DEFAULT_CONFIG);\n let loaded_config;\n try {\n loaded_config=JSON.parse(localStorage['hole_config']||'{}');\n } catch(e) {\n alert('设置加载失败,将重置为默认设置!\\n'+e);\n delete localStorage['hole_config'];\n loaded_config={};\n }\n\n // unrecognized configs are removed\n Object.keys(loaded_config).forEach((key)=>{\n if(config[key]!==undefined)\n config[key]=loaded_config[key];\n });\n\n console.log('config loaded',config);\n window.config=config;\n}\nexport function save_config() {\n localStorage['hole_config']=JSON.stringify(window.config);\n load_config();\n}\n\nexport function bgimg_style(img,color) {\n if(img===undefined) img=window.config.background_img;\n if(color===undefined) color=window.config.background_color;\n return {\n background: 'transparent center center',\n backgroundImage: img===null ? 'unset' : 'url(\"'+encodeURI(img)+'\")',\n backgroundColor: color,\n backgroundSize: 'cover',\n };\n}\n\nclass ConfigBackground extends PureComponent {\n constructor(props) {\n super(props);\n this.state={\n img: window.config.background_img,\n color: window.config.background_color,\n };\n }\n\n save_changes() {\n this.props.callback({\n background_img: this.state.img,\n background_color: this.state.color,\n });\n }\n\n on_select(e) {\n let value=e.target.value;\n this.setState({\n img: value==='##other' ? '' :\n value==='##color' ? null : value,\n },this.save_changes.bind(this));\n }\n on_change_img(e) {\n this.setState({\n img: e.target.value,\n },this.save_changes.bind(this));\n }\n on_change_color(e) {\n this.setState({\n color: e.target.value,\n },this.save_changes.bind(this));\n }\n\n render() {\n let img_select= this.state.img===null ? '##color' :\n Object.keys(BUILTIN_IMGS).indexOf(this.state.img)===-1 ? '##other' : this.state.img;\n return (\n\n 背景图片:\n \n \n {img_select==='##other' &&\n \n }\n {img_select==='##color' &&\n \n }\n
\n \n\n 夜间模式:\n \n #color_scheme\n
\n\n 选择浅色或深色模式,深色模式下将会调暗图片亮度\n
\n\n \n
\n\n {this.props.description}\n
\n这些功能仍在测试,可能不稳定(全部重置)
\n修改设置后 {window.location.reload()}}>刷新页面 方可生效
\n加载中……
);\n else if(this.state.loading_status==='failed')\n return ();\n else if(this.state.loading_status==='done')\n return this.state.msg.map((msg)=>(\n{msg.content}\n
\n T大树洞 网页版 by @thuhole,\n 基于 \n GPLv3\n 协议在 GitHub 开源\n
\n\n T大树洞 网页版的诞生离不开 \n P大树洞网页版 by @xmcp\n 、\n React\n 、\n IcoMoon\n 等开源项目\n
\n\n {\n if('serviceWorker' in navigator) {\n navigator.serviceWorker.getRegistrations()\n .then((registrations)=>{\n for(let registration of registrations) {\n console.log('unregister',registration);\n registration.unregister();\n }\n });\n }\n cache().clear();\n setTimeout(()=>{\n window.location.reload(true);\n },200);\n }}>强制检查更新\n (当前版本:【{process.env.REACT_APP_BUILD_INFO||'---'} {process.env.NODE_ENV}】 会自动在后台检查更新并在下次访问时更新)\n
\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n
\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the \n GNU General Public License\n for more details.\n
\n\n 您已登录。\n \n
\n
*/}\n {/*根据计算中心要求,访问授权三个月内有效,过期需重新登录。*/}\n {/*T大树洞将会单向加密(i.e. 哈希散列)您的邮箱后再存入数据库,因此您的发帖具有较强的匿名性。具体可见我们的后端开源代码。*/}\n {/*
*/}\n {/**/}\n {/* {this.props.show_sidebar(*/}\n {/* '系统消息',*/}\n {/*
*/}\n {/* /!*当您发送的内容违规时,我们将用系统消息提示您*!/*/}\n {/*
\n 复制 User Token
\n 复制 User Token 可以在新设备登录,切勿告知他人。若怀疑被盗号请重新邮箱验证码登录以重置Token。{/*,若怀疑被盗号请尽快
\n \n
\n\n T大树洞 面向T大学生,通过T大邮箱验证您的身份并提供服务。\n
\nload_single_meta(show_sidebar,token)(pid,true)}>重新加载
\n{''+e}
\n#{this.props.info.cid}
\n {!!this.props.do_filter_name &&\n {this.props.do_filter_name(this.props.info.name);}}>\n \n \n }\n \n {this.props.info.tag!==null &&\n \n {this.props.info.tag}\n \n }\n \n #{props.info.pid}
\n \n {props.info.tag!==null &&\n \n {props.info.tag}\n \n }\n \n \n {props.img_clickable ?\n :\n
\n }\n
最新回复
\n }\n加载中……
);\n\n let show_pid=load_single_meta(this.props.show_sidebar,this.props.token);\n\n let replies_to_show=this.state.filter_name ? this.state.replies.filter((r)=>r.name===this.state.filter_name) : this.state.replies.slice();\n if(this.state.rev) replies_to_show.reverse();\n\n // key for lazyload elem\n let view_mode_key=(this.state.rev ? 'y-' : 'n-')+(this.state.filter_name||'null');\n\n let replies_cnt={[DZ_NAME]:1};\n replies_to_show.forEach((r)=>{\n if(replies_cnt[r.name]===undefined)\n replies_cnt[r.name]=0;\n replies_cnt[r.name]++;\n });\n\n // hide main thread when filtered\n let main_thread_elem=(this.state.filter_name && this.state.filter_name!==DZ_NAME) ? null : (\n\n {this.set_filter_name(null)}}>还原\n 当前只看 \n
回复加载失败
\n{this.state.error_msg}
\n{this.state.reply_error}
\n{this.state.error_msg}
\n{this.load_page(this.state.loaded_pages+1)}}>重新加载
\n{this.state.error_msg}
\n\n props.show_sidebar(\n 'T大树洞',\n
\n