Browse Source

add manifest and icon

dev
xmcp 7 years ago
parent
commit
f8e70804b4
  1. BIN
      public/favicon-precomposed.png
  2. 18
      public/index.html
  3. 15
      public/manifest.json
  4. 2
      src/Common.js
  5. 5
      src/Flows.js

BIN
public/favicon-precomposed.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

18
public/index.html

@ -4,23 +4,15 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="icon" href="%PUBLIC_URL%/favicon-precomposed.png">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon-precomposed.png">
<link rel="apple-touch-icon" href="%PUBLIC_URL%/favicon-precomposed.png" />
<meta name="apple-mobile-web-app-capable" content="yes">
<title>P大树洞(非官方)</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
<script>
var cnzz_s_tag = document.createElement('script');
cnzz_s_tag.type = 'text/javascript';

15
public/manifest.json

@ -0,0 +1,15 @@
{
"short_name": "树洞",
"name": "P大树洞(非官方)",
"icons": [
{
"src": "favicon-precomposed.png",
"sizes": "256x256",
"type": "image/png"
}
],
"start_url": "./index.html",
"display": "standalone",
"theme_color": "#112244",
"background_color": "#112244"
}

2
src/Common.js

@ -9,7 +9,7 @@ import './Common.css';
const chinese_format=buildFormatter(chineseStrings);
const PID_RE=/(^|\D)([1-9]\d{4,5})(?=\D)/g;
const PID_RE=/(^|[^\d])([1-9]\d{4,5})(?!\d)/g;
const NICKNAME_RE=/(^|[^A-Za-z])((?:(?:Angry|Baby|Crazy|Diligent|Excited|Fat|Greedy|Hungry|Interesting|Japanese|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|洞主)(?![A-Za-z])/gi;
function pad2(x) {

5
src/Flows.js

@ -13,7 +13,7 @@ const SEARCH_PAGESIZE=50;
const CLICKABLE_TAGS={a: true, audio: true};
const PREVIEW_REPLY_COUNT=10;
const LATEST_POST_ID=parseInt(localStorage['_LATEST_POST_ID'],10)||0;
window.LATEST_POST_ID=parseInt(localStorage['_LATEST_POST_ID'],10)||0;
function Reply(props) {
return (
@ -32,7 +32,7 @@ function Reply(props) {
function FlowItem(props) {
return (
<div className="flow-item box">
{parseInt(props.info.pid,10)>LATEST_POST_ID && <div className="flow-item-dot" /> }
{parseInt(props.info.pid,10)>window.LATEST_POST_ID && <div className="flow-item-dot" /> }
<div className="box-header">
{!!parseInt(props.info.likenum,10) && <span className="box-header-badge">{props.info.likenum}</span>}
{!!parseInt(props.info.reply,10) && <span className="box-header-badge">{props.info.reply}回复</span>}
@ -171,6 +171,7 @@ export class Flow extends Component {
loading_status: 'done',
};
this.on_scroll_bound=this.on_scroll.bind(this);
window.LATEST_POST_ID=parseInt(localStorage['_LATEST_POST_ID'],10)||0;
}
load_page(page) {

Loading…
Cancel
Save