mirror of
https://github.com/yang991178/fluent-reader.git
synced 2025-04-28 08:58:52 +02:00
use modified dependencies
This commit is contained in:
parent
93926536aa
commit
a83479f46f
BIN
dist/icons/fabric-icons-2-63c99abf.woff
vendored
Normal file
BIN
dist/icons/fabric-icons-2-63c99abf.woff
vendored
Normal file
Binary file not shown.
8
dist/styles.css
vendored
8
dist/styles.css
vendored
@ -98,9 +98,15 @@ i.ms-Nav-chevron {
|
|||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
.btn-group .btn.system {
|
.btn-group .btn.system {
|
||||||
position: sticky;
|
position: relative;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
}
|
}
|
||||||
|
nav.hide-btns .btn-group .btn {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
nav.hide-btns .btn-group .btn.system {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
.btn-group .btn:hover {
|
.btn-group .btn:hover {
|
||||||
background-color: #0001;
|
background-color: #0001;
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
"@types/redux-thunk": "^2.1.0",
|
"@types/redux-thunk": "^2.1.0",
|
||||||
"@types/reselect": "^2.2.0",
|
"@types/reselect": "^2.2.0",
|
||||||
"@yang991178/electron-proxy-agent": "^1.2.1",
|
"@yang991178/electron-proxy-agent": "^1.2.1",
|
||||||
|
"@yang991178/rss-parser": "^3.8.1",
|
||||||
"electron": "^8.3.0",
|
"electron": "^8.3.0",
|
||||||
"electron-react-devtools": "^0.5.3",
|
"electron-react-devtools": "^0.5.3",
|
||||||
"electron-window-state": "^5.0.3",
|
"electron-window-state": "^5.0.3",
|
||||||
@ -35,7 +36,6 @@
|
|||||||
"redux-devtools": "^3.5.0",
|
"redux-devtools": "^3.5.0",
|
||||||
"redux-thunk": "^2.3.0",
|
"redux-thunk": "^2.3.0",
|
||||||
"reselect": "^4.0.0",
|
"reselect": "^4.0.0",
|
||||||
"rss-parser": "^3.8.0",
|
|
||||||
"ts-loader": "^7.0.4",
|
"ts-loader": "^7.0.4",
|
||||||
"typescript": "^3.9.2",
|
"typescript": "^3.9.2",
|
||||||
"webpack": "^4.43.0",
|
"webpack": "^4.43.0",
|
||||||
|
@ -23,9 +23,9 @@ export class Menu extends React.Component<MenuProps> {
|
|||||||
{
|
{
|
||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
name: "主页",
|
name: "搜索",
|
||||||
key: "home",
|
key: "search",
|
||||||
icon: "Home",
|
icon: "Search",
|
||||||
url: null
|
url: null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import * as React from "react"
|
import * as React from "react"
|
||||||
import { ipcRenderer } from "electron"
|
import { ipcRenderer, remote } from "electron"
|
||||||
import { Icon } from "@fluentui/react/lib/Icon"
|
import { Icon } from "@fluentui/react/lib/Icon"
|
||||||
import { AppState, MenuStatus } from "../scripts/models/app"
|
import { AppState, MenuStatus } from "../scripts/models/app"
|
||||||
import { NavReduxProps } from "../containers/nav-container"
|
import { NavReduxProps } from "../containers/nav-container"
|
||||||
@ -12,14 +12,46 @@ type NavProps = NavReduxProps & {
|
|||||||
settings: () => void
|
settings: () => void
|
||||||
}
|
}
|
||||||
|
|
||||||
class Nav extends React.Component<NavProps> {
|
type NavState = {
|
||||||
ipcSend(message:string) {
|
maximized: boolean,
|
||||||
ipcRenderer.send(message)
|
window: Electron.BrowserWindow
|
||||||
|
}
|
||||||
|
|
||||||
|
class Nav extends React.Component<NavProps, NavState> {
|
||||||
|
constructor(props) {
|
||||||
|
super(props)
|
||||||
|
let window = remote.getCurrentWindow()
|
||||||
|
window.on("maximize", () => {
|
||||||
|
this.setState({ maximized: true })
|
||||||
|
})
|
||||||
|
window.on("unmaximize", () => {
|
||||||
|
this.setState({ maximized: false })
|
||||||
|
})
|
||||||
|
this.state = {
|
||||||
|
maximized: remote.getCurrentWindow().isMaximized(),
|
||||||
|
window: window
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
minimize = () => {
|
||||||
|
this.state.window.minimize()
|
||||||
|
}
|
||||||
|
maximize = () => {
|
||||||
|
if (this.state.maximized) {
|
||||||
|
this.state.window.unmaximize()
|
||||||
|
} else {
|
||||||
|
this.state.window.maximize()
|
||||||
|
}
|
||||||
|
this.setState({ maximized: !this.state.maximized })
|
||||||
|
}
|
||||||
|
close = () => {
|
||||||
|
this.state.window.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
canFetch = () => this.props.state.sourceInit && this.props.state.feedInit && !this.props.state.fetchingItems
|
canFetch = () => this.props.state.sourceInit && this.props.state.feedInit && !this.props.state.fetchingItems
|
||||||
fetching = () => !this.canFetch() ? " fetching" : ""
|
fetching = () => !this.canFetch() ? " fetching" : ""
|
||||||
menuOn = () => this.props.state.menu == MenuStatus.Open ? " on" : ""
|
menuOn = () => this.props.state.menu == MenuStatus.Open ? " on" : ""
|
||||||
|
hideButtons = () => (this.props.state.menu == MenuStatus.Open || this.props.state.settings.display) ? "hide-btns" : ""
|
||||||
|
|
||||||
fetch = () => {
|
fetch = () => {
|
||||||
if (this.canFetch()) this.props.fetch()
|
if (this.canFetch()) this.props.fetch()
|
||||||
@ -27,7 +59,7 @@ class Nav extends React.Component<NavProps> {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<nav>
|
<nav className={this.hideButtons()}>
|
||||||
<div className="btn-group">
|
<div className="btn-group">
|
||||||
<a className="btn" title="菜单" onClick={this.props.menu}><Icon iconName="GlobalNavButton" /></a>
|
<a className="btn" title="菜单" onClick={this.props.menu}><Icon iconName="GlobalNavButton" /></a>
|
||||||
</div>
|
</div>
|
||||||
@ -41,9 +73,11 @@ class Nav extends React.Component<NavProps> {
|
|||||||
<a className="btn" title="视图"><Icon iconName="View" /></a>
|
<a className="btn" title="视图"><Icon iconName="View" /></a>
|
||||||
<a className="btn" title="选项" onClick={this.props.settings}><Icon iconName="Settings" /></a>
|
<a className="btn" title="选项" onClick={this.props.settings}><Icon iconName="Settings" /></a>
|
||||||
<span className="seperator"></span>
|
<span className="seperator"></span>
|
||||||
<a className={"btn system"+this.menuOn()} title="最小化" onClick={() => this.ipcSend("minimize")} style={{fontSize: 12}}><Icon iconName="Remove" /></a>
|
<a className={"btn system"+this.menuOn()} title="最小化" onClick={this.minimize} style={{fontSize: 12}}><Icon iconName="Remove" /></a>
|
||||||
<a className={"btn system"+this.menuOn()} title="最大化" onClick={() => this.ipcSend("maximize")} style={{fontSize: 10}}><Icon iconName="Checkbox" /></a>
|
<a className={"btn system"+this.menuOn()} title="最大化" onClick={this.maximize}>
|
||||||
<a className={"btn system close"+this.menuOn()} title="关闭" onClick={() => this.ipcSend("close")}><Icon iconName="Cancel" /></a>
|
{this.state.maximized ? <Icon iconName="ChromeRestore" style={{fontSize: 11}} /> :<Icon iconName="Checkbox" style={{fontSize: 10}} />}
|
||||||
|
</a>
|
||||||
|
<a className={"btn system close"+this.menuOn()} title="关闭" onClick={this.close}><Icon iconName="Cancel" /></a>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
)
|
)
|
||||||
|
@ -49,7 +49,7 @@ class ProxyTab extends React.Component {
|
|||||||
</Stack.Item>
|
</Stack.Item>
|
||||||
<Stack.Item>
|
<Stack.Item>
|
||||||
<DefaultButton
|
<DefaultButton
|
||||||
disabled={urlTest(this.state.pacUrl)}
|
disabled={!urlTest(this.state.pacUrl)}
|
||||||
type="sumbit"
|
type="sumbit"
|
||||||
text="设置" />
|
text="设置" />
|
||||||
</Stack.Item>
|
</Stack.Item>
|
||||||
|
@ -10,6 +10,7 @@ function createWindow() {
|
|||||||
})
|
})
|
||||||
// Create the browser window.
|
// Create the browser window.
|
||||||
mainWindow = new BrowserWindow({
|
mainWindow = new BrowserWindow({
|
||||||
|
backgroundColor: "#faf9f8",
|
||||||
x: mainWindowState.x,
|
x: mainWindowState.x,
|
||||||
y: mainWindowState.y,
|
y: mainWindowState.y,
|
||||||
width: mainWindowState.width,
|
width: mainWindowState.width,
|
||||||
@ -40,13 +41,3 @@ app.on('activate', function () {
|
|||||||
createWindow()
|
createWindow()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('minimize', e => mainWindow.minimize())
|
|
||||||
ipcMain.on('maximize', e => {
|
|
||||||
if (mainWindow.isMaximized()) {
|
|
||||||
mainWindow.unmaximize()
|
|
||||||
} else {
|
|
||||||
mainWindow.maximize()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
ipcMain.on('close', e => mainWindow.close())
|
|
@ -2,7 +2,7 @@ import * as db from "../db"
|
|||||||
import { rssParser, domParser, htmlDecode, ActionStatus, AppThunk } from "../utils"
|
import { rssParser, domParser, htmlDecode, ActionStatus, AppThunk } from "../utils"
|
||||||
import { RSSSource } from "./source"
|
import { RSSSource } from "./source"
|
||||||
import { FeedActionTypes, INIT_FEED, LOAD_MORE } from "./feed"
|
import { FeedActionTypes, INIT_FEED, LOAD_MORE } from "./feed"
|
||||||
import Parser = require("rss-parser")
|
import Parser = require("@yang991178/rss-parser")
|
||||||
|
|
||||||
export class RSSItem {
|
export class RSSItem {
|
||||||
id: number
|
id: number
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import Parser = require("rss-parser")
|
import Parser = require("@yang991178/rss-parser")
|
||||||
import * as db from "../db"
|
import * as db from "../db"
|
||||||
import { rssParser, faviconPromise, ActionStatus, AppThunk } from "../utils"
|
import { rssParser, faviconPromise, ActionStatus, AppThunk } from "../utils"
|
||||||
import { RSSItem, fetchItemsSuccess, insertItems } from "./item"
|
import { RSSItem, fetchItemsSuccess, insertItems } from "./item"
|
||||||
|
@ -16,7 +16,7 @@ export type AppThunk<ReturnType = void> = ThunkAction<
|
|||||||
|
|
||||||
export type AppDispatch = ThunkDispatch<RootState, undefined, AnyAction>
|
export type AppDispatch = ThunkDispatch<RootState, undefined, AnyAction>
|
||||||
|
|
||||||
import Parser = require("rss-parser")
|
import Parser = require("@yang991178/rss-parser")
|
||||||
const customFields = {
|
const customFields = {
|
||||||
item: ["thumb", "image", ["content:encoded", "fullContent"]] as Parser.CustomFieldItem[]
|
item: ["thumb", "image", ["content:encoded", "fullContent"]] as Parser.CustomFieldItem[]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user