Skip to content

Commit d5ab8bf

Browse files
authored
Merge pull request #425 from yang991178/1.1.1
Version 1.1.1
2 parents 8165797 + efb704c commit d5ab8bf

File tree

19 files changed

+608
-28
lines changed

19 files changed

+608
-28
lines changed

dist/article/article.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
html,
44
body {
55
margin: 0;
6-
font-family: "Segoe UI", "Source Han Sans SC Regular", "Microsoft YaHei",
7-
sans-serif;
6+
font-family: "Segoe UI", "Source Han Sans Regular", sans-serif;
87
}
98
body {
109
padding: 12px 96px 32px;

dist/styles/global.css

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,27 @@ body.darwin {
4949
html,
5050
body {
5151
background-color: transparent;
52-
font-family: "Segoe UI", "Source Han Sans SC Regular", "Microsoft YaHei",
53-
sans-serif;
52+
font-family: "Segoe UI", "Source Han Sans Regular", sans-serif;
5453
height: 100%;
5554
overflow: hidden;
5655
margin: 0;
5756
}
57+
body:lang(zh-CN) {
58+
font-family: "Segoe UI", "Source Han Sans SC Regular", "Microsoft YaHei",
59+
sans-serif;
60+
}
61+
body:lang(zh-TW) {
62+
font-family: "Segoe UI", "Source Han Sans TC Regular", "Microsoft JhengHei",
63+
sans-serif;
64+
}
65+
body:lang(ja) {
66+
font-family: "Segoe UI", "Source Han Sans JP Regular", "Yu Gothic UI",
67+
sans-serif;
68+
}
69+
body:lang(ko) {
70+
font-family: "Segoe UI", "Source Han Sans KR Regular", "Malgun Gothic",
71+
sans-serif;
72+
}
5873
body.win32,
5974
body.linux {
6075
background-color: var(--neutralLighterAlt);

electron-builder-mas.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
appId: DevHYLiu.FluentReader
2-
buildVersion: 25
2+
buildVersion: 26
33
productName: Fluent Reader
44
copyright: Copyright © 2020 Haoyuan Liu
55
files:
@@ -29,6 +29,9 @@ mac:
2929
- it
3030
- nl
3131
- ko
32+
- ru
33+
- pt_BR
34+
- pt_PT
3235
minimumSystemVersion: 10.14.0
3336
mas:
3437
entitlements: build/entitlements.mas.plist

electron-builder.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ mac:
2626
- it
2727
- nl
2828
- ko
29+
- ru
30+
- pt_BR
31+
- pt_PT
2932
win:
3033
target:
3134
- nsis
@@ -49,6 +52,9 @@ appx:
4952
- it
5053
- nl
5154
- ko
55+
- ru
56+
- pt-BR
57+
- pt-PT
5258
showNameOnTiles: true
5359
setBuildNumber: true
5460
nsis:

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fluent-reader",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "Modern desktop RSS reader",
55
"main": "./dist/electron.js",
66
"scripts": {

src/components/article.tsx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -328,17 +328,22 @@ class Article extends React.Component<ArticleProps, ArticleState> {
328328
}
329329
loadFull = async () => {
330330
this.setState({ fullContent: "", loaded: false, error: false })
331+
const link = this.props.item.link
331332
try {
332-
const result = await fetch(this.props.item.link)
333+
const result = await fetch(link)
333334
if (!result || !result.ok) throw new Error()
334335
const html = await decodeFetchResponse(result, true)
335-
this.setState({ fullContent: html })
336+
if (link === this.props.item.link) {
337+
this.setState({ fullContent: html })
338+
}
336339
} catch {
337-
this.setState({
338-
loaded: true,
339-
error: true,
340-
errorDescription: "MERCURY_PARSER_FAILURE",
341-
})
340+
if (link === this.props.item.link) {
341+
this.setState({
342+
loaded: true,
343+
error: true,
344+
errorDescription: "MERCURY_PARSER_FAILURE",
345+
})
346+
}
342347
}
343348
}
344349

@@ -467,7 +472,8 @@ class Article extends React.Component<ArticleProps, ArticleState> {
467472
className={this.state.error ? "error" : ""}
468473
key={
469474
this.props.item._id +
470-
(this.state.loadWebpage ? "_" : "")
475+
(this.state.loadWebpage ? "_" : "") +
476+
(this.state.loadFull ? "__" : "")
471477
}
472478
src={
473479
this.state.loadWebpage

src/components/cards/compact-card.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,15 @@ const CompactCard: React.FunctionComponent<Card.Props> = props => (
2323
text={props.item.title}
2424
filter={props.filter}
2525
title
26+
dir={props.source.textDir}
2627
/>
2728
</span>
2829
<span className="snippet">
29-
<Highlights text={props.item.snippet} filter={props.filter} />
30+
<Highlights
31+
text={props.item.snippet}
32+
filter={props.filter}
33+
dir={props.source.textDir}
34+
/>
3035
</span>
3136
</div>
3237
<Time date={props.item.date} />

src/components/cards/default-card.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,19 @@ const DefaultCard: React.FunctionComponent<Card.Props> = props => (
2525
) : null}
2626
<CardInfo source={props.source} item={props.item} />
2727
<h3 className="title">
28-
<Highlights text={props.item.title} filter={props.filter} title />
28+
<Highlights
29+
text={props.item.title}
30+
filter={props.filter}
31+
title
32+
dir={props.source.textDir}
33+
/>
2934
</h3>
3035
<p className={"snippet" + (props.item.thumb ? "" : " show")}>
31-
<Highlights text={props.item.snippet} filter={props.filter} />
36+
<Highlights
37+
text={props.item.snippet}
38+
filter={props.filter}
39+
dir={props.source.textDir}
40+
/>
3241
</p>
3342
</div>
3443
)

src/components/cards/highlights.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import * as React from "react"
22
import { validateRegex } from "../../scripts/utils"
33
import { FeedFilter, FilterType } from "../../scripts/models/feed"
4+
import { SourceTextDirection } from "../../scripts/models/source"
45

56
type HighlightsProps = {
67
text: string
78
filter: FeedFilter
89
title?: boolean
10+
dir?: SourceTextDirection
911
}
1012

1113
const Highlights: React.FunctionComponent<HighlightsProps> = props => {
@@ -57,10 +59,22 @@ const Highlights: React.FunctionComponent<HighlightsProps> = props => {
5759
}
5860
}
5961

62+
const testStyle = {
63+
direction: "inherit",
64+
} as React.CSSProperties
65+
if (props.dir === SourceTextDirection.RTL) {
66+
testStyle.direction = "rtl"
67+
}
6068
return (
6169
<>
6270
{spans.map(([text, flag]) =>
63-
flag ? <span className="h">{text}</span> : text
71+
flag ? (
72+
<div className="h" style={testStyle}>
73+
{text}
74+
</div>
75+
) : (
76+
<div style={testStyle}>{text}</div>
77+
)
6478
)}
6579
</>
6680
)

0 commit comments

Comments
 (0)