Skip to content

Commit 3677278

Browse files
committed
🎨 调整菜单选项 #573
1 parent 0d9ba53 commit 3677278

11 files changed

Lines changed: 19 additions & 60 deletions

File tree

src/app/service/service_worker/popup.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,6 @@ export class PopupService {
9090
}
9191

9292
async registerMenuCommand(message: ScriptMenuRegisterCallbackValue) {
93-
if ((await this.systemConfig.getScriptMenuDisplayType()) === "none") {
94-
// 如果不显示脚本菜单则不处理
95-
return;
96-
}
9793
// 给脚本添加菜单
9894
return this.txUpdateScriptMenu(message.tabId, async (data) => {
9995
const script = data.find((item) => item.uuid === message.uuid);

src/locales/ach-UG/translation.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,6 @@
426426
"badge_type_none": "crwdns8860:0crwdne8860:0",
427427
"badge_type_run_count": "crwdns8862:0crwdne8862:0",
428428
"badge_type_script_count": "crwdns8864:0crwdne8864:0",
429-
"menu_display_none": "crwdns8866:0crwdne8866:0",
430-
"menu_display_no_browser": "crwdns8868:0crwdne8868:0",
431-
"menu_display_all": "crwdns8870:0crwdne8870:0",
432429
"interface_settings": "crwdns8872:0crwdne8872:0",
433430
"select_interface_language": "crwdns8874:0crwdne8874:0",
434431
"extension_icon_badge": "crwdns8876:0crwdne8876:0",
@@ -439,8 +436,8 @@
439436
"text_color": "crwdns8886:0crwdne8886:0",
440437
"badge_text_color_desc": "crwdns8888:0crwdne8888:0",
441438
"script_menu": "crwdns8890:0crwdne8890:0",
442-
"menu_display": "crwdns8892:0crwdne8892:0",
443-
"control_menu_display_position": "crwdns8894:0crwdne8894:0",
439+
"display_right_click_menu": "crwdns8916:0crwdne8916:0",
440+
"display_right_click_menu_desc": "crwdns8918:0crwdne8918:0",
444441
"expand_count": "crwdns8896:0crwdne8896:0",
445442
"auto_collapse_when_exceeds": "crwdns8898:0crwdne8898:0",
446443
"check_frequency": "crwdns8900:0crwdne8900:0",

src/locales/de-DE/translation.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -424,9 +424,6 @@
424424
"badge_type_none": "Nicht anzeigen",
425425
"badge_type_run_count": "Ausführungsanzahl",
426426
"badge_type_script_count": "Skriptanzahl",
427-
"menu_display_none": "Nicht anzeigen",
428-
"menu_display_no_browser": "Nicht im Browser anzeigen",
429-
"menu_display_all": "Alle anzeigen",
430427
"interface_settings": "Benutzeroberfläche",
431428
"select_interface_language": "Sprache der Benutzeroberfläche auswählen",
432429
"extension_icon_badge": "Erweiterungs-Icon-Badge",
@@ -437,8 +434,6 @@
437434
"text_color": "Textfarbe",
438435
"badge_text_color_desc": "Badge-Textfarbe",
439436
"script_menu": "Skriptmenü",
440-
"menu_display": "Menüanzeige",
441-
"control_menu_display_position": "Menüanzeigeposition kontrollieren",
442437
"expand_count": "Erweiterte Anzahl",
443438
"auto_collapse_when_exceeds": "Automatisch einklappen, wenn diese Anzahl überschritten wird",
444439
"check_frequency": "Prüffrequenz",

src/locales/en-US/translation.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,6 @@
426426
"badge_type_none": "None",
427427
"badge_type_run_count": "Run Count",
428428
"badge_type_script_count": "Script Count",
429-
"menu_display_none": "None",
430-
"menu_display_no_browser": "No Browser Display",
431-
"menu_display_all": "Show All",
432429
"interface_settings": "Interface",
433430
"select_interface_language": "Select interface display language",
434431
"extension_icon_badge": "Extension Icon Badge",
@@ -439,8 +436,8 @@
439436
"text_color": "Text Color",
440437
"badge_text_color_desc": "Badge text color",
441438
"script_menu": "Script Menu",
442-
"menu_display": "Menu Display",
443-
"control_menu_display_position": "Control menu display position",
439+
"display_right_click_menu": "Show right-click menu",
440+
"display_right_click_menu_desc": "Show script menu in browser right-click menu",
444441
"expand_count": "Expand Count",
445442
"auto_collapse_when_exceeds": "Auto collapse when exceeds this number",
446443
"check_frequency": "Check Frequency",

src/locales/ja-JP/translation.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,6 @@
426426
"badge_type_none": "表示しない",
427427
"badge_type_run_count": "実行回数",
428428
"badge_type_script_count": "スクリプト数",
429-
"menu_display_none": "表示しない",
430-
"menu_display_no_browser": "ブラウザに表示しない",
431-
"menu_display_all": "すべて表示",
432429
"interface_settings": "インターフェース",
433430
"select_interface_language": "インターフェース表示言語を選択",
434431
"extension_icon_badge": "拡張機能アイコンバッジ",
@@ -439,8 +436,6 @@
439436
"text_color": "テキスト色",
440437
"badge_text_color_desc": "バッジテキスト色",
441438
"script_menu": "スクリプトメニュー",
442-
"menu_display": "メニュー表示",
443-
"control_menu_display_position": "メニュー表示位置を制御",
444439
"expand_count": "展開数",
445440
"auto_collapse_when_exceeds": "この数を超えたときに自動的に折りたたむ",
446441
"check_frequency": "チェック頻度",

src/locales/ru-RU/translation.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,6 @@
426426
"badge_type_none": "Не отображать",
427427
"badge_type_run_count": "Количество запусков",
428428
"badge_type_script_count": "Количество скриптов",
429-
"menu_display_none": "Не отображать",
430-
"menu_display_no_browser": "Не отображать в браузере",
431-
"menu_display_all": "Отображать все",
432429
"interface_settings": "Интерфейс",
433430
"select_interface_language": "Выберите язык интерфейса",
434431
"extension_icon_badge": "Значок на иконке расширения",
@@ -439,8 +436,6 @@
439436
"text_color": "Цвет текста",
440437
"badge_text_color_desc": "Цвет текста значка",
441438
"script_menu": "Меню скрипта",
442-
"menu_display": "Отображение меню",
443-
"control_menu_display_position": "Управление позицией отображения меню",
444439
"expand_count": "Количество развернутых",
445440
"auto_collapse_when_exceeds": "Автоматически сворачивать при превышении этого количества",
446441
"check_frequency": "Частота проверки",

src/locales/vi-VN/translation.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,6 @@
366366
"badge_type_none": "Không hiển thị",
367367
"badge_type_run_count": "Số lần chạy",
368368
"badge_type_script_count": "Số lượng script",
369-
"menu_display_none": "Không hiển thị",
370-
"menu_display_no_browser": "Không hiển thị trong trình duyệt",
371-
"menu_display_all": "Hiển thị tất cả",
372369
"interface_settings": "Giao diện",
373370
"select_interface_language": "Chọn ngôn ngữ hiển thị giao diện",
374371
"extension_icon_badge": "Huy hiệu biểu tượng tiện ích",
@@ -379,8 +376,6 @@
379376
"text_color": "Màu chữ",
380377
"badge_text_color_desc": "Màu chữ huy hiệu",
381378
"script_menu": "Menu script",
382-
"menu_display": "Hiển thị menu",
383-
"control_menu_display_position": "Kiểm soát vị trí hiển thị menu",
384379
"expand_count": "Số lượng mở rộng",
385380
"auto_collapse_when_exceeds": "Tự động thu gọn khi vượt quá số lượng này",
386381
"check_frequency": "Tần suất kiểm tra",

src/locales/zh-CN/translation.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,6 @@
426426
"badge_type_none": "不显示",
427427
"badge_type_run_count": "运行次数",
428428
"badge_type_script_count": "脚本个数",
429-
"menu_display_none": "不显示",
430-
"menu_display_no_browser": "不在浏览器中显示",
431-
"menu_display_all": "全部显示",
432429
"interface_settings": "界面",
433430
"select_interface_language": "选择界面显示语言",
434431
"extension_icon_badge": "扩展图标徽标",
@@ -439,8 +436,8 @@
439436
"text_color": "文字颜色",
440437
"badge_text_color_desc": "徽标文字色",
441438
"script_menu": "脚本菜单",
442-
"menu_display": "菜单显示",
443-
"control_menu_display_position": "控制菜单显示位置",
439+
"display_right_click_menu": "显示右键菜单",
440+
"display_right_click_menu_desc": "在浏览器右键菜单中显示脚本菜单",
444441
"expand_count": "展开数量",
445442
"auto_collapse_when_exceeds": "超过此数量时自动折叠",
446443
"check_frequency": "检查频率",

src/locales/zh-TW/translation.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,6 @@
426426
"badge_type_none": "不顯示",
427427
"badge_type_run_count": "執行次數",
428428
"badge_type_script_count": "腳本個數",
429-
"menu_display_none": "不顯示",
430-
"menu_display_no_browser": "不在瀏覽器中顯示",
431-
"menu_display_all": "全部顯示",
432429
"interface_settings": "介面",
433430
"select_interface_language": "選擇介面顯示語言",
434431
"extension_icon_badge": "擴充功能圖示徽章",
@@ -439,8 +436,6 @@
439436
"text_color": "文字顏色",
440437
"badge_text_color_desc": "徽章文字色",
441438
"script_menu": "腳本選單",
442-
"menu_display": "選單顯示",
443-
"control_menu_display_position": "控制選單顯示位置",
444439
"expand_count": "展開數量",
445440
"auto_collapse_when_exceeds": "超過此數量時自動摺疊",
446441
"check_frequency": "檢查頻率",

src/pages/options/routes/Setting.tsx

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function Setting() {
3333
const [badgeNumberType, setBadgeNumberType] = useState<"none" | "run_count" | "script_count">("run_count");
3434
const [badgeBackgroundColor, setBadgeBackgroundColor] = useState("#4e5969");
3535
const [badgeTextColor, setBadgeTextColor] = useState("#ffffff");
36-
const [scriptMenuDisplayType, setScriptMenuDisplayType] = useState<"none" | "no_browser" | "all">("all");
36+
const [scriptMenuDisplayType, setScriptMenuDisplayType] = useState<"no_browser" | "all">("all");
3737
const languageList: { key: string; title: string }[] = [];
3838
const { t } = useTranslation();
3939
Object.keys(i18n.store.data).forEach((key) => {
@@ -203,21 +203,18 @@ function Setting() {
203203
<Space direction="vertical" size={12} className={"w-full"}>
204204
<div className="flex items-center justify-between min-h-9">
205205
<div className="flex items-center gap-4 flex-1">
206-
<span className="min-w-20">{t("menu_display")}</span>
207-
<Select
208-
value={scriptMenuDisplayType}
209-
className="w-45 max-w-55"
210-
onChange={(value) => {
211-
setScriptMenuDisplayType(value);
212-
systemConfig.setScriptMenuDisplayType(value);
206+
<Checkbox
207+
checked={scriptMenuDisplayType === "all"}
208+
onChange={(e) => {
209+
const checked = e;
210+
setScriptMenuDisplayType(checked ? "all" : "no_browser");
211+
systemConfig.setScriptMenuDisplayType(checked ? "all" : "no_browser");
213212
}}
214213
>
215-
<Select.Option value="none">{t("menu_display_none")}</Select.Option>
216-
<Select.Option value="no_browser">{t("menu_display_no_browser")}</Select.Option>
217-
<Select.Option value="all">{t("menu_display_all")}</Select.Option>
218-
</Select>
214+
{t("display_right_click_menu")}
215+
</Checkbox>
219216
</div>
220-
<span className="text-xs ml-6 flex-shrink-0">{t("control_menu_display_position")}</span>
217+
<span className="text-xs ml-6 flex-shrink-0">{t("display_right_click_menu_desc")}</span>
221218
</div>
222219
<div className="flex items-center justify-between min-h-9">
223220
<div className="flex items-center gap-4 flex-1">

0 commit comments

Comments
 (0)