Skip to content

Commit f9b5fa0

Browse files
authored
refactor: migrate options of popup page (#591)
1 parent a203d06 commit f9b5fa0

File tree

24 files changed

+139
-214
lines changed

24 files changed

+139
-214
lines changed

src/i18n/message/app/option-resource.json

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
"yes": "",
44
"no": "",
55
"followBrowser": "跟随浏览器",
6-
"popup": {
7-
"title": "弹窗页",
8-
"max": "只显示前 {input} 条数据,剩下的条目合并显示",
9-
"displaySiteName": "{input} 显示时是否使用网站名称来代替域名"
10-
},
116
"appearance": {
127
"title": "外观",
138
"displayWhitelist": "{input} 是否在 {contextMenu} 里,显示 {whitelist} 相关功能",
@@ -138,11 +133,6 @@
138133
"yes": "",
139134
"no": "",
140135
"followBrowser": "跟隨瀏覽器",
141-
"popup": {
142-
"title": "彈出視窗",
143-
"max": "僅顯示前 {input} 筆資料,其餘項目合併",
144-
"displaySiteName": "{input} 顯示時是否使用網站名稱而非域名"
145-
},
146136
"appearance": {
147137
"title": "外觀設定",
148138
"displayWhitelist": "{input} 是否在 {contextMenu} 顯示 {whitelist} 功能",
@@ -272,11 +262,6 @@
272262
"yes": "Yes",
273263
"no": "No",
274264
"followBrowser": "Follow browser",
275-
"popup": {
276-
"title": "Popup Page",
277-
"max": "Show the first {input} data items",
278-
"displaySiteName": "{input} Whether to display the website name instead of URL"
279-
},
280265
"appearance": {
281266
"title": "Appearance",
282267
"displayWhitelist": "{input} Whether to display {whitelist} in {contextMenu}",
@@ -407,11 +392,6 @@
407392
"yes": "はい",
408393
"no": "いいえ",
409394
"followBrowser": "ブラウザと同じ",
410-
"popup": {
411-
"title": "ポップアップページ",
412-
"max": "最初の {input} 個のデータのみを表示し、残りのエントリは結合されます",
413-
"displaySiteName": "{input} ドメインの代わりにウェブサイト名を表示するかどうか"
414-
},
415395
"appearance": {
416396
"title": "外観",
417397
"displayWhitelist": "{input} {contextMenu} に {whitelist} を表示するかどうか",
@@ -538,11 +518,6 @@
538518
"yes": "Sim",
539519
"no": "Não",
540520
"followBrowser": "Usar do navegador",
541-
"popup": {
542-
"title": "Página Pop-up",
543-
"max": "Mostrar os primeiros {input} itens",
544-
"displaySiteName": "{input} Se deve apresentar o nome do site em vez do domínio"
545-
},
546521
"appearance": {
547522
"title": "Aparência",
548523
"displayWhitelist": "{input} Mostrar {whitelist} no {contextMenu}",
@@ -662,11 +637,6 @@
662637
"yes": "Так",
663638
"no": "Ні",
664639
"followBrowser": "Як у браузері",
665-
"popup": {
666-
"title": "Вікно розширення",
667-
"max": "Кількість записів для показу: {input}",
668-
"displaySiteName": "{input} Чи відображати назву веб-сайту замість домену"
669-
},
670640
"appearance": {
671641
"title": "Зовнішній вигляд",
672642
"displayWhitelist": "{input} Показувати {whitelist} в {contextMenu}",
@@ -796,11 +766,6 @@
796766
"yes": "",
797767
"no": "No",
798768
"followBrowser": "Igual que el navegador",
799-
"popup": {
800-
"title": "Página emergente",
801-
"max": "Mostrar los primeros {input} elementos de datos",
802-
"displaySiteName": "{input} Si se debe mostrar el nombre del sitio web en lugar del dominio"
803-
},
804769
"appearance": {
805770
"title": "Apariencia",
806771
"displayWhitelist": "{input} Mostrar {whitelist} en {contextMenu}",
@@ -930,11 +895,6 @@
930895
"yes": "Ja",
931896
"no": "Nein",
932897
"followBrowser": "Browser verfolgen",
933-
"popup": {
934-
"title": "Popup-Seite",
935-
"max": "Zeige die ersten {input} Datenelemente",
936-
"displaySiteName": "{input} Ob der Websitename anstelle der Domäne angezeigt werden soll"
937-
},
938898
"appearance": {
939899
"title": "Aussehen",
940900
"displayWhitelist": "{input} {whitelist} in {contextMenu} anzeigen",
@@ -1050,11 +1010,6 @@
10501010
"yes": "Oui",
10511011
"no": "Non",
10521012
"followBrowser": "Suivre le navigateur",
1053-
"popup": {
1054-
"title": "Page pop-up",
1055-
"max": "Afficher les {input} premiers éléments de données",
1056-
"displaySiteName": "{input} S'il faut afficher le nom du site Web au lieu du domaine"
1057-
},
10581013
"appearance": {
10591014
"title": "Apparence",
10601015
"displayWhitelist": "{input} S'il faut afficher là {whitelist} dans {contextMenu}",
@@ -1183,11 +1138,6 @@
11831138
"ru": {
11841139
"yes": "Да",
11851140
"no": "Нет",
1186-
"popup": {
1187-
"title": "Всплывающее окно",
1188-
"max": "Показать первые {input} элементов данных",
1189-
"displaySiteName": "{input} Отображать ли имя веб-сайта вместо домена"
1190-
},
11911141
"appearance": {
11921142
"title": "Появление",
11931143
"displayWhitelist": "{input} Отображать ли {whitelist} в {contextMenu}",
@@ -1231,11 +1181,6 @@
12311181
"yes": "نعم",
12321182
"no": "لا",
12331183
"followBrowser": "نفس وضع المتصفح",
1234-
"popup": {
1235-
"title": "صفحة منبثقة",
1236-
"max": "عرض أول {input} عنصر من البيانات",
1237-
"displaySiteName": "{input} هل سيتم عرض اسم الموقع بدلاً من النطاق"
1238-
},
12391184
"appearance": {
12401185
"title": "المظهر",
12411186
"displayWhitelist": "{input} هل يتم عرض {whitelist} في {contextMenu}",

src/i18n/message/app/option.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ export type OptionMessage = {
1010
yes: string
1111
no: string
1212
followBrowser: string
13-
popup: {
14-
title: string
15-
max: string
16-
displaySiteName: string
17-
}
1813
appearance: {
1914
title: string
2015
// whitelist

src/i18n/message/common/base-resource.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"sidebar": "Sidebar",
44
"allFunction": "All Features",
55
"guidePage": "User Guide",
6-
"option": "Settings",
6+
"option": "Options",
77
"sourceCode": "Source Code",
88
"changeLog": "Release Notes"
99
},

src/i18n/message/popup/content.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
* https://opensource.org/licenses/MIT
66
*/
77

8+
import type { PopupDuration } from '@popup/context'
89
import resource from './content-resource.json'
910

1011
export type ContentMessage = {
1112
percentage: {
12-
title: { [key in timer.option.PopupDuration]: string }
13+
title: { [key in PopupDuration]: string }
1314
saveAsImageTitle: string
1415
averageTime: string
1516
averageCount: string

src/i18n/message/popup/header-resource.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33
"updateVersion": "Update",
44
"updateVersionInfo": "Latest version: {version}",
55
"updateVersionInfo4Firefox": "Please update to {version} via about:addons",
6-
"rate": "Rate Us"
6+
"rate": "Rate Us",
7+
"showSiteName": "Display site name",
8+
"showTopN": "Display top {n}"
79
},
810
"zh_CN": {
911
"updateVersion": "可更新",
1012
"updateVersionInfo": "最新版本:{version}",
1113
"updateVersionInfo4Firefox": "请前往 about:addons 更新至 {version}",
12-
"rate": "评分"
14+
"rate": "评分",
15+
"showSiteName": "显示网站名称",
16+
"showTopN": "显示前 {n} 名"
1317
},
1418
"zh_TW": {
1519
"updateVersion": "可更新",

src/i18n/message/popup/header.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ export type HeaderMessage = {
1212
updateVersionInfo: string
1313
updateVersionInfo4Firefox: string
1414
rate: string
15+
showSiteName: string
16+
showTopN: string
1517
}
1618

1719
const headerMessages = resource satisfies Messages<HeaderMessage>

src/pages/app/components/Option/Select.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { useRouter } from "vue-router"
55
import ContentContainer from "../common/ContentContainer"
66
import { CATE_LABELS, changeQuery, type OptionCategory, parseQuery } from "./common"
77

8-
const IGNORED_CATE: OptionCategory[] = ['dailyLimit', 'popup']
8+
const IGNORED_CATE: OptionCategory[] = ['dailyLimit']
99

1010
const _default = defineComponent(() => {
1111
const tab = ref<OptionCategory>(parseQuery() || 'appearance')

src/pages/app/components/Option/common.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import { type I18nKey } from "@app/locale"
99
import { type Router, useRoute } from "vue-router"
1010

11-
export const ALL_CATEGORIES = ["appearance", "statistics", "popup", 'dailyLimit', 'accessibility', 'backup'] as const
11+
export const ALL_CATEGORIES = ["appearance", "statistics", 'dailyLimit', 'accessibility', 'backup'] as const
1212
export type OptionCategory = typeof ALL_CATEGORIES[number]
1313

1414
export type OptionInstance = {
@@ -34,7 +34,6 @@ export function changeQuery(cate: OptionCategory, router: Router) {
3434
export const CATE_LABELS: Record<OptionCategory, I18nKey> = {
3535
appearance: msg => msg.option.appearance.title,
3636
statistics: msg => msg.option.statistics.title,
37-
popup: msg => msg.option.popup.title,
3837
dailyLimit: msg => msg.menu.limit,
3938
accessibility: msg => msg.option.accessibility.title,
4039
backup: msg => msg.option.backup.title,

src/pages/app/components/Option/components/PopupOption.tsx

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/pages/app/components/Option/index.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import AccessibilityOption from "./components/AccessibilityOption"
1313
import AppearanceOption from "./components/AppearanceOption"
1414
import BackupOption from './components/BackupOption'
1515
import LimitOption from './components/LimitOption'
16-
import PopupOption from "./components/PopupOption"
1716
import StatisticsOption from "./components/StatisticsOption"
1817
import Select from "./Select"
1918
import './style.sass'
@@ -23,7 +22,6 @@ const _default = defineComponent(() => {
2322
const paneRefMap: Record<OptionCategory, Ref<OptionInstance | undefined>> = {
2423
appearance: ref(),
2524
statistics: ref(),
26-
popup: ref(),
2725
backup: ref(),
2826
dailyLimit: ref(),
2927
accessibility: ref(),
@@ -34,7 +32,6 @@ const _default = defineComponent(() => {
3432
const slots: Record<OptionCategory, () => JSX.Element> = {
3533
appearance: () => <AppearanceOption ref={paneRefMap.appearance} />,
3634
statistics: () => <StatisticsOption ref={paneRefMap.statistics} />,
37-
popup: () => <PopupOption ref={paneRefMap.popup} />,
3835
dailyLimit: () => <LimitOption ref={paneRefMap.dailyLimit} />,
3936
accessibility: () => <AccessibilityOption ref={paneRefMap.accessibility} />,
4037
backup: () => <BackupOption ref={paneRefMap.backup} />,

0 commit comments

Comments
 (0)