├── .editorconfig
├── .env
├── .github
├── FUNDING.yml
└── workflows
│ └── ci.yml
├── .gitignore
├── .gitmodules
├── .kktrc.js
├── README.md
├── chrome-main
├── manifest.json
└── osc-logo.png
├── img
├── newtab.gif
├── newtab1.gif
├── newtab2.gif
├── osc-extensions.png
├── osc-news1.png
├── osc-news2.png
├── osc-news3.png
├── osc-news4.png
├── osc-news5.png
├── osc-news6.png
├── osc-news7.png
├── osc-news8.png
└── oschina.svg
├── package-lock.json
├── package.json
├── public
├── favicon.ico
└── index.html
├── renovate.json
└── src
├── Root.js
├── Route.js
├── assets
├── add-icon.png
├── apple.svg
├── chrome-app.svg
├── gitee.svg
├── github.svg
├── linux-logo.svg
├── oschina.svg
├── setting.svg
└── website.svg
├── component
├── Clock
│ ├── index.js
│ └── index.module.less
├── Contextmenu
│ ├── index.js
│ └── index.module.less
├── Dropdown
│ ├── index.js
│ └── index.module.less
├── Footer.js
├── Footer.module.less
├── Header.js
├── Header.module.less
├── Icon
│ └── index.js
├── Loading
│ ├── index.js
│ └── index.module.less
├── Modal
│ └── index.module.less
├── OSCNews.js
├── OSCNews.module.less
├── Progress
│ ├── index.js
│ └── index.module.less
├── Search
│ ├── index.js
│ └── index.module.less
├── Select
│ ├── index.js
│ └── index.module.less
├── Switch
│ ├── index.js
│ └── index.module.less
├── container
│ ├── index.js
│ └── index.module.less
└── modal
│ └── index.js
├── index.js
├── index.less
├── pages
├── Blank.js
├── Blank.module.less
├── Document
│ ├── icons.js
│ ├── index.js
│ └── index.module.less
├── Github.js
├── Github.module.less
├── History.js
├── History.module.less
├── Linux
│ ├── index.js
│ └── index.module.less
├── Navigation
│ ├── Edit.js
│ ├── Edit.module.less
│ ├── index.js
│ └── index.module.less
├── Search
│ ├── index.js
│ └── index.module.less
└── Todo
│ ├── icon.js
│ ├── index.js
│ └── index.module.less
├── source
├── search.json
├── trending.json
└── website.json
└── utils
├── BlockFetch.js
├── fetch.js
├── index.js
└── theWeek.js
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | indent_style = space
5 | indent_size = 2
6 | end_of_line = lf
7 | charset = utf-8
8 | trim_trailing_whitespace = false
9 | insert_final_newline = false
--------------------------------------------------------------------------------
/.env:
--------------------------------------------------------------------------------
1 | INLINE_RUNTIME_CHUNK=false
2 | FAST_REFRESH=false
3 | BUILD_PATH=dist
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | # github: [jaywcjlove]
4 | # patreon: # Replace with a single Patreon username
5 | # open_collective: # Replace with a single Open Collective username
6 | # ko_fi: # Replace with a single Ko-fi username
7 | # tidelift: #npm/mocker-api
8 | # community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | custom: https://jaywcjlove.github.io/#/sponsor
10 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: CI
2 | on:
3 | push:
4 | branches:
5 | - master
6 |
7 | jobs:
8 | build:
9 | runs-on: ubuntu-latest
10 | steps:
11 | - uses: actions/checkout@master
12 | with:
13 | submodules: true
14 | - uses: actions/setup-node@v3
15 | with:
16 | node-version: 18
17 | registry-url: 'https://registry.npmjs.org'
18 |
19 | - run: npm install --unsafe-perm
20 | - run: npm run build
21 | - run: mkdir -p build
22 | - run: cp -rp img/* build
23 |
24 | - name: Converts Markdown to HTML
25 | uses: jaywcjlove/markdown-to-html-cli@main
26 | with:
27 | output: build/index.html
28 | github-corners: https://github.com/jaywcjlove/oscnews
29 | favicon: data:image/svg+xml,
30 |
31 | - name: Generate Contributors Images
32 | uses: jaywcjlove/github-action-contributors@main
33 | with:
34 | filter-author: (renovate\[bot\]|renovate-bot|dependabot\[bot\])
35 | output: build/CONTRIBUTORS.svg
36 | avatarSize: 42
37 |
38 | - name: Create Tag
39 | id: create_tag
40 | uses: jaywcjlove/create-tag-action@main
41 | with:
42 | package-path: ./package.json
43 |
44 | - name: get tag version
45 | id: tag_version
46 | uses: jaywcjlove/changelog-generator@main
47 |
48 | - name: Deploy
49 | uses: peaceiris/actions-gh-pages@v3
50 | with:
51 | commit_message: ${{steps.tag_version.outputs.tag}} ${{ github.event.head_commit.message }}
52 | github_token: ${{ secrets.GITHUB_TOKEN }}
53 | publish_dir: ./build
54 |
55 | - name: Look Changelog
56 | id: changelog
57 | uses: jaywcjlove/changelog-generator@main
58 | with:
59 | token: ${{ secrets.GITHUB_TOKEN }}
60 | filter-author: (jaywcjlove|小弟调调™|dependabot\[bot\]|Renovate Bot)
61 | filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'
62 |
63 | - name: Create Release
64 | uses: ncipollo/release-action@v1
65 | if: steps.create_tag.outputs.successful
66 | with:
67 | token: ${{ secrets.GITHUB_TOKEN }}
68 | name: ${{ steps.create_tag.outputs.version }}
69 | tag: ${{ steps.create_tag.outputs.version }}
70 | body: |
71 | [](https://jaywcjlove.github.io/#/sponsor) [Chrome 网上商店](https://chrome.google.com/webstore/detail/oscnews/iheapfheanfjcemgneblljhaebonakbg) 搜索 `oscnews` 安装,或者直接下载 [crx 文件](https://github.com/jaywcjlove/oscnews/releases) 安装,打开 [chrome://extensions](chrome://extensions/) 将 crx 拖拽到扩展列表中安装。
72 |
73 | [](https://chrome.google.com/webstore/detail/oscnews/iheapfheanfjcemgneblljhaebonakbg)
74 |
75 | Documentation ${{ steps.changelog.outputs.tag }}: https://raw.githack.com/jaywcjlove/oscnews/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html
76 | Comparing Changes: ${{ steps.changelog.outputs.compareurl }}
77 |
78 | ${{ steps.changelog.outputs.changelog }}
79 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | oscnews*/
3 | build*
4 | dist*
5 |
6 | .DS_Store
7 | .cache
8 | .rdoc-dist
9 | .vscode
10 |
11 | *.bak
12 | *.tem
13 | *.temp
14 | #.swp
15 | *.*~
16 | ~*.*
17 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "src/dev-site"]
2 | path = src/dev-site
3 | url = https://github.com/jaywcjlove/dev-site.git
4 |
--------------------------------------------------------------------------------
/.kktrc.js:
--------------------------------------------------------------------------------
1 | import { CleanWebpackPlugin } from 'clean-webpack-plugin';
2 | import FileManagerPlugin from 'filemanager-webpack-plugin';
3 | import lessModules from '@kkt/less-modules';
4 |
5 | export default (conf, env, options) => {
6 | conf = lessModules(conf, env, options);
7 | conf.output.publicPath = './';
8 |
9 | const regexp = /(ReactRefreshWebpackPlugin)/;
10 | conf.plugins = conf.plugins.map((item) => {
11 | if (item.constructor && item.constructor.name && regexp.test(item.constructor.name)) {
12 | return null;
13 | }
14 | return item;
15 | }).filter(Boolean);
16 |
17 | conf.plugins.push(new CleanWebpackPlugin({
18 | // cleanStaleWebpackAssets: true
19 | }));
20 |
21 | conf.plugins.push(
22 | new FileManagerPlugin({
23 | events: {
24 | onEnd: {
25 | copy: [
26 | { source: './chrome-main/manifest.json', destination: './dist/manifest.json' },
27 | { source: './chrome-main/background.js', destination: './dist/background.js' },
28 | { source: './chrome-main/osc-logo.png', destination: './dist/osc-logo.png' },
29 | { source: './src/dev-site/public/icons', destination: './dist/icons' },
30 | ],
31 | },
32 | },
33 | }),
34 | );
35 | return conf;
36 | }
37 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
77 | {this.state.menus.map((item, idx) => {
78 | return (
79 | {item.title}
80 | );
81 | })}
82 |
83 | );
84 | }
85 | onClickSwitch(ty, e) {
86 | e.preventDefault();
87 | const { storage, conf } = this.props;
88 | conf[ty] = !conf[ty];
89 | storage.set({ conf });
90 | }
91 | renderSiwtchOption(ty) {
92 | const { conf } = this.props;
93 | let label = '';
94 | if (ty === 'isNewTab') label = '在新标签页显示';
95 | if (ty === 'isHideOSC') label = '隐藏新闻';
96 | if (ty === 'isHideNav') label = '显示导航';
97 | return (
98 |