Explorar o código

fix: remove old reset button

Sv443 hai 11 meses
pai
achega
80e15ec24a

+ 37 - 16
assets/translations/README.md

@@ -16,15 +16,15 @@ To submit or edit a translation, please follow [this guide](../../contributing.m
 ### Translation progress:
 |   | Locale | Translated keys | Based on |
 | :----: | ------ | --------------- | :------: |
-| ─ | [`en_US`](./en_US.json) | 240 (default locale) |  |
-| ‼️ | [`de_DE`](./de_DE.json) | `214/240` (89.2%) | ─ |
-| ─ | [`en_UK`](./en_UK.json) | `240/240` (100%) | `en_US` |
-| ‼️ | [`es_ES`](./es_ES.json) | `214/240` (89.2%) | ─ |
-| ‼️ | [`fr_FR`](./fr_FR.json) | `214/240` (89.2%) | ─ |
-| ‼️ | [`hi_IN`](./hi_IN.json) | `214/240` (89.2%) | ─ |
-| ‼️ | [`ja_JA`](./ja_JA.json) | `214/240` (89.2%) | ─ |
-| ‼️ | [`pt_BR`](./pt_BR.json) | `214/240` (89.2%) | ─ |
-| ‼️ | [`zh_CN`](./zh_CN.json) | `214/240` (89.2%) | ─ |
+| ─ | [`en_US`](./en_US.json) | 242 (default locale) |  |
+| ‼️ | [`de_DE`](./de_DE.json) | `213/242` (88%) | ─ |
+| ─ | [`en_UK`](./en_UK.json) | `242/242` (100%) | `en_US` |
+| ‼️ | [`es_ES`](./es_ES.json) | `213/242` (88%) | ─ |
+| ‼️ | [`fr_FR`](./fr_FR.json) | `213/242` (88%) | ─ |
+| ‼️ | [`hi_IN`](./hi_IN.json) | `213/242` (88%) | ─ |
+| ‼️ | [`ja_JA`](./ja_JA.json) | `213/242` (88%) | ─ |
+| ‼️ | [`pt_BR`](./pt_BR.json) | `213/242` (88%) | ─ |
+| ‼️ | [`zh_CN`](./zh_CN.json) | `213/242` (88%) | ─ |
 
 <sub>
 ✅ - Fully translated
@@ -45,7 +45,7 @@ This means to figure out which keys are untranslated, you will need to manually
 
 ### Missing keys:
 
-<details><summary><code>de_DE</code> - 26 missing keys <i>(click to show)</i></summary><br>
+<details><summary><code>de_DE</code> - 29 missing keys <i>(click to show)</i></summary><br>
 
 | Key | English text |
 | --- | ------------ |
@@ -73,12 +73,15 @@ This means to figure out which keys are untranslated, you will need to manually
 | `feature_btn_autoLikeOpenMgmtDialog_running` | `Opening...` |
 | `feature_desc_initTimeout` | `How long to wait for features to initialize before considering them to likely be in an errored state` |
 | `feature_helptext_initTimeout` | `This is the amount of time in milliseconds that the script will wait for features to initialize before considering them to likely be in an errored state.\nThis will not affect the script's behavior in a significant way, but if one of your plugins can't initialize in time, you should try increasing this value.` |
+| `feature_desc_resetConfig` | `Reset all settings to their default values` |
+| `feature_btn_resetConfig` | `Reset settings` |
+| `feature_btn_resetConfig_running` | `Confirming...` |
 | `plugin_validation_error_invalid_property-1` | `Property '%1' with value '%2' is invalid. Example value: %3` |
 | `plugin_validation_error_invalid_property-n` | `Property '%1' with value '%2' is invalid. Example values: %3` |
 
 <br></details>
 
-<details><summary><code>es_ES</code> - 26 missing keys <i>(click to show)</i></summary><br>
+<details><summary><code>es_ES</code> - 29 missing keys <i>(click to show)</i></summary><br>
 
 | Key | English text |
 | --- | ------------ |
@@ -106,12 +109,15 @@ This means to figure out which keys are untranslated, you will need to manually
 | `feature_btn_autoLikeOpenMgmtDialog_running` | `Opening...` |
 | `feature_desc_initTimeout` | `How long to wait for features to initialize before considering them to likely be in an errored state` |
 | `feature_helptext_initTimeout` | `This is the amount of time in milliseconds that the script will wait for features to initialize before considering them to likely be in an errored state.\nThis will not affect the script's behavior in a significant way, but if one of your plugins can't initialize in time, you should try increasing this value.` |
+| `feature_desc_resetConfig` | `Reset all settings to their default values` |
+| `feature_btn_resetConfig` | `Reset settings` |
+| `feature_btn_resetConfig_running` | `Confirming...` |
 | `plugin_validation_error_invalid_property-1` | `Property '%1' with value '%2' is invalid. Example value: %3` |
 | `plugin_validation_error_invalid_property-n` | `Property '%1' with value '%2' is invalid. Example values: %3` |
 
 <br></details>
 
-<details><summary><code>fr_FR</code> - 26 missing keys <i>(click to show)</i></summary><br>
+<details><summary><code>fr_FR</code> - 29 missing keys <i>(click to show)</i></summary><br>
 
 | Key | English text |
 | --- | ------------ |
@@ -139,12 +145,15 @@ This means to figure out which keys are untranslated, you will need to manually
 | `feature_btn_autoLikeOpenMgmtDialog_running` | `Opening...` |
 | `feature_desc_initTimeout` | `How long to wait for features to initialize before considering them to likely be in an errored state` |
 | `feature_helptext_initTimeout` | `This is the amount of time in milliseconds that the script will wait for features to initialize before considering them to likely be in an errored state.\nThis will not affect the script's behavior in a significant way, but if one of your plugins can't initialize in time, you should try increasing this value.` |
+| `feature_desc_resetConfig` | `Reset all settings to their default values` |
+| `feature_btn_resetConfig` | `Reset settings` |
+| `feature_btn_resetConfig_running` | `Confirming...` |
 | `plugin_validation_error_invalid_property-1` | `Property '%1' with value '%2' is invalid. Example value: %3` |
 | `plugin_validation_error_invalid_property-n` | `Property '%1' with value '%2' is invalid. Example values: %3` |
 
 <br></details>
 
-<details><summary><code>hi_IN</code> - 26 missing keys <i>(click to show)</i></summary><br>
+<details><summary><code>hi_IN</code> - 29 missing keys <i>(click to show)</i></summary><br>
 
 | Key | English text |
 | --- | ------------ |
@@ -172,12 +181,15 @@ This means to figure out which keys are untranslated, you will need to manually
 | `feature_btn_autoLikeOpenMgmtDialog_running` | `Opening...` |
 | `feature_desc_initTimeout` | `How long to wait for features to initialize before considering them to likely be in an errored state` |
 | `feature_helptext_initTimeout` | `This is the amount of time in milliseconds that the script will wait for features to initialize before considering them to likely be in an errored state.\nThis will not affect the script's behavior in a significant way, but if one of your plugins can't initialize in time, you should try increasing this value.` |
+| `feature_desc_resetConfig` | `Reset all settings to their default values` |
+| `feature_btn_resetConfig` | `Reset settings` |
+| `feature_btn_resetConfig_running` | `Confirming...` |
 | `plugin_validation_error_invalid_property-1` | `Property '%1' with value '%2' is invalid. Example value: %3` |
 | `plugin_validation_error_invalid_property-n` | `Property '%1' with value '%2' is invalid. Example values: %3` |
 
 <br></details>
 
-<details><summary><code>ja_JA</code> - 26 missing keys <i>(click to show)</i></summary><br>
+<details><summary><code>ja_JA</code> - 29 missing keys <i>(click to show)</i></summary><br>
 
 | Key | English text |
 | --- | ------------ |
@@ -205,12 +217,15 @@ This means to figure out which keys are untranslated, you will need to manually
 | `feature_btn_autoLikeOpenMgmtDialog_running` | `Opening...` |
 | `feature_desc_initTimeout` | `How long to wait for features to initialize before considering them to likely be in an errored state` |
 | `feature_helptext_initTimeout` | `This is the amount of time in milliseconds that the script will wait for features to initialize before considering them to likely be in an errored state.\nThis will not affect the script's behavior in a significant way, but if one of your plugins can't initialize in time, you should try increasing this value.` |
+| `feature_desc_resetConfig` | `Reset all settings to their default values` |
+| `feature_btn_resetConfig` | `Reset settings` |
+| `feature_btn_resetConfig_running` | `Confirming...` |
 | `plugin_validation_error_invalid_property-1` | `Property '%1' with value '%2' is invalid. Example value: %3` |
 | `plugin_validation_error_invalid_property-n` | `Property '%1' with value '%2' is invalid. Example values: %3` |
 
 <br></details>
 
-<details><summary><code>pt_BR</code> - 26 missing keys <i>(click to show)</i></summary><br>
+<details><summary><code>pt_BR</code> - 29 missing keys <i>(click to show)</i></summary><br>
 
 | Key | English text |
 | --- | ------------ |
@@ -238,12 +253,15 @@ This means to figure out which keys are untranslated, you will need to manually
 | `feature_btn_autoLikeOpenMgmtDialog_running` | `Opening...` |
 | `feature_desc_initTimeout` | `How long to wait for features to initialize before considering them to likely be in an errored state` |
 | `feature_helptext_initTimeout` | `This is the amount of time in milliseconds that the script will wait for features to initialize before considering them to likely be in an errored state.\nThis will not affect the script's behavior in a significant way, but if one of your plugins can't initialize in time, you should try increasing this value.` |
+| `feature_desc_resetConfig` | `Reset all settings to their default values` |
+| `feature_btn_resetConfig` | `Reset settings` |
+| `feature_btn_resetConfig_running` | `Confirming...` |
 | `plugin_validation_error_invalid_property-1` | `Property '%1' with value '%2' is invalid. Example value: %3` |
 | `plugin_validation_error_invalid_property-n` | `Property '%1' with value '%2' is invalid. Example values: %3` |
 
 <br></details>
 
-<details><summary><code>zh_CN</code> - 26 missing keys <i>(click to show)</i></summary><br>
+<details><summary><code>zh_CN</code> - 29 missing keys <i>(click to show)</i></summary><br>
 
 | Key | English text |
 | --- | ------------ |
@@ -271,6 +289,9 @@ This means to figure out which keys are untranslated, you will need to manually
 | `feature_btn_autoLikeOpenMgmtDialog_running` | `Opening...` |
 | `feature_desc_initTimeout` | `How long to wait for features to initialize before considering them to likely be in an errored state` |
 | `feature_helptext_initTimeout` | `This is the amount of time in milliseconds that the script will wait for features to initialize before considering them to likely be in an errored state.\nThis will not affect the script's behavior in a significant way, but if one of your plugins can't initialize in time, you should try increasing this value.` |
+| `feature_desc_resetConfig` | `Reset all settings to their default values` |
+| `feature_btn_resetConfig` | `Reset settings` |
+| `feature_btn_resetConfig_running` | `Confirming...` |
 | `plugin_validation_error_invalid_property-1` | `Property '%1' with value '%2' is invalid. Example value: %3` |
 | `plugin_validation_error_invalid_property-n` | `Property '%1' with value '%2' is invalid. Example values: %3` |
 

+ 0 - 1
assets/translations/de_DE.json

@@ -25,7 +25,6 @@
     "import_error_no_data": "Das importierte Objekt enthält keine Daten",
     "import_error_wrong_format_version": "Die importierten Daten haben eine nicht unterstützte Format-Version (%1 oder niedriger erwartet, aber %2 erhalten)",
     "import_success_confirm_reload": "Die Einstellungen wurde erfolgreich importiert.\nMöchtest du die Seite jetzt neu laden, um die Änderungen zu übernehmen?",
-    "reset_config_tooltip": "Alle Einstellungen auf ihre Standardwerte zurücksetzen",
     "reset_config_confirm": "Möchtest du wirklich alle Einstellungen auf ihre Standardwerte zurücksetzen?\nDie Seite wird automatisch neu geladen.",
     "copy_to_clipboard": "In die Zwischenablage kopieren",
     "copy_to_clipboard_error": "Der Text konnte nicht in die Zwischenablage kopiert werden. Bitte kopiere ihn hier manuell:\n%1",

+ 3 - 1
assets/translations/en_US.json

@@ -25,7 +25,6 @@
     "import_error_no_data": "The imported object does not contain any data",
     "import_error_wrong_format_version": "The imported data is in an unsupported format version (expected %1 or lower but got %2)",
     "import_success_confirm_reload": "Successfully imported the configuration.\nDo you want to reload the page now to apply changes?",
-    "reset_config_tooltip": "Reset all settings to their default values",
     "reset_config_confirm": "Do you really want to reset all settings to their default values?\nThe page will be automatically reloaded.",
     "copy_to_clipboard": "Copy to clipboard",
     "copy_to_clipboard_error": "Couldn't copy the text to the clipboard. Please copy it from here manually:\n%1",
@@ -253,6 +252,9 @@
     "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_initTimeout": "How long to wait for features to initialize before considering them to likely be in an errored state",
     "feature_helptext_initTimeout": "This is the amount of time in milliseconds that the script will wait for features to initialize before considering them to likely be in an errored state.\nThis will not affect the script's behavior in a significant way, but if one of your plugins can't initialize in time, you should try increasing this value.",
+    "feature_desc_resetConfig": "Reset all settings to their default values",
+    "feature_btn_resetConfig": "Reset settings",
+    "feature_btn_resetConfig_running": "Confirming...",
     "feature_desc_advancedMode": "Show advanced settings (reloads the menu)",
     "feature_helptext_advancedMode": "After enabling this, the menu will reload and show advanced settings that are hidden by default.\nThis is useful if you want to more deeply customize the script's behavior and don't care about an overcrowded menu.",
 

+ 0 - 1
assets/translations/es_ES.json

@@ -25,7 +25,6 @@
     "import_error_no_data": "El objeto importado no contiene ningún dato",
     "import_error_wrong_format_version": "Los datos importados están en una versión de formato no compatible (se esperaba %1 o inferior pero se obtuvo %2)",
     "import_success_confirm_reload": "Configuración importada con éxito.\n¿Quieres recargar la página ahora para aplicar los cambios?",
-    "reset_config_tooltip": "Restablecer todos los ajustes a sus valores predeterminados",
     "reset_config_confirm": "¿Realmente quieres restablecer todos los ajustes a sus valores predeterminados?\nLa página se volverá a cargar automáticamente.",
     "copy_to_clipboard": "Copiar al portapapeles",
     "copy_to_clipboard_error": "No se pudo copiar el texto al portapapeles. Cópielo manualmente desde aquí:\n%1",

+ 0 - 1
assets/translations/fr_FR.json

@@ -25,7 +25,6 @@
     "import_error_no_data": "L'objet importé ne contient aucune donnée",
     "import_error_wrong_format_version": "Les données importées sont dans une version de format non prise en charge (attendue %1 ou inférieure mais obtenue %2)",
     "import_success_confirm_reload": "La configuration a été importée avec succès.\nVoulez-vous recharger la page maintenant pour appliquer les modifications?",
-    "reset_config_tooltip": "Réinitialiser tous les paramètres à leurs valeurs par défaut",
     "reset_config_confirm": "Voulez-vous vraiment réinitialiser tous les paramètres à leurs valeurs par défaut?\nLa page sera automatiquement rechargée.",
     "copy_to_clipboard": "Copier dans le presse-papiers",
     "copy_to_clipboard_error": "Impossible de copier le texte dans le presse-papiers. Veuillez le copier manuellement d'ici:\n%1",

+ 0 - 1
assets/translations/hi_IN.json

@@ -25,7 +25,6 @@
     "import_error_no_data": "आयात किया गया ऑब्जेक्ट किसी भी डेटा को नहीं शामिल करता है",
     "import_error_wrong_format_version": "आयात की गई डेटा एक असमर्थित फ़ॉर्मेट संस्करण में है (अपेक्षित %1 या नीचे लेकिन %2 मिला)",
     "import_success_confirm_reload": "कॉन्फ़िगरेशन सफलतापूर्वक आयात किया गया।\nक्या आप परिवर्तन लागू करने के लिए पृष्ठ को अब पुनः लोड करना चाहते हैं?",
-    "reset_config_tooltip": "सभी सेटिंग्स को उनके डिफ़ॉल्ट मानों पर रीसेट करें",
     "reset_config_confirm": "क्या आप वास्तव में सभी सेटिंग्स को उनके डिफ़ॉल्ट मानों पर रीसेट करना चाहते हैं?\nपृष्ठ स्वचालित रूप से पुनः लोड हो जाएगा।",
     "copy_to_clipboard": "क्लिपबोर्ड पर कॉपी करें",
     "copy_to_clipboard_error": "टेक्स्ट को क्लिपबोर्ड पर कॉपी नहीं किया जा सका। कृपया इसे यहां से मैन्युअल रूप से कॉपी करें:\n%1",

+ 0 - 1
assets/translations/ja_JA.json

@@ -25,7 +25,6 @@
     "import_error_no_data": "インポートされたオブジェクトにデータが含まれていません",
     "import_error_wrong_format_version": "インポートされたデータはサポートされていないフォーマットバージョンです(%1 以下が必要ですが、%2 が指定されています)",
     "import_success_confirm_reload": "構成をインポートしました。\n変更を適用するには今すぐページを再読み込みしますか?",
-    "reset_config_tooltip": "すべての設定をデフォルト値にリセットする",
     "reset_config_confirm": "すべての設定をデフォルト値にリセットしてもよろしいですか?\nページは自動的に再読み込みされます。",
     "copy_to_clipboard": "クリップボードにコピー",
     "copy_to_clipboard_error": "テキストをクリップボードにコピーできませんでした。ここから手動でコピーしてください:\n%1",

+ 0 - 1
assets/translations/pt_BR.json

@@ -25,7 +25,6 @@
     "import_error_no_data": "O objeto importado não contém nenhum dado",
     "import_error_wrong_format_version": "Os dados importados estão em uma versão de formato não suportada (esperada %1 ou inferior, mas %2)",
     "import_success_confirm_reload": "Configuração importada com sucesso.\nVocê deseja recarregar a página agora para aplicar as alterações?",
-    "reset_config_tooltip": "Redefina todas as configurações para seus valores padrão",
     "reset_config_confirm": "Você realmente deseja redefinir todas as configurações para seus valores padrão?\nA página será recarregada automaticamente.",
     "copy_to_clipboard": "Copiar para a área de transferência",
     "copy_to_clipboard_error": "Não foi possível copiar o texto para a área de transferência. Por favor, copie manualmente daqui:\n%1",

+ 0 - 1
assets/translations/zh_CN.json

@@ -25,7 +25,6 @@
     "import_error_no_data": "导入的对象不包含任何数据",
     "import_error_wrong_format_version": "导入的数据格式版本不受支持(期望 %1 或更低版本,但得到 %2)",
     "import_success_confirm_reload": "配置导入成功。\n您是否要重新加载页面以应用更改?",
-    "reset_config_tooltip": "将所有设置重置为默认值",
     "reset_config_confirm": "您是否确实要将所有设置重置为默认值?\n页面将自动重新加载。",
     "copy_to_clipboard": "复制到剪贴板",
     "copy_to_clipboard_error": "无法将文本复制到剪贴板。请手动从这里复制:\n%1",

+ 1 - 8
src/menu/menu_old.ts

@@ -1,5 +1,5 @@
 import { debounce, isScrollable, type Stringifiable } from "@sv443-network/userutils";
-import { defaultData, getFeatures, setFeatures, promptResetConfig } from "../config";
+import { defaultData, getFeatures, setFeatures } from "../config";
 import { buildNumber, host, mode, scriptInfo } from "../constants";
 import { featInfo, disableBeforeUnload } from "../features/index";
 import { error, getResourceUrl, info, log, resourceToHTMLString, getLocale, hasKey, initTranslations, setLocale, t, arrayWithSeparators, tp, type TrKey, onInteraction, getDomain, copyToClipboard } from "../utils";
@@ -171,12 +171,6 @@ async function addCfgMenu() {
   reloadFooterEl.appendChild(reloadTxtEl);
   reloadFooterCont.appendChild(reloadFooterEl);
 
-  const resetElem = document.createElement("button");
-  resetElem.classList.add("bytm-btn");
-  resetElem.ariaLabel = resetElem.title = t("reset_config_tooltip");
-  resetElem.textContent = t("reset");
-  onInteraction(resetElem, promptResetConfig);
-
   const exportElem = document.createElement("button");
   exportElem.classList.add("bytm-btn");
   exportElem.ariaLabel = exportElem.title = t("export_tooltip");
@@ -205,7 +199,6 @@ async function addCfgMenu() {
   buttonsCont.id = "bytm-menu-footer-buttons-cont";
   buttonsCont.appendChild(exportElem);
   buttonsCont.appendChild(importElem);
-  buttonsCont.appendChild(resetElem);
 
   footerCont.appendChild(reloadFooterCont);
   footerCont.appendChild(buttonsCont);