Browse Source

feat: rebuild menu if advanced mode is changed

Sv443 11 months ago
parent
commit
142588dd8a

+ 8 - 70
assets/translations/README.md

@@ -21,14 +21,14 @@ To submit or edit a translation, please follow [this guide](../../contributing.m
 |   | Locale | Translated keys | Based on |
 | :----: | ------ | --------------- | :------: |
 | ─ | [`en_US`](./en_US.json) | 205 (default locale) |  |
-| ⚠ | [`de_DE`](./de_DE.json) | `203/205` (99%) | ─ |
+| ✅ | [`de_DE`](./de_DE.json) | `205/205` (100%) | ─ |
 | ─ | [`en_UK`](./en_UK.json) | `205/205` (100%) | `en_US` |
-| ⚠ | [`es_ES`](./es_ES.json) | `203/205` (99%) | ─ |
-| ⚠ | [`fr_FR`](./fr_FR.json) | `203/205` (99%) | ─ |
-| ⚠ | [`hi_IN`](./hi_IN.json) | `203/205` (99%) | ─ |
-| ⚠ | [`ja_JA`](./ja_JA.json) | `203/205` (99%) | ─ |
-| ⚠ | [`pt_BR`](./pt_BR.json) | `203/205` (99%) | ─ |
-| ⚠ | [`zh_CN`](./zh_CN.json) | `203/205` (99%) | ─ |
+| ✅ | [`es_ES`](./es_ES.json) | `205/205` (100%) | ─ |
+| ✅ | [`fr_FR`](./fr_FR.json) | `205/205` (100%) | ─ |
+| ✅ | [`hi_IN`](./hi_IN.json) | `205/205` (100%) | ─ |
+| ✅ | [`ja_JA`](./ja_JA.json) | `205/205` (100%) | ─ |
+| ✅ | [`pt_BR`](./pt_BR.json) | `205/205` (100%) | ─ |
+| ✅ | [`zh_CN`](./zh_CN.json) | `205/205` (100%) | ─ |
 
 <sub>
 ✅ - Fully translated
@@ -48,66 +48,4 @@ This means to figure out which keys are untranslated, you will need to manually
 <br>
 
 ### Missing keys:
-
-<details><summary><code>de_DE</code> - 2 missing keys <i>(click to show)</i></summary><br>
-
-| Key | English text |
-| --- | ------------ |
-| `feature_requires_reload` | `Changing this feature requires a page reload` |
-| `feature_desc_thumbnailOverlayIndicatorOpacity` | `Opacity of the indicator in the bottom right corner` |
-
-<br></details>
-
-<details><summary><code>es_ES</code> - 2 missing keys <i>(click to show)</i></summary><br>
-
-| Key | English text |
-| --- | ------------ |
-| `feature_requires_reload` | `Changing this feature requires a page reload` |
-| `feature_desc_thumbnailOverlayIndicatorOpacity` | `Opacity of the indicator in the bottom right corner` |
-
-<br></details>
-
-<details><summary><code>fr_FR</code> - 2 missing keys <i>(click to show)</i></summary><br>
-
-| Key | English text |
-| --- | ------------ |
-| `feature_requires_reload` | `Changing this feature requires a page reload` |
-| `feature_desc_thumbnailOverlayIndicatorOpacity` | `Opacity of the indicator in the bottom right corner` |
-
-<br></details>
-
-<details><summary><code>hi_IN</code> - 2 missing keys <i>(click to show)</i></summary><br>
-
-| Key | English text |
-| --- | ------------ |
-| `feature_requires_reload` | `Changing this feature requires a page reload` |
-| `feature_desc_thumbnailOverlayIndicatorOpacity` | `Opacity of the indicator in the bottom right corner` |
-
-<br></details>
-
-<details><summary><code>ja_JA</code> - 2 missing keys <i>(click to show)</i></summary><br>
-
-| Key | English text |
-| --- | ------------ |
-| `feature_requires_reload` | `Changing this feature requires a page reload` |
-| `feature_desc_thumbnailOverlayIndicatorOpacity` | `Opacity of the indicator in the bottom right corner` |
-
-<br></details>
-
-<details><summary><code>pt_BR</code> - 2 missing keys <i>(click to show)</i></summary><br>
-
-| Key | English text |
-| --- | ------------ |
-| `feature_requires_reload` | `Changing this feature requires a page reload` |
-| `feature_desc_thumbnailOverlayIndicatorOpacity` | `Opacity of the indicator in the bottom right corner` |
-
-<br></details>
-
-<details><summary><code>zh_CN</code> - 2 missing keys <i>(click to show)</i></summary><br>
-
-| Key | English text |
-| --- | ------------ |
-| `feature_requires_reload` | `Changing this feature requires a page reload` |
-| `feature_desc_thumbnailOverlayIndicatorOpacity` | `Opacity of the indicator in the bottom right corner` |
-
-<br></details>
+No missing keys

+ 3 - 1
assets/translations/de_DE.json

@@ -10,6 +10,7 @@
     "reload_hint": "Deine Änderungen wurden gespeichert, aber du musst die Seite neu laden, um sie anzuwenden",
     "reload_now": "Jetzt neu laden",
     "reload_tooltip": "Seite neu laden",
+    "feature_requires_reload": "Die Seite muss neu geladen werden, wenn diese Funktion geändert wird",
     "version_tooltip": "Version %1 (build %2) - klicken um das Änderungsprotokoll zu öffnen",
     "export": "Exportieren",
     "export_hint": "Kopiere den folgenden Text um deine Einstellungen zu exportieren.\nWarnung: der Text kann sensible Informationen enthalten.",
@@ -161,6 +162,7 @@
     "feature_desc_thumbnailOverlayToggleBtnShown": "Füge einen Knopf zu den Mediensteuerelementen hinzu, um das Thumbnail manuell zu aktivieren",
     "feature_helptext_thumbnailOverlayToggleBtnShown": "Dieser Knopf ermöglicht es dir, das Thumbnail manuell ein- und auszuschalten. Dies wird nicht beeinflusst, wenn das Overlay auf \"nie gezeigt\" eingestellt ist.\nSobald ein neues Video oder Lied abgespielt wird, wird der Standardzustand wiederhergestellt.\nHalte Shift gedrückt, während du klickst oder drücke die mittlere Maustaste, um das Thumbnail in höchster Qualität in einem neuen Tab zu öffnen.",
     "feature_desc_thumbnailOverlayShowIndicator": "Zeige einen Indikator in der unteren rechten Ecke des Thumbnails, während es aktiv ist?",
+    "feature_desc_thumbnailOverlayIndicatorOpacity": "Deckkraft des Indikators in der unteren rechten Ecke",
     "feature_desc_thumbnailOverlayImageFit": "Wie das Thumbnail über dem Videoelement angezeigt werden soll",
     "feature_desc_hideCursorOnIdle": "Verstecke den Cursor nach einigen Sekunden Inaktivität über dem Video",
     "feature_desc_hideCursorOnIdleDelay": "Wie viele Sekunden Inaktivität vergehen müssen, bevor der Cursor versteckt wird",
@@ -217,7 +219,7 @@
     "feature_btn_checkVersionNow_running": "Wird geprüft...",
     "feature_desc_logLevel": "Wie viele Informationen sollen in der Konsole geloggt werden?",
     "feature_helptext_logLevel": "Das Ändern dieses Wertes ist wirklich nur für Debugging-Zwecke notwendig, wenn du ein Problem hast.\nSolltest du eines haben, kannst du den Log-Level hier erhöhen, die JavaScript-Konsole deines Browsers (normalerweise mit Strg + Shift + K) öffnen und Screenshots dieses Logs in einem GitHub-Issue hinzufügen.",
-    "feature_desc_advancedMode": "Erweiterte Einstellungen anzeigen (nach dem Neuladen)",
+    "feature_desc_advancedMode": "Erweiterte Einstellungen anzeigen (lädt Menü neu)",
     "feature_helptext_advancedMode": "Zeige erweiterte Einstellungen im Konfigurationsmenü nach dem Neuladen der Seite.\nDas ist nützlich, wenn du das Verhalten des Skripts tiefergehend anpassen möchtest.",
 
     "plugin_validation_error_no_property": "Keine Eigenschaft '%1' vom Typ '%2'"

+ 1 - 1
assets/translations/en_US.json

@@ -219,7 +219,7 @@
     "feature_btn_checkVersionNow_running": "Checking...",
     "feature_desc_logLevel": "How much information to log to the console",
     "feature_helptext_logLevel": "Changing this is really only needed for debugging purposes as a result of experiencing a problem.\nShould you have one, you can increase the log level here, open your browser's JavaScript console (usually with Ctrl + Shift + K) and attach screenshots of that log in a GitHub issue.",
-    "feature_desc_advancedMode": "Show advanced settings (after reload)",
+    "feature_desc_advancedMode": "Show advanced settings (reloads the menu)",
     "feature_helptext_advancedMode": "Show advanced settings in the configuration menu after reloading the page.\nThis is useful if you want to more deeply customize the script's behavior.",
 
     "plugin_validation_error_no_property": "No property '%1' with type '%2'"

+ 3 - 1
assets/translations/es_ES.json

@@ -10,6 +10,7 @@
     "reload_hint": "Tus cambios se guardaron, pero necesitas recargar la página para aplicarlos.",
     "reload_now": "Recargar ahora",
     "reload_tooltip": "Recargar la página",
+    "feature_requires_reload": "Cambiar esta función requiere una recarga de la página",
     "version_tooltip": "Versión %1 (compilación %2) - haga clic para abrir el registro de cambios",
     "export": "Exportar",
     "export_hint": "Copie el siguiente texto para exportar su configuración.\nAdvertencia: puede contener datos sensibles.",
@@ -161,6 +162,7 @@
     "feature_desc_thumbnailOverlayToggleBtnShown": "Agregue un botón a los controles multimedia para mostrar u ocultar manualmente la miniatura",
     "feature_helptext_thumbnailOverlayToggleBtnShown": "Este botón le permitirá alternar manualmente la miniatura.\nEsto no se verá afectado si la superposición está configurada en \"nunca se muestra\".\nUna vez que comienza a reproducirse un nuevo video o canción, el estado predeterminado se restaurará.\nMantenga presionada la tecla Mayús mientras hace clic o presione el botón central del mouse para abrir la miniatura de mayor calidad en una nueva pestaña.",
     "feature_desc_thumbnailOverlayShowIndicator": "Mostrar un indicador en la esquina inferior derecha de la miniatura mientras está activo",
+    "feature_desc_thumbnailOverlayIndicatorOpacity": "Opacidad del indicador en la esquina inferior derecha",
     "feature_desc_thumbnailOverlayImageFit": "Cómo ajustar la imagen de la miniatura sobre el elemento de video",
     "feature_desc_hideCursorOnIdle": "Ocultar el cursor después de unos segundos de inactividad sobre el video",
     "feature_desc_hideCursorOnIdleDelay": "¿Cuántos segundos de inactividad antes de que se oculte el cursor?",
@@ -217,7 +219,7 @@
     "feature_btn_checkVersionNow_running": "Comprobando...",
     "feature_desc_logLevel": "Cuánta información registrar en la consola",
     "feature_helptext_logLevel": "Cambiar esto solo es necesario para fines de depuración como resultado de experimentar un problema.\nSi tiene uno, puede aumentar el nivel de registro aquí, abrir la consola de JavaScript de su navegador (generalmente con Ctrl + Shift + K) y adjuntar capturas de pantalla de ese registro en un problema de GitHub.",
-    "feature_desc_advancedMode": "Mostrar configuración avanzada (después de recargar)",
+    "feature_desc_advancedMode": "Mostrar configuración avanzada (recarga el menú)",
     "feature_helptext_advancedMode": "Muestra la configuración avanzada en el menú de configuración después de recargar la página.\nEsto es útil si desea personalizar más profundamente el comportamiento del script.",
 
     "plugin_validation_error_no_property": "No hay ninguna propiedad '%1' con el tipo '%2'"

+ 3 - 1
assets/translations/fr_FR.json

@@ -10,6 +10,7 @@
     "reload_hint": "Vos modifications ont été enregistrées, mais vous devez recharger la page pour les appliquer",
     "reload_now": "Recharger maintenant",
     "reload_tooltip": "Recharger la page",
+    "feature_requires_reload": "Cette fonctionnalité nécessite un rechargement de la page",
     "version_tooltip": "Version %1 (build %2) - cliquez pour ouvrir l'historique des modifications",
     "export": "Exporter",
     "export_hint": "Copiez le texte suivant pour exporter votre configuration:",
@@ -161,6 +162,7 @@
     "feature_desc_thumbnailOverlayToggleBtnShown": "Ajouter un bouton aux contrôles multimédias pour activer ou désactiver manuellement la vignette",
     "feature_helptext_thumbnailOverlayToggleBtnShown": "Ce bouton vous permettra d'activer ou de désactiver manuellement la vignette. Cela n'est pas affecté si la superposition est définie sur \"jamais affichée\".\nUne fois qu'une nouvelle vidéo ou chanson commence à jouer, l'état par défaut sera restauré.\nMaintenez la touche Maj enfoncée tout en cliquant ou appuyez sur le bouton du milieu de la souris pour ouvrir la vignette de la plus haute qualité dans un nouvel onglet.",
     "feature_desc_thumbnailOverlayShowIndicator": "Afficher un indicateur dans le coin inférieur droit de la vignette lorsqu'elle est active?",
+    "feature_desc_thumbnailOverlayIndicatorOpacity": "Opacité de l'indicateur dans le coin inférieur droit",
     "feature_desc_thumbnailOverlayImageFit": "Comment ajuster l'image de la vignette sur l'élément vidéo",
     "feature_desc_hideCursorOnIdle": "Masquer le curseur après quelques secondes d'inactivité sur la vidéo",
     "feature_desc_hideCursorOnIdleDelay": "Combien de secondes d'inactivité avant que le curseur ne soit masqué?",
@@ -217,7 +219,7 @@
     "feature_btn_checkVersionNow_running": "Vérification...",
     "feature_desc_logLevel": "Combien d'informations à enregistrer dans la console",
     "feature_helptext_logLevel": "Changer cela n'est vraiment nécessaire que pour le débogage à la suite d'un problème rencontré.\nSi vous en avez un, vous pouvez augmenter le niveau de journalisation ici, ouvrir la console JavaScript de votre navigateur (généralement avec Ctrl + Maj + K) et joindre des captures d'écran de ce journal dans un problème GitHub.",
-    "feature_desc_advancedMode": "Afficher les paramètres avancés (après rechargement)",
+    "feature_desc_advancedMode": "Afficher les paramètres avancés (cela recharge le menu)",
     "feature_helptext_advancedMode": "Afficher les paramètres avancés dans le menu de configuration après le rechargement de la page.\nCela est utile si vous souhaitez personnaliser plus en profondeur le comportement du script.",
 
     "plugin_validation_error_no_property": "Aucune propriété '%1' avec le type '%2'"

+ 3 - 1
assets/translations/hi_IN.json

@@ -10,6 +10,7 @@
     "reload_hint": "आपके परिवर्तन सहेजे गए हैं, लेकिन आपको उन्हें लागू करने के लिए पृष्ठ को पुनः लोड करना होगा",
     "reload_now": "अब पुनः लोड करें",
     "reload_tooltip": "पृष्ठ को पुनः लोड करें",
+    "feature_requires_reload": "इस सुविधा को लागू करने के लिए पृष्ठ को पुनः लोड करना होगा",
     "version_tooltip": "संस्करण %1 (बिल्ड %2) - चेंजलॉग खोलने के लिए क्लिक करें",
     "export": "निर्यात",
     "export_hint": "निम्नलिखित पाठ को अपनी कॉन्फ़िगरेशन निर्यात करने के लिए कॉपी करें:",
@@ -161,6 +162,7 @@
     "feature_desc_thumbnailOverlayToggleBtnShown": "थंबनेल ओवरले के ऊपर एक बटन दिखाएं जो इसे त्वरित रूप से बंद करता है",
     "feature_helptext_thumbnailOverlayToggleBtnShown": "यह बटन आपको थंबनेल को मैन्युअल रूप से चालू और बंद करने की अनुमति देगा। यह इस पर प्रभावित नहीं होगा यदि ओवरले को \"कभी नहीं दिखाया\" पर सेट किया गया है।\nएक नया वीडियो या गीत चलने पर, डिफ़ॉल्ट स्थिति पुनः स्थापित हो जाएगी।\nएक नई टैब में उच्चतम गुणवत्ता का थंबनेल खोलने के लिए एक नया टैब खोलने के लिए शिफ्ट दबाएं या मिडल माउस बटन दबाएं।",
     "feature_desc_thumbnailOverlayShowIndicator": "थंबनेल ओवरले के ऊपर एक संकेतक दिखाएं जब यह सक्रिय हो",
+    "feature_desc_thumbnailOverlayIndicatorOpacity": "नीचे दाएं कोने में संकेतक की अस्पष्टता",
     "feature_desc_thumbnailOverlayImageFit": "थंबनेल छवि को वीडियो तत्व पर कैसे फिट करें",
     "feature_desc_hideCursorOnIdle": "वीडियो पर निष्क्रियता के कुछ सेकंड बाद कर्सर छुपाएं",
     "feature_desc_hideCursorOnIdleDelay": "कितने सेकंड निष्क्रियता के बाद कर्सर छुपाना चाहिए?",
@@ -217,7 +219,7 @@
     "feature_btn_checkVersionNow_running": "जांच रहा है...",
     "feature_desc_logLevel": "कंसोल पर कितनी जानकारी लॉग इन करनी है",
     "feature_helptext_logLevel": "इसे बदलने की वास्तव में केवल डिबगिंग के उद्देश्य से आवश्यक है क्योंकि किसी समस्या का सामना करने के परिणामस्वरूप।\nयदि आपके पास एक है, तो आप यहां लॉग स्तर बढ़ा सकते हैं, अपने ब्राउज़र के जावास्क्रिप्ट कंसोल (सामान्यतः Ctrl + Shift + K के साथ) खोल सकते हैं और उस लॉग की स्क्रीनशॉट एक गिटहब समस्या में अटैच कर सकते हैं।",
-    "feature_desc_advancedMode": "उन्नत सेटिंग्स दिखाएँ (पुनः लोड के बाद)",
+    "feature_desc_advancedMode": "उन्नत सेटिंग्स दिखाएं (मेनू को फिर से लोड करता है)",
     "feature_helptext_advancedMode": "यह सुविधा उपयोगी है यदि आप स्क्रिप्ट के व्यवहार को गहराई से अनुकूलित करना चाहते हैं।",
 
     "plugin_validation_error_no_property": "कोई गुण '%1' जिसके पास '%2' प्रकार है नहीं है"

+ 3 - 1
assets/translations/ja_JA.json

@@ -10,6 +10,7 @@
     "reload_hint": "変更は保存されましたが、適用するにはページを再読み込みする必要があります",
     "reload_now": "今すぐ再読み込み",
     "reload_tooltip": "ページを再読み込みする",
+    "feature_requires_reload": "この機能を変更するにはページを再読み込みする必要があります",
     "version_tooltip": "バージョン %1 (ビルド %2) - クリックして更新履歴を開く",
     "export": "エクスポート",
     "export_hint": "次のテキストをコピーして構成をエクスポートします。",
@@ -161,6 +162,7 @@
     "feature_desc_thumbnailOverlayToggleBtnShown": "サムネイルオーバーレイを手動で切り替えるボタンを追加する",
     "feature_helptext_thumbnailOverlayToggleBtnShown": "このボタンを押すと、サムネイルのオンとオフを手動で切り替えることができます\n新しいビデオや曲の再生が始まると、デフォルトの状態に戻ります。シフトを押しながらクリックするか、マウスの中ボタンを押すと、最高画質のサムネイルが新しいタブで開きます。",
     "feature_desc_thumbnailOverlayShowIndicator": "サムネイルがアクティブな間、サムネイルの右下隅にインジケータを表示する",
+    "feature_desc_thumbnailOverlayIndicatorOpacity": "右下隅のインジケータの不透明度",
     "feature_desc_thumbnailOverlayImageFit": "サムネイル画像をビデオ要素に合わせる方法",
     "feature_desc_hideCursorOnIdle": "ビデオの上で数秒間アクティビティがないとカーソルを非表示にする",
     "feature_desc_hideCursorOnIdleDelay": "カーソルを非表示にするまでのアイドル時間(秒)",
@@ -217,7 +219,7 @@
     "feature_btn_checkVersionNow_running": "チェック中...",
     "feature_desc_logLevel": "ログレベル",
     "feature_helptext_logLevel": "これを変更するのは、問題が発生した結果としてデバッグ目的でのみ必要です。\n問題が発生した場合にのみ、ここでログレベルを増やし、ブラウザの JavaScript コンソールを開いて(通常は Ctrl + Shift + K)そのログのスクリーンショットを GitHub の課題に添付してください。",
-    "feature_desc_advancedMode": "詳細設定を表示(再読み込み)",
+    "feature_desc_advancedMode": "詳細設定を表示するメニューを再読み込み)",
     "feature_helptext_advancedMode": "ページを再読み込みした後、構成メニューで詳細設定を表示します。\nこれは、スクリプトの動作をより深くカスタマイズしたい場合に便利です。",
 
     "plugin_validation_error_no_property": "タイプ '%2' のプロパティ '%1' がありません"

+ 3 - 1
assets/translations/pt_BR.json

@@ -10,6 +10,7 @@
     "reload_hint": "Suas alterações foram salvas, mas você precisa recarregar a página para aplicá-las",
     "reload_now": "Recarregar agora",
     "reload_tooltip": "Recarregue a página",
+    "feature_requires_reload": "Alterar este recurso requer uma recarga da página",
     "version_tooltip": "Versão %1 (compilação %2) - clique para abrir o registro de alterações",
     "export": "Exportar",
     "export_hint": "Copie o texto a seguir para exportar sua configuração:",
@@ -161,6 +162,7 @@
     "feature_desc_thumbnailOverlayToggleBtnShown": "Adicione um botão aos controles de mídia para alternar manualmente a miniatura",
     "feature_helptext_thumbnailOverlayToggleBtnShown": "Este botão permitirá que você alterne manualmente a miniatura ligada e desligada. Isso não é afetado se a sobreposição estiver definida como \"nunca mostrada\".\nAssim que um novo vídeo ou música começar a ser reproduzido, o estado padrão será restaurado.\nMantenha pressionada a tecla shift enquanto clica ou pressione o botão do meio do mouse para abrir a miniatura da mais alta qualidade em uma nova guia.",
     "feature_desc_thumbnailOverlayShowIndicator": "Mostrar um indicador na miniatura enquanto ela estiver ativa?",
+    "feature_desc_thumbnailOverlayIndicatorOpacity": "Opacidade do indicador no canto inferior direito",
     "feature_desc_thumbnailOverlayImageFit": "Como ajustar a miniatura sobre o elemento de vídeo",
     "feature_desc_hideCursorOnIdle": "Ocultar o cursor após alguns segundos de inatividade sobre o vídeo",
     "feature_desc_hideCursorOnIdleDelay": "Quantos segundos de inatividade antes de ocultar o cursor?",
@@ -217,7 +219,7 @@
     "feature_btn_checkVersionNow_running": "Verificando...",
     "feature_desc_logLevel": "Quanta informação registrar no console",
     "feature_helptext_logLevel": "Alterar isso é realmente necessário apenas para fins de depuração como resultado de experimentar um problema.\nSe você tiver um, você pode aumentar o nível de log aqui, abrir o console JavaScript do seu navegador (geralmente com Ctrl + Shift + K) e anexar capturas de tela desse log em um problema do GitHub.",
-    "feature_desc_advancedMode": "Mostrar configurações avançadas (após recarregar)",
+    "feature_desc_advancedMode": "Mostrar configurações avançadas (isso recarrega o menu)",
     "feature_helptext_advancedMode": "Mostrar configurações avançadas no menu de configuração após recarregar a página.\nIsso é útil se você quiser personalizar mais profundamente o comportamento do script.",
 
     "plugin_validation_error_no_property": "Nenhuma propriedade '%1' com o tipo '%2'"

+ 3 - 1
assets/translations/zh_CN.json

@@ -10,6 +10,7 @@
     "reload_hint": "您的更改已保存,但您需要重新加载页面才能应用它们",
     "reload_now": "立即重新加载",
     "reload_tooltip": "重新加载页面",
+    "feature_requires_reload": "更改此功能需要重新加载页面",
     "version_tooltip": "版本 %1 (构建 %2) - 点击打开更新日志",
     "export": "导出",
     "export_hint": "复制以下文本以导出您的配置。\n警告:它可能包含敏感数据。",
@@ -161,6 +162,7 @@
     "feature_desc_thumbnailOverlayToggleBtnShown": "在媒体控件中添加一个按钮,以手动切换缩略图",
     "feature_helptext_thumbnailOverlayToggleBtnShown": "这个按钮允许你手动开关缩略图。一旦开始播放新的视频或歌曲,就会恢复默认状态。点击时按住 shift 或按下鼠标中键,可在新标签页中打开最高质量的缩略图。",
     "feature_desc_thumbnailOverlayShowIndicator": "在缩略图上显示一个指示器,表示它是活动的吗?",
+    "feature_desc_thumbnailOverlayIndicatorOpacity": "指示器在右下角的不透明度",
     "feature_desc_thumbnailOverlayImageFit": "如何将缩略图图像适配到视频元素上",
     "feature_desc_hideCursorOnIdle": "在视频上几秒钟不活动后隐藏光标",
     "feature_desc_hideCursorOnIdleDelay": "在几秒钟的不活动后隐藏光标?",
@@ -217,7 +219,7 @@
     "feature_btn_checkVersionNow_running": "正在检查...",
     "feature_desc_logLevel": "更改扩展程序的日志级别",
     "feature_helptext_logLevel": "更改这个只是为了调试目的,因为遇到了问题。\n如果您有一个,您可以在这里增加日志级别,打开您的浏览器的 JavaScript 控制台(通常是 Ctrl + Shift + K)并在 GitHub 问题中附上那个日志的截图。",
-    "feature_desc_advancedMode": "显示高级设置(重新加载)",
+    "feature_desc_advancedMode": "显示高级设置(重新加载菜单)",
     "feature_helptext_advancedMode": "在重新加载页面后,在配置菜单中显示高级设置。\n如果您想更深入地定制脚本的行为,这很有用。",
 
     "plugin_validation_error_no_property": "没有类型为 '%2' 的属性 '%1'"

+ 21 - 17
src/features/index.ts

@@ -6,6 +6,7 @@ import { mode } from "../constants";
 import { getFeatures } from "../config";
 import { FeatureInfo, type ResourceKey, type SiteSelection } from "../types";
 import { volumeSharedBetweenTabsDisabled } from "./volume";
+import { emitSiteEvent } from "src/siteEvents";
 
 export * from "./layout";
 export * from "./behavior";
@@ -79,23 +80,23 @@ const options = {
  * | `enable(value: any)` | (required if reloadRequired = false) - function that will be called when the feature is enabled / initialized for the first time |
  *   
  * **Optional props:**
- * | Property                                          | Description                                                                                                                                              |
- * | :------------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------- |
- * | `disable: (newValue: any) => void`                | for type `toggle` only - function that will be called when the feature is disabled - can be a synchronous or asynchronous function                       |
- * | `change: (prevValue: any, newValue: any)` => void | for types `number`, `select`, `slider` and `hotkey` only - function that will be called when the value is changed                                        |
- * | `click: () => void`                               | for type `button` only - function that will be called when the button is clicked                                                                         |
- * | `helpText: string / () => string`                 | function that returns an HTML string or the literal string itself that will be the help text for this feature - writing as function is useful for pluralizing or inserting values into the translation at runtime - if not set, translation with key `feature_helptext_featureKey` will be used instead, if available |
- * | `textAdornment: () => string / Promise<string>`   | function that returns an HTML string that will be appended to the text in the config menu as an adornment element                                        |
- * | `unit: string / (val: number) => string`          | Only if type is `number` or `slider` - The unit text that is displayed next to the input element, i.e. " px" - a leading space need to be added by hand! |
- * | `min: number`                                     | Only if type is `number` or `slider` - Overwrites the default of the `min` property of the HTML input element                                            |
- * | `max: number`                                     | Only if type is `number` or `slider` - Overwrites the default of the `max` property of the HTML input element                                            |
- * | `step: number`                                    | Only if type is `number` or `slider` - Overwrites the default of the `step` property of the HTML input element                                           |
- * | `options: SelectOption[] / () => SelectOption[]`  | Only if type is `select` - function that returns an array of objects with `value` and `label` properties                                                 |
- * | `reloadRequired: boolean`                         | if true (default), the page needs to be reloaded for the changes to take effect - if false, `enable()` needs to be provided                              |
- * | `advanced: boolean`                               | if true, the feature will only be shown if the advanced mode feature has been turned on                                                                  |
- * | `hidden: boolean`                                 | if true, the feature will not be shown in the settings - default is undefined (false)                                                                    |
- * | `valueHidden: boolean`                            | If true, the value of the feature will be hidden in the settings and via the plugin interface - default is undefined (false)                             |
- * | `normalize: (val: any) => any`                    | Function that will be called to normalize the value before it is saved - useful for trimming strings or other simple operations                          |
+ * | Property                                                       | Description                                                                                                                                              |
+ * | :------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- |
+ * | `disable: (newValue: any) => void`                             | for type `toggle` only - function that will be called when the feature is disabled - can be a synchronous or asynchronous function                       |
+ * | `change: (key: string, prevValue: any, newValue: any)` => void | for types `number`, `select`, `slider` and `hotkey` only - function that will be called when the value is changed                                        |
+ * | `click: () => void`                                            | for type `button` only - function that will be called when the button is clicked                                                                         |
+ * | `helpText: string / () => string`                              | function that returns an HTML string or the literal string itself that will be the help text for this feature - writing as function is useful for pluralizing or inserting values into the translation at runtime - if not set, translation with key `feature_helptext_featureKey` will be used instead, if available |
+ * | `textAdornment: () => string / Promise<string>`                | function that returns an HTML string that will be appended to the text in the config menu as an adornment element                                        |
+ * | `unit: string / (val: number) => string`                       | Only if type is `number` or `slider` - The unit text that is displayed next to the input element, i.e. " px" - a leading space need to be added by hand! |
+ * | `min: number`                                                  | Only if type is `number` or `slider` - Overwrites the default of the `min` property of the HTML input element                                            |
+ * | `max: number`                                                  | Only if type is `number` or `slider` - Overwrites the default of the `max` property of the HTML input element                                            |
+ * | `step: number`                                                 | Only if type is `number` or `slider` - Overwrites the default of the `step` property of the HTML input element                                           |
+ * | `options: SelectOption[] / () => SelectOption[]`               | Only if type is `select` - function that returns an array of objects with `value` and `label` properties                                                 |
+ * | `reloadRequired: boolean`                                      | if true (default), the page needs to be reloaded for the changes to take effect - if false, `enable()` needs to be provided                              |
+ * | `advanced: boolean`                                            | if true, the feature will only be shown if the advanced mode feature has been turned on                                                                  |
+ * | `hidden: boolean`                                              | if true, the feature will not be shown in the settings - default is undefined (false)                                                                    |
+ * | `valueHidden: boolean`                                         | If true, the value of the feature will be hidden in the settings and via the plugin interface - default is undefined (false)                             |
+ * | `normalize: (val: any) => any`                                 | Function that will be called to normalize the value before it is saved - useful for trimming strings or other simple operations                          |
  * 
  * TODO: go through all features and set as many as possible to reloadRequired = false
  */
@@ -533,6 +534,9 @@ export const featInfo = {
     textAdornment: () => getFeatures().advancedMode
       ? combineAdornments([adornments.advanced, adornments.reloadRequired])
       : undefined,
+    change: (_key, prevValue, newValue) =>
+      prevValue !== newValue &&
+        emitSiteEvent("recreateCfgMenu"),
   },
 } as const satisfies FeatureInfo;
 

+ 1 - 0
src/features/layout.ts

@@ -146,6 +146,7 @@ export async function addConfigMenuOptionYTM(container: HTMLElement) {
 
 /** Called whenever the titlebar (masthead) exists on YT to add a BYTM config menu button */
 export async function addConfigMenuOptionYT(container: HTMLElement) {
+  // TODO:
   const btnElem = await createGenericBtn({
     resourceName: "img-logo",
     title: t("open_menu_tooltip", scriptInfo.name),

+ 12 - 1
src/menu/menu_old.ts

@@ -239,7 +239,7 @@ async function addCfgMenu() {
     await setFeatures(featConf);
 
     // @ts-ignore
-    featInfo[key]?.change?.(featConf);
+    featInfo[key]?.change?.(key, initialVal, newVal);
 
     if(requiresReload) {
       footerElem.classList.remove("hidden");
@@ -764,6 +764,17 @@ async function addCfgMenu() {
   document.querySelector("ytmusic-app")?.removeAttribute("inert");
   backgroundElem.style.visibility = "hidden";
   backgroundElem.style.display = "none";
+
+  siteEvents.on("recreateCfgMenu", async () => {
+    const bgElem = document.querySelector("#bytm-cfg-menu-bg");
+    if(!bgElem)
+      return;
+    closeCfgMenu();
+    bgElem.remove();
+    isCfgMenuAdded = false;
+    await addCfgMenu();
+    await openCfgMenu();
+  });
 }
 
 //#region open & close

+ 3 - 0
src/siteEvents.ts

@@ -13,6 +13,8 @@ export interface SiteEventsMap {
   configOptionChanged: <TKey extends keyof FeatureConfig>(key: TKey, oldValue: FeatureConfig[TKey], newValue: FeatureConfig[TKey]) => void;
   /** Emitted whenever the config menu should be rebuilt, like when a config was imported */
   rebuildCfgMenu: (config: FeatureConfig) => void;
+  /** Emitted whenever the config menu should be unmounted and recreated in the DOM */
+  recreateCfgMenu: () => void;
   /** Emitted whenever the config menu is closed */
   cfgMenuClosed: () => void;
   /** Emitted when the welcome menu is closed */
@@ -43,6 +45,7 @@ export const allSiteEvents = [
   "configChanged",
   "configOptionChanged",
   "rebuildCfgMenu",
+  "recreateCfgMenu",
   "cfgMenuClosed",
   "welcomeMenuClosed",
   "hotkeyInputActive",

+ 1 - 1
src/types.ts

@@ -282,7 +282,7 @@ type FeatureFuncProps = (
   }
   | {
     /** Called to update the feature's behavior when the config changes */
-    change?: (feats: FeatureConfig) => void,
+    change?: (key: FeatureKey, initialVal: number | boolean | Record<string, unknown>, newVal: number | boolean | Record<string, unknown>) => void,
   }
 );