diff --git a/.coderabbit.yaml b/.coderabbit.yaml index 4e6c5eb5d..7aa04172c 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -22,6 +22,7 @@ reviews: path_filters: - '!**/*.svg' + - '!**/desktop.ini' path_instructions: # ── 全局审美与架构 ────────────────────────────────────────────────── diff --git a/.esh/desktop.ini b/.esh/desktop.ini index c5259007e..a3a69d3aa 100644 --- a/.esh/desktop.ini +++ b/.esh/desktop.ini @@ -1,5 +1,5 @@ [.ShellClassInfo] -IconResource=C:\WINDOWS\System32\SHELL32.dll,170 +IconResource=%SystemRoot%\System32\SHELL32.dll,170 [ViewState] Mode= Vid= diff --git a/.github/ISSUE_TEMPLATE/desktop.ini b/.github/ISSUE_TEMPLATE/desktop.ini new file mode 100644 index 000000000..b48817cab --- /dev/null +++ b/.github/ISSUE_TEMPLATE/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\System32\SHELL32.dll,278 +[ViewState] +Mode= +Vid= +FolderType=Generic diff --git a/.github/actions/desktop.ini b/.github/actions/desktop.ini new file mode 100644 index 000000000..5ca1c68a7 --- /dev/null +++ b/.github/actions/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\System32\SHELL32.dll,261 +[ViewState] +Mode= +Vid= +FolderType=Generic diff --git a/.github/actions/fount-ci/desktop.ini b/.github/actions/fount-ci/desktop.ini new file mode 100644 index 000000000..50579067b --- /dev/null +++ b/.github/actions/fount-ci/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\System32\SHELL32.dll,165 +[ViewState] +Mode= +Vid= +FolderType=Generic diff --git a/.github/desktop.ini b/.github/desktop.ini index 6a5b0bdee..946e6a6e5 100644 --- a/.github/desktop.ini +++ b/.github/desktop.ini @@ -1,5 +1,5 @@ [.ShellClassInfo] -IconResource=C:\WINDOWS\System32\SHELL32.dll,276 +IconResource=%SystemRoot%\System32\SHELL32.dll,276 [ViewState] Mode= Vid= diff --git a/.github/pages/badges/desktop.ini b/.github/pages/badges/desktop.ini new file mode 100644 index 000000000..b3cac1a99 --- /dev/null +++ b/.github/pages/badges/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\System32\SHELL32.dll,287 +[ViewState] +Mode= +Vid= +FolderType=Generic diff --git a/.github/pages/desktop.ini b/.github/pages/desktop.ini new file mode 100644 index 000000000..06fde56f8 --- /dev/null +++ b/.github/pages/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\System32\SHELL32.dll,189 +[ViewState] +Mode= +Vid= +FolderType=Generic diff --git a/.github/pages/login_info/desktop.ini b/.github/pages/login_info/desktop.ini new file mode 100644 index 000000000..04af2defd --- /dev/null +++ b/.github/pages/login_info/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\System32\SHELL32.dll,47 +[ViewState] +Mode= +Vid= +FolderType=Generic diff --git a/.github/pages/protocol/desktop.ini b/.github/pages/protocol/desktop.ini new file mode 100644 index 000000000..971f407f6 --- /dev/null +++ b/.github/pages/protocol/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\System32\SHELL32.dll,150 +[ViewState] +Mode= +Vid= +FolderType=Generic diff --git a/.github/pages/readme/desktop.ini b/.github/pages/readme/desktop.ini new file mode 100644 index 000000000..1331a59b3 --- /dev/null +++ b/.github/pages/readme/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\System32\SHELL32.dll,1 +[ViewState] +Mode= +Vid= +FolderType=Documents diff --git a/.github/pages/scripts/desktop.ini b/.github/pages/scripts/desktop.ini new file mode 100644 index 000000000..5ca1c68a7 --- /dev/null +++ b/.github/pages/scripts/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\System32\SHELL32.dll,261 +[ViewState] +Mode= +Vid= +FolderType=Generic diff --git a/.github/pages/test/desktop.ini b/.github/pages/test/desktop.ini new file mode 100644 index 000000000..968dbafff --- /dev/null +++ b/.github/pages/test/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\System32\SHELL32.dll,171 +[ViewState] +Mode= +Vid= +FolderType=Generic diff --git a/.github/pages/test/frontend/desktop.ini b/.github/pages/test/frontend/desktop.ini new file mode 100644 index 000000000..06fde56f8 --- /dev/null +++ b/.github/pages/test/frontend/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\System32\SHELL32.dll,189 +[ViewState] +Mode= +Vid= +FolderType=Generic diff --git a/.github/pages/values_update/desktop.ini b/.github/pages/values_update/desktop.ini new file mode 100644 index 000000000..4d048e8bb --- /dev/null +++ b/.github/pages/values_update/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\System32\SHELL32.dll,69 +[ViewState] +Mode= +Vid= +FolderType=Generic diff --git a/.github/pages/wait/desktop.ini b/.github/pages/wait/desktop.ini new file mode 100644 index 000000000..b1788a375 --- /dev/null +++ b/.github/pages/wait/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\System32\SHELL32.dll,297 +[ViewState] +Mode= +Vid= +FolderType=Generic diff --git a/.github/pages/wait/install/desktop.ini b/.github/pages/wait/install/desktop.ini new file mode 100644 index 000000000..4e0eeef92 --- /dev/null +++ b/.github/pages/wait/install/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\System32\SHELL32.dll,122 +[ViewState] +Mode= +Vid= +FolderType=Generic diff --git a/.github/pages/wait/install/error/desktop.ini b/.github/pages/wait/install/error/desktop.ini new file mode 100644 index 000000000..075f235fe --- /dev/null +++ b/.github/pages/wait/install/error/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\System32\SHELL32.dll,235 +[ViewState] +Mode= +Vid= +FolderType=Generic diff --git a/.github/pages/wait/install/templates/desktop.ini b/.github/pages/wait/install/templates/desktop.ini new file mode 100644 index 000000000..06fde56f8 --- /dev/null +++ b/.github/pages/wait/install/templates/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\System32\SHELL32.dll,189 +[ViewState] +Mode= +Vid= +FolderType=Generic diff --git a/.github/workflows/default_data/desktop.ini b/.github/workflows/default_data/desktop.ini new file mode 100644 index 000000000..b53377d0f --- /dev/null +++ b/.github/workflows/default_data/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\System32\SHELL32.dll,132 +[ViewState] +Mode= +Vid= +FolderType=Generic diff --git a/.github/workflows/desktop.ini b/.github/workflows/desktop.ini new file mode 100644 index 000000000..b1788a375 --- /dev/null +++ b/.github/workflows/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\System32\SHELL32.dll,297 +[ViewState] +Mode= +Vid= +FolderType=Generic diff --git a/.github/workflows/scripts/desktop.ini b/.github/workflows/scripts/desktop.ini new file mode 100644 index 000000000..5ca1c68a7 --- /dev/null +++ b/.github/workflows/scripts/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\System32\SHELL32.dll,261 +[ViewState] +Mode= +Vid= +FolderType=Generic diff --git a/.vscode/desktop.ini b/.vscode/desktop.ini index 763e8f05d..7907c759e 100644 --- a/.vscode/desktop.ini +++ b/.vscode/desktop.ini @@ -1,5 +1,5 @@ [.ShellClassInfo] -IconResource=C:\WINDOWS\System32\SHELL32.dll,70 +IconResource=%SystemRoot%\System32\SHELL32.dll,70 [ViewState] Mode= Vid= diff --git a/default/default_desktop.ini b/default/default_desktop.ini index db5f5db76..9cd17e08a 100644 --- a/default/default_desktop.ini +++ b/default/default_desktop.ini @@ -1,5 +1,5 @@ [.ShellClassInfo] -IconResource=C:\WINDOWS\System32\SHELL32.dll,54 +IconResource=%SystemRoot%\System32\SHELL32.dll,54 [ViewState] Mode= Vid= diff --git a/default/desktop.ini b/default/desktop.ini index ff584cffa..42a59b75a 100644 --- a/default/desktop.ini +++ b/default/desktop.ini @@ -1,5 +1,5 @@ [.ShellClassInfo] -IconResource=C:\WINDOWS\System32\SHELL32.dll,134 +IconResource=%SystemRoot%\System32\SHELL32.dll,134 [ViewState] Mode= Vid= diff --git a/default/git_desktop.ini b/default/git_desktop.ini index 98eabf68c..442f7a291 100644 --- a/default/git_desktop.ini +++ b/default/git_desktop.ini @@ -1,5 +1,5 @@ [.ShellClassInfo] -IconResource=C:\WINDOWS\System32\SHELL32.dll,14 +IconResource=%SystemRoot%\System32\SHELL32.dll,14 [ViewState] Mode= Vid= diff --git a/default/node_modules_desktop.ini b/default/node_modules_desktop.ini index f47b5acf6..1f7105e43 100644 --- a/default/node_modules_desktop.ini +++ b/default/node_modules_desktop.ini @@ -1,5 +1,5 @@ [.ShellClassInfo] -IconResource=C:\WINDOWS\System32\SHELL32.dll,135 +IconResource=%SystemRoot%\System32\SHELL32.dll,135 [ViewState] Mode= Vid= diff --git a/docs/desktop.ini b/docs/desktop.ini index 7d5ea17b4..5430f269c 100644 --- a/docs/desktop.ini +++ b/docs/desktop.ini @@ -1,5 +1,5 @@ [.ShellClassInfo] -IconResource=C:\WINDOWS\System32\SHELL32.dll,1 +IconResource=%SystemRoot%\System32\SHELL32.dll,1 [ViewState] Mode= Vid= diff --git a/imgs/desktop.ini b/imgs/desktop.ini index 29ad5827c..dc75f2a88 100644 --- a/imgs/desktop.ini +++ b/imgs/desktop.ini @@ -1,5 +1,5 @@ [.ShellClassInfo] -IconResource=C:\WINDOWS\System32\SHELL32.dll,318 +IconResource=%SystemRoot%\System32\SHELL32.dll,318 [ViewState] Mode= Vid= diff --git a/imgs/icon_anime/desktop.ini b/imgs/icon_anime/desktop.ini new file mode 100644 index 000000000..8cb52b36c --- /dev/null +++ b/imgs/icon_anime/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\System32\SHELL32.dll,141 +[ViewState] +Mode= +Vid= +FolderType=Generic diff --git a/imgs/icon_anime/fluid/desktop.ini b/imgs/icon_anime/fluid/desktop.ini new file mode 100644 index 000000000..5ca1c68a7 --- /dev/null +++ b/imgs/icon_anime/fluid/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\System32\SHELL32.dll,261 +[ViewState] +Mode= +Vid= +FolderType=Generic diff --git a/imgs/icon_anime/gesture/desktop.ini b/imgs/icon_anime/gesture/desktop.ini new file mode 100644 index 000000000..196502b60 --- /dev/null +++ b/imgs/icon_anime/gesture/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\System32\SHELL32.dll,159 +[ViewState] +Mode= +Vid= +FolderType=Generic diff --git a/imgs/icon_anime/test/desktop.ini b/imgs/icon_anime/test/desktop.ini new file mode 100644 index 000000000..968dbafff --- /dev/null +++ b/imgs/icon_anime/test/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\System32\SHELL32.dll,171 +[ViewState] +Mode= +Vid= +FolderType=Generic diff --git a/path/desktop.ini b/path/desktop.ini index 1a68afae0..a96eb1087 100644 --- a/path/desktop.ini +++ b/path/desktop.ini @@ -1,5 +1,5 @@ [.ShellClassInfo] -IconResource=C:\WINDOWS\System32\SHELL32.dll,24 +IconResource=%SystemRoot%\System32\SHELL32.dll,24 [ViewState] Mode= Vid= diff --git a/path/fount.sh b/path/fount.sh index 4b57fe2c2..7f48dc2b4 100755 --- a/path/fount.sh +++ b/path/fount.sh @@ -97,7 +97,7 @@ get_best_locale() { echo "en-UK" # 默认 } -# 加载本地化数据 +# 加载本地化数据(调用方勿 export,否则某些 Linux 会撞 ARG_MAX) # shellcheck disable=SC2120 load_locale_data() { if [ -z "$FOUNT_LOCALE" ]; then @@ -122,7 +122,7 @@ load_locale_data() { fi fi if command -v jq &>/dev/null; then - cat "$locale_file" + jq -c '.fountConsole.path // {}' "$locale_file" else echo "{}" # 如果 jq 不可用,则返回空 json fi @@ -222,12 +222,12 @@ apply_i18n_backticks() { get_i18n() { local key="$1" + # 普通 shell 变量缓存即可;子 shell 会继承,勿 export(ARG_MAX) if [ -z "$FOUNT_LOCALE_DATA" ]; then FOUNT_LOCALE_DATA=$(load_locale_data) - export FOUNT_LOCALE_DATA fi local translation - translation=$(echo "$FOUNT_LOCALE_DATA" | jq -r ".fountConsole.path.$key // .\"$key\" // \"$key\"") + translation=$(printf '%s' "$FOUNT_LOCALE_DATA" | jq -r --arg key "$key" 'getpath($key | split(".")) // $key') shift while [ $# -gt 0 ]; do diff --git a/src/decl/desktop.ini b/src/decl/desktop.ini index 5bdbb67c6..592439c7c 100644 --- a/src/decl/desktop.ini +++ b/src/decl/desktop.ini @@ -1,5 +1,5 @@ [.ShellClassInfo] -IconResource=C:\WINDOWS\System32\SHELL32.dll,156 +IconResource=%SystemRoot%\System32\SHELL32.dll,156 [ViewState] Mode= Vid= diff --git a/src/decl/locale_data.ts b/src/decl/locale_data.ts index 381172668..e5dd08cba 100644 --- a/src/decl/locale_data.ts +++ b/src/decl/locale_data.ts @@ -4209,22 +4209,6 @@ export type LocaleData = { label: string } } - edit: { - apply: string - brush: string - brushColor: { - title: string - 'aria-label': string - } - brushSize: { - title: string - 'aria-label': string - } - cancel: string - crop: string - image: string - mosaic: string - } } feed: { refresh: { @@ -5597,6 +5581,21 @@ export type LocaleData = { 'aria-label': string } } + imageEditor: { + apply: string + brush: string + brushColor: { + title: string + 'aria-label': string + } + brushSize: { + title: string + 'aria-label': string + } + crop: string + image: string + mosaic: string + } common: { cancel: string create: string diff --git a/src/desktop.ini b/src/desktop.ini index 03a36779c..54b96e54f 100644 --- a/src/desktop.ini +++ b/src/desktop.ini @@ -1,5 +1,5 @@ [.ShellClassInfo] -IconResource=C:\WINDOWS\System32\SHELL32.dll,72 +IconResource=%SystemRoot%\System32\SHELL32.dll,72 [ViewState] Mode= Vid= diff --git a/src/log_viewer/desktop.ini b/src/log_viewer/desktop.ini index dfe7b2342..209cde4c6 100644 --- a/src/log_viewer/desktop.ini +++ b/src/log_viewer/desktop.ini @@ -1,5 +1,5 @@ [.ShellClassInfo] -IconResource=C:\Windows\System32\cmd.exe,0 +IconResource=%SystemRoot%\cmd.exe,0 [ViewState] Mode= Vid= diff --git a/src/public/desktop.ini b/src/public/desktop.ini index 17a63887a..484db1aa7 100644 --- a/src/public/desktop.ini +++ b/src/public/desktop.ini @@ -1,5 +1,5 @@ [.ShellClassInfo] -IconResource=C:\WINDOWS\System32\SHELL32.dll,148 +IconResource=%SystemRoot%\System32\SHELL32.dll,148 [ViewState] Mode= Vid= diff --git a/src/public/locales/ar-SA.json b/src/public/locales/ar-SA.json index 291324e3b..6753ef58b 100644 --- a/src/public/locales/ar-SA.json +++ b/src/public/locales/ar-SA.json @@ -4234,22 +4234,6 @@ "followers7d": "متابعون لأكثر من 7 أيام", "label": "من يستطيع الرد" } - }, - "edit": { - "apply": "تطبيق", - "brush": "فرشاة", - "brushColor": { - "title": "لون الفرشاة", - "aria-label": "لون الفرشاة" - }, - "brushSize": { - "title": "سُمك الفرشاة", - "aria-label": "سُمك الفرشاة" - }, - "cancel": "إلغاء", - "crop": "اقتصاص", - "image": "تعديل", - "mosaic": "تمويه" } }, "feed": { @@ -5617,6 +5601,21 @@ "aria-label": "الإشعارات" } }, + "imageEditor": { + "apply": "تطبيق", + "brush": "فرشاة", + "brushColor": { + "title": "لون الفرشاة", + "aria-label": "لون الفرشاة" + }, + "brushSize": { + "title": "سُمك الفرشاة", + "aria-label": "سُمك الفرشاة" + }, + "crop": "اقتصاص", + "image": "تعديل", + "mosaic": "تمويه" + }, "common": { "cancel": "إلغاء", "create": "إنشاء", diff --git a/src/public/locales/de-DE.json b/src/public/locales/de-DE.json index 0d3715ee3..b48dd7d3c 100644 --- a/src/public/locales/de-DE.json +++ b/src/public/locales/de-DE.json @@ -4234,22 +4234,6 @@ "followers7d": "Follower seit mehr als 7 Tagen", "label": "Wer kann antworten?" } - }, - "edit": { - "apply": "Übernehmen", - "brush": "Pinsel", - "brushColor": { - "title": "Pinselfarbe", - "aria-label": "Pinselfarbe" - }, - "brushSize": { - "title": "Pinselgröße", - "aria-label": "Pinselgröße" - }, - "cancel": "Abbrechen", - "crop": "Zuschneiden", - "image": "Bearbeiten", - "mosaic": "Verpixeln" } }, "feed": { @@ -5617,6 +5601,21 @@ "aria-label": "Benachrichtigungen" } }, + "imageEditor": { + "apply": "Übernehmen", + "brush": "Pinsel", + "brushColor": { + "title": "Pinselfarbe", + "aria-label": "Pinselfarbe" + }, + "brushSize": { + "title": "Pinselgröße", + "aria-label": "Pinselgröße" + }, + "crop": "Zuschneiden", + "image": "Bearbeiten", + "mosaic": "Verpixeln" + }, "common": { "cancel": "Abbrechen", "create": "Erstellen", diff --git a/src/public/locales/desktop.ini b/src/public/locales/desktop.ini index 98eabf68c..442f7a291 100644 --- a/src/public/locales/desktop.ini +++ b/src/public/locales/desktop.ini @@ -1,5 +1,5 @@ [.ShellClassInfo] -IconResource=C:\WINDOWS\System32\SHELL32.dll,14 +IconResource=%SystemRoot%\System32\SHELL32.dll,14 [ViewState] Mode= Vid= diff --git a/src/public/locales/emoji.json b/src/public/locales/emoji.json index 1ead025a2..bd8f227f0 100644 --- a/src/public/locales/emoji.json +++ b/src/public/locales/emoji.json @@ -4234,22 +4234,6 @@ "followers7d": "7️⃣📅➕👀", "label": "💬🔐" } - }, - "edit": { - "apply": "✅", - "brush": "🖌️", - "brushColor": { - "title": "🎨", - "aria-label": "🎨" - }, - "brushSize": { - "title": "📏", - "aria-label": "📏" - }, - "cancel": "↩️", - "crop": "✂️", - "image": "✏️", - "mosaic": "🔲" } }, "feed": { @@ -5617,6 +5601,21 @@ "aria-label": "🔔" } }, + "imageEditor": { + "apply": "✅", + "brush": "🖌️", + "brushColor": { + "title": "🎨", + "aria-label": "🎨" + }, + "brushSize": { + "title": "📏", + "aria-label": "📏" + }, + "crop": "✂️", + "image": "✏️", + "mosaic": "🔲" + }, "common": { "cancel": "↩️", "create": "➕", diff --git a/src/public/locales/en-UK.json b/src/public/locales/en-UK.json index 42bc1f2c4..fecd40849 100644 --- a/src/public/locales/en-UK.json +++ b/src/public/locales/en-UK.json @@ -4231,22 +4231,6 @@ "followers7d": "Followers for more than 7 days", "label": "Who can reply" } - }, - "edit": { - "apply": "Apply", - "brush": "Brush", - "brushColor": { - "title": "Brush colour", - "aria-label": "Brush colour" - }, - "brushSize": { - "title": "Brush size", - "aria-label": "Brush size" - }, - "cancel": "Cancel", - "crop": "Crop", - "image": "edit", - "mosaic": "Pixelate" } }, "feed": { @@ -5614,6 +5598,21 @@ "aria-label": "Notifications" } }, + "imageEditor": { + "apply": "Apply", + "brush": "Brush", + "brushColor": { + "title": "Brush colour", + "aria-label": "Brush colour" + }, + "brushSize": { + "title": "Brush size", + "aria-label": "Brush size" + }, + "crop": "Crop", + "image": "edit", + "mosaic": "Pixelate" + }, "common": { "cancel": "Cancel", "create": "Create", diff --git a/src/public/locales/es-ES.json b/src/public/locales/es-ES.json index dbbd8f3d5..e79b02c5e 100644 --- a/src/public/locales/es-ES.json +++ b/src/public/locales/es-ES.json @@ -4234,22 +4234,6 @@ "followers7d": "Seguidores por más de 7 días.", "label": "¿Quién puede responder?" } - }, - "edit": { - "apply": "Aplicar", - "brush": "Pincel", - "brushColor": { - "title": "Color del pincel", - "aria-label": "Color del pincel" - }, - "brushSize": { - "title": "Tamaño del pincel", - "aria-label": "Tamaño del pincel" - }, - "cancel": "Cancelar", - "crop": "Recortar", - "image": "editar", - "mosaic": "Pixelar" } }, "feed": { @@ -5617,6 +5601,21 @@ "aria-label": "Notificaciones" } }, + "imageEditor": { + "apply": "Aplicar", + "brush": "Pincel", + "brushColor": { + "title": "Color del pincel", + "aria-label": "Color del pincel" + }, + "brushSize": { + "title": "Tamaño del pincel", + "aria-label": "Tamaño del pincel" + }, + "crop": "Recortar", + "image": "editar", + "mosaic": "Pixelar" + }, "common": { "cancel": "Cancelar", "create": "crear", diff --git a/src/public/locales/fr-FR.json b/src/public/locales/fr-FR.json index e5eca31a9..e7f9a12ce 100644 --- a/src/public/locales/fr-FR.json +++ b/src/public/locales/fr-FR.json @@ -4234,22 +4234,6 @@ "followers7d": "Abonnés depuis plus de 7 jours", "label": "Qui peut répondre" } - }, - "edit": { - "apply": "Appliquer", - "brush": "Pinceau", - "brushColor": { - "title": "Couleur du pinceau", - "aria-label": "Couleur du pinceau" - }, - "brushSize": { - "title": "Taille du pinceau", - "aria-label": "Taille du pinceau" - }, - "cancel": "Annuler", - "crop": "Recadrer", - "image": "Modifier", - "mosaic": "Pixeliser" } }, "feed": { @@ -5617,6 +5601,21 @@ "aria-label": "Notifications" } }, + "imageEditor": { + "apply": "Appliquer", + "brush": "Pinceau", + "brushColor": { + "title": "Couleur du pinceau", + "aria-label": "Couleur du pinceau" + }, + "brushSize": { + "title": "Taille du pinceau", + "aria-label": "Taille du pinceau" + }, + "crop": "Recadrer", + "image": "Modifier", + "mosaic": "Pixeliser" + }, "common": { "cancel": "Annuler", "create": "Créer", diff --git a/src/public/locales/hi-IN.json b/src/public/locales/hi-IN.json index ae4ec65e2..139cf7ac0 100644 --- a/src/public/locales/hi-IN.json +++ b/src/public/locales/hi-IN.json @@ -4234,22 +4234,6 @@ "followers7d": "7 दिन से ज्यादा समय से फॉलोअर्स", "label": "कौन जवाब दे सकता है" } - }, - "edit": { - "apply": "लागू करें", - "brush": "ब्रश", - "brushColor": { - "title": "ब्रश का रंग", - "aria-label": "ब्रश का रंग" - }, - "brushSize": { - "title": "ब्रश का आकार", - "aria-label": "ब्रश का आकार" - }, - "cancel": "रद्द करें", - "crop": "क्रॉप", - "image": "संपादित करें", - "mosaic": "पिक्सेलेट" } }, "feed": { @@ -5617,6 +5601,21 @@ "aria-label": "सूचनाएँ" } }, + "imageEditor": { + "apply": "लागू करें", + "brush": "ब्रश", + "brushColor": { + "title": "ब्रश का रंग", + "aria-label": "ब्रश का रंग" + }, + "brushSize": { + "title": "ब्रश का आकार", + "aria-label": "ब्रश का आकार" + }, + "crop": "क्रॉप", + "image": "संपादित करें", + "mosaic": "पिक्सेलेट" + }, "common": { "cancel": "रद्द करें", "create": "बनाएं", diff --git a/src/public/locales/is-IS.json b/src/public/locales/is-IS.json index 15f0570ab..7bc2f566f 100644 --- a/src/public/locales/is-IS.json +++ b/src/public/locales/is-IS.json @@ -4234,22 +4234,6 @@ "followers7d": "Fylgjendur í meira en 7 daga", "label": "Hver getur svarað" } - }, - "edit": { - "apply": "Nota", - "brush": "Pensill", - "brushColor": { - "title": "Litur pensils", - "aria-label": "Litur pensils" - }, - "brushSize": { - "title": "Stærð pensils", - "aria-label": "Stærð pensils" - }, - "cancel": "Hætta við", - "crop": "Klippa", - "image": "Breyta", - "mosaic": "Pixla" } }, "feed": { @@ -5617,6 +5601,21 @@ "aria-label": "Tilkynningar" } }, + "imageEditor": { + "apply": "Nota", + "brush": "Pensill", + "brushColor": { + "title": "Litur pensils", + "aria-label": "Litur pensils" + }, + "brushSize": { + "title": "Stærð pensils", + "aria-label": "Stærð pensils" + }, + "crop": "Klippa", + "image": "Breyta", + "mosaic": "Pixla" + }, "common": { "cancel": "Hætta við", "create": "Búa til", diff --git a/src/public/locales/it-IT.json b/src/public/locales/it-IT.json index bf9338789..21fbb8f8d 100644 --- a/src/public/locales/it-IT.json +++ b/src/public/locales/it-IT.json @@ -4234,22 +4234,6 @@ "followers7d": "Follower da più di 7 giorni", "label": "Chi può rispondere" } - }, - "edit": { - "apply": "Applica", - "brush": "Pennello", - "brushColor": { - "title": "Colore del pennello", - "aria-label": "Colore del pennello" - }, - "brushSize": { - "title": "Dimensione del pennello", - "aria-label": "Dimensione del pennello" - }, - "cancel": "Annulla", - "crop": "Ritaglia", - "image": "modificare", - "mosaic": "Pixelizza" } }, "feed": { @@ -5617,6 +5601,21 @@ "aria-label": "Notifiche" } }, + "imageEditor": { + "apply": "Applica", + "brush": "Pennello", + "brushColor": { + "title": "Colore del pennello", + "aria-label": "Colore del pennello" + }, + "brushSize": { + "title": "Dimensione del pennello", + "aria-label": "Dimensione del pennello" + }, + "crop": "Ritaglia", + "image": "modificare", + "mosaic": "Pixelizza" + }, "common": { "cancel": "Annulla", "create": "Creare", diff --git a/src/public/locales/ja-JP.json b/src/public/locales/ja-JP.json index 6bb20fd98..97564b27c 100644 --- a/src/public/locales/ja-JP.json +++ b/src/public/locales/ja-JP.json @@ -4234,22 +4234,6 @@ "followers7d": "7日以上のフォロワー", "label": "返信できる人" } - }, - "edit": { - "apply": "適用", - "brush": "ブラシ", - "brushColor": { - "title": "ブラシの色", - "aria-label": "ブラシの色" - }, - "brushSize": { - "title": "ブラシの太さ", - "aria-label": "ブラシの太さ" - }, - "cancel": "キャンセル", - "crop": "トリミング", - "image": "編集", - "mosaic": "モザイク" } }, "feed": { @@ -5617,6 +5601,21 @@ "aria-label": "通知" } }, + "imageEditor": { + "apply": "適用", + "brush": "ブラシ", + "brushColor": { + "title": "ブラシの色", + "aria-label": "ブラシの色" + }, + "brushSize": { + "title": "ブラシの太さ", + "aria-label": "ブラシの太さ" + }, + "crop": "トリミング", + "image": "編集", + "mosaic": "モザイク" + }, "common": { "cancel": "キャンセル", "create": "作成する", diff --git a/src/public/locales/ko-KR.json b/src/public/locales/ko-KR.json index 8bf8dd61b..5fb739b6b 100644 --- a/src/public/locales/ko-KR.json +++ b/src/public/locales/ko-KR.json @@ -4234,22 +4234,6 @@ "followers7d": "7일 이상 팔로워 수", "label": "답글을 달 수 있는 사람" } - }, - "edit": { - "apply": "적용", - "brush": "브러시", - "brushColor": { - "title": "브러시 색상", - "aria-label": "브러시 색상" - }, - "brushSize": { - "title": "브러시 크기", - "aria-label": "브러시 크기" - }, - "cancel": "취소", - "crop": "자르기", - "image": "편집", - "mosaic": "모자이크" } }, "feed": { @@ -5617,6 +5601,21 @@ "aria-label": "알림" } }, + "imageEditor": { + "apply": "적용", + "brush": "브러시", + "brushColor": { + "title": "브러시 색상", + "aria-label": "브러시 색상" + }, + "brushSize": { + "title": "브러시 크기", + "aria-label": "브러시 크기" + }, + "crop": "자르기", + "image": "편집", + "mosaic": "모자이크" + }, "common": { "cancel": "취소", "create": "만들다", diff --git a/src/public/locales/lzh.json b/src/public/locales/lzh.json index 557a2f8e7..a318ac7ad 100644 --- a/src/public/locales/lzh.json +++ b/src/public/locales/lzh.json @@ -4234,22 +4234,6 @@ "followers7d": "結交逾七日者", "label": "誰可回覆" } - }, - "edit": { - "apply": "應用", - "brush": "畫筆", - "brushColor": { - "title": "畫筆之色", - "aria-label": "畫筆之色" - }, - "brushSize": { - "title": "畫筆粗細", - "aria-label": "畫筆粗細" - }, - "cancel": "罷", - "crop": "裁剪", - "image": "修", - "mosaic": "打碼" } }, "feed": { @@ -5617,6 +5601,21 @@ "aria-label": "告示" } }, + "imageEditor": { + "apply": "應用", + "brush": "畫筆", + "brushColor": { + "title": "畫筆之色", + "aria-label": "畫筆之色" + }, + "brushSize": { + "title": "畫筆粗細", + "aria-label": "畫筆粗細" + }, + "crop": "裁剪", + "image": "修", + "mosaic": "打碼" + }, "common": { "cancel": "止", "create": "立", diff --git a/src/public/locales/nl-NL.json b/src/public/locales/nl-NL.json index bd6d29ca0..8c3194453 100644 --- a/src/public/locales/nl-NL.json +++ b/src/public/locales/nl-NL.json @@ -4234,22 +4234,6 @@ "followers7d": "Volgers langer dan 7 dagen", "label": "Wie kan antwoorden" } - }, - "edit": { - "apply": "Toepassen", - "brush": "Penseel", - "brushColor": { - "title": "Penseelkleur", - "aria-label": "Penseelkleur" - }, - "brushSize": { - "title": "Penseeldikte", - "aria-label": "Penseeldikte" - }, - "cancel": "Annuleren", - "crop": "Bijsnijden", - "image": "Bewerken", - "mosaic": "Verpixelen" } }, "feed": { @@ -5617,6 +5601,21 @@ "aria-label": "Meldingen" } }, + "imageEditor": { + "apply": "Toepassen", + "brush": "Penseel", + "brushColor": { + "title": "Penseelkleur", + "aria-label": "Penseelkleur" + }, + "brushSize": { + "title": "Penseeldikte", + "aria-label": "Penseeldikte" + }, + "crop": "Bijsnijden", + "image": "Bewerken", + "mosaic": "Verpixelen" + }, "common": { "cancel": "Annuleren", "create": "Creëren", diff --git a/src/public/locales/pt-PT.json b/src/public/locales/pt-PT.json index a89b178c1..360d7d672 100644 --- a/src/public/locales/pt-PT.json +++ b/src/public/locales/pt-PT.json @@ -4234,22 +4234,6 @@ "followers7d": "Seguidores há mais de 7 dias", "label": "Quem pode responder" } - }, - "edit": { - "apply": "Aplicar", - "brush": "Pincel", - "brushColor": { - "title": "Cor do pincel", - "aria-label": "Cor do pincel" - }, - "brushSize": { - "title": "Tamanho do pincel", - "aria-label": "Tamanho do pincel" - }, - "cancel": "Cancelar", - "crop": "Recortar", - "image": "Editar", - "mosaic": "Pixelizar" } }, "feed": { @@ -5617,6 +5601,21 @@ "aria-label": "Notificações" } }, + "imageEditor": { + "apply": "Aplicar", + "brush": "Pincel", + "brushColor": { + "title": "Cor do pincel", + "aria-label": "Cor do pincel" + }, + "brushSize": { + "title": "Tamanho do pincel", + "aria-label": "Tamanho do pincel" + }, + "crop": "Recortar", + "image": "Editar", + "mosaic": "Pixelizar" + }, "common": { "cancel": "Cancelar", "create": "Criar", diff --git a/src/public/locales/ru-RU.json b/src/public/locales/ru-RU.json index c22413893..16d9f3dec 100644 --- a/src/public/locales/ru-RU.json +++ b/src/public/locales/ru-RU.json @@ -4234,22 +4234,6 @@ "followers7d": "Подписчики от 7 дней", "label": "Кто может ответить" } - }, - "edit": { - "apply": "Применить", - "brush": "Кисть", - "brushColor": { - "title": "Цвет кисти", - "aria-label": "Цвет кисти" - }, - "brushSize": { - "title": "Размер кисти", - "aria-label": "Размер кисти" - }, - "cancel": "Отмена", - "crop": "Обрезать", - "image": "Редактировать", - "mosaic": "Пикселизация" } }, "feed": { @@ -5617,6 +5601,21 @@ "aria-label": "Уведомления" } }, + "imageEditor": { + "apply": "Применить", + "brush": "Кисть", + "brushColor": { + "title": "Цвет кисти", + "aria-label": "Цвет кисти" + }, + "brushSize": { + "title": "Размер кисти", + "aria-label": "Размер кисти" + }, + "crop": "Обрезать", + "image": "Редактировать", + "mosaic": "Пикселизация" + }, "common": { "cancel": "Отмена", "create": "создавать", diff --git a/src/public/locales/uk-UA.json b/src/public/locales/uk-UA.json index a79fa2828..c6e0675a7 100644 --- a/src/public/locales/uk-UA.json +++ b/src/public/locales/uk-UA.json @@ -4234,22 +4234,6 @@ "followers7d": "Підписники більше 7 днів", "label": "Хто може відповісти" } - }, - "edit": { - "apply": "Застосувати", - "brush": "Пензлик", - "brushColor": { - "title": "Колір пензлика", - "aria-label": "Колір пензлика" - }, - "brushSize": { - "title": "Розмір пензлика", - "aria-label": "Розмір пензлика" - }, - "cancel": "Скасувати", - "crop": "Обрізати", - "image": "Редагувати", - "mosaic": "Пікселізація" } }, "feed": { @@ -5617,6 +5601,21 @@ "aria-label": "Сповіщення" } }, + "imageEditor": { + "apply": "Застосувати", + "brush": "Пензлик", + "brushColor": { + "title": "Колір пензлика", + "aria-label": "Колір пензлика" + }, + "brushSize": { + "title": "Розмір пензлика", + "aria-label": "Розмір пензлика" + }, + "crop": "Обрізати", + "image": "Редагувати", + "mosaic": "Пікселізація" + }, "common": { "cancel": "Скасувати", "create": "Створити", diff --git a/src/public/locales/vi-VN.json b/src/public/locales/vi-VN.json index 7bb8f4902..a615447b5 100644 --- a/src/public/locales/vi-VN.json +++ b/src/public/locales/vi-VN.json @@ -4234,22 +4234,6 @@ "followers7d": "Người theo dõi trong hơn 7 ngày", "label": "Ai có thể trả lời" } - }, - "edit": { - "apply": "Áp dụng", - "brush": "Cọ", - "brushColor": { - "title": "Màu cọ", - "aria-label": "Màu cọ" - }, - "brushSize": { - "title": "Độ dày cọ", - "aria-label": "Độ dày cọ" - }, - "cancel": "Hủy bỏ", - "crop": "Cắt", - "image": "biên tập", - "mosaic": "Che pixel" } }, "feed": { @@ -5617,6 +5601,21 @@ "aria-label": "Thông báo" } }, + "imageEditor": { + "apply": "Áp dụng", + "brush": "Cọ", + "brushColor": { + "title": "Màu cọ", + "aria-label": "Màu cọ" + }, + "brushSize": { + "title": "Độ dày cọ", + "aria-label": "Độ dày cọ" + }, + "crop": "Cắt", + "image": "Chỉnh sửa", + "mosaic": "Che pixel" + }, "common": { "cancel": "Hủy bỏ", "create": "tạo nên", diff --git a/src/public/locales/zh-CN.json b/src/public/locales/zh-CN.json index 61b1128fa..a389d32bd 100644 --- a/src/public/locales/zh-CN.json +++ b/src/public/locales/zh-CN.json @@ -4240,22 +4240,6 @@ "followers7d": "7天以上关注者", "label": "谁可以回复" } - }, - "edit": { - "apply": "应用", - "brush": "画笔", - "brushColor": { - "title": "画笔颜色", - "aria-label": "画笔颜色" - }, - "brushSize": { - "title": "画笔粗细", - "aria-label": "画笔粗细" - }, - "cancel": "取消", - "crop": "裁剪", - "image": "编辑", - "mosaic": "打码" } }, "feed": { @@ -5629,6 +5613,21 @@ "aria-label": "通知" } }, + "imageEditor": { + "apply": "应用", + "brush": "画笔", + "brushColor": { + "title": "画笔颜色", + "aria-label": "画笔颜色" + }, + "brushSize": { + "title": "画笔粗细", + "aria-label": "画笔粗细" + }, + "crop": "裁剪", + "image": "编辑", + "mosaic": "打码" + }, "common": { "cancel": "取消", "create": "创建", diff --git a/src/public/locales/zh-TW.json b/src/public/locales/zh-TW.json index b1d1a8e83..71f47a89c 100644 --- a/src/public/locales/zh-TW.json +++ b/src/public/locales/zh-TW.json @@ -4233,22 +4233,6 @@ "followers7d": "7天以上關注者", "label": "誰可以回覆" } - }, - "edit": { - "apply": "應用", - "brush": "畫筆", - "brushColor": { - "title": "畫筆顏色", - "aria-label": "畫筆顏色" - }, - "brushSize": { - "title": "畫筆粗細", - "aria-label": "畫筆粗細" - }, - "cancel": "取消", - "crop": "裁剪", - "image": "編輯", - "mosaic": "打碼" } }, "feed": { @@ -5616,6 +5600,21 @@ "aria-label": "通知" } }, + "imageEditor": { + "apply": "應用", + "brush": "畫筆", + "brushColor": { + "title": "畫筆顏色", + "aria-label": "畫筆顏色" + }, + "brushSize": { + "title": "畫筆粗細", + "aria-label": "畫筆粗細" + }, + "crop": "裁剪", + "image": "編輯", + "mosaic": "打碼" + }, "common": { "cancel": "取消", "create": "建立", diff --git a/src/public/pages/.well-known/desktop.ini b/src/public/pages/.well-known/desktop.ini index c32f55250..9217ef89d 100644 --- a/src/public/pages/.well-known/desktop.ini +++ b/src/public/pages/.well-known/desktop.ini @@ -1,5 +1,5 @@ [.ShellClassInfo] -IconResource=C:\WINDOWS\System32\SHELL32.dll,130 +IconResource=%SystemRoot%\System32\SHELL32.dll,130 [ViewState] Mode= Vid= diff --git a/src/public/pages/404/desktop.ini b/src/public/pages/404/desktop.ini index 2569ec640..7daa7c582 100644 --- a/src/public/pages/404/desktop.ini +++ b/src/public/pages/404/desktop.ini @@ -1,5 +1,5 @@ [.ShellClassInfo] -IconResource=C:\WINDOWS\System32\SHELL32.dll,50 +IconResource=%SystemRoot%\System32\SHELL32.dll,50 [ViewState] Mode= Vid= diff --git a/src/public/pages/AGENTS.md b/src/public/pages/AGENTS.md index 1dedcf1bd..94e697289 100644 --- a/src/public/pages/AGENTS.md +++ b/src/public/pages/AGENTS.md @@ -21,13 +21,15 @@ Markdown convertor traps (rehype order, `{:lang}`, trust tiers): [markdown-notes ## UI & Theming - **`base.css`**: shared page chrome. `.hidden { display: none !important }` — do not re-declare in shells; page-local `display: flex|grid` must not un-hide toggled UI. +- **Component CSS**: inject at module import (`// --- 全局样式注入 ---`, `document.head.prepend`), same as `jsonEditor` / `markdown/convertor` — do not lazy-`ensure*` stylesheet links on first use. Registry-driven CSS (e.g. markdown extensions) stays async-load. - **`theme.mjs`**: DaisyUI theme management. Call `applyTheme()` first. - **`template.mjs`**: `renderTemplate` / `mountTemplate` / `renderTemplateAsHtmlString` / `withTemplates(path, fn)`. Cross-shell shared modules must **not** call bare `usingTemplates` — use `withTemplates` or direct DOM. - **`dialog.mjs`**: `openDialogFromTemplate` / `pickFromDialog`. Templates supply `modal-box` (+ optional `modal-backdrop`) only — do not nest another ``. - **`promptDialog.mjs`**: shared DaisyUI `promptText` / `promptTextArea` / `confirmAction`. Prefer over `window.prompt` / `confirm` / shell-local copies. **First argument is always an i18n key**; optional third arg is interpolation params. Do not pass `geti18n(...)` strings. Modal title is **`h2`** (page already has `h1`; DaisyUI docs’ `h3` skips a level and trips axe `heading-order`). - **`components/jsonEditor.mjs`**: `createJsonEditor(container, options)` wraps `vanilla-jsoneditor` (≥3.13). **`options.ariaLabel` is required and must be an i18n key** (resolved + refreshed via `setLocalizeLogic`); do not pass `geti18n(...)` strings. Optional `onSave` is Ctrl+S only — not a library prop. Keep native `get()`/`set()` (`Content`); use **`getJson()`** for parsed values (`{ json }` as-is; `{ text }` → `jsonrepair` then `JSON.parse`). +- **`components/imageEditor.mjs`**: `openImageEditor(file, labels?)` — crop / mosaic / brush modal; returns `File | null`. Defaults under `util.imageEditor.*` (+ `util.common.cancel`). - **`components/positionContextMenu.mjs`** + **`components/contextMenuDismiss.mjs`**: shared floating-menu placement / dismiss. -- **`contentReveal/`**: `wrapSensitiveMediaHtml`, `wrapContentWarningHtml`, `bindContentReveal`. +- **`contentReveal.mjs`**: `wrapSensitiveMediaHtml`, `wrapContentWarningHtml`, `bindContentReveal`. - **`translate.mjs`**: `mountTranslationBlock`, `requestTranslation`, `resolveTargetLang` (-> `primaryLocale()`). - **`toast.mjs`**: `showToast`, `showToastI18n`. @@ -46,8 +48,8 @@ Markdown convertor traps (rehype order, `{:lang}`, trust tiers): [markdown-notes ## Components & Utilities -- **`virtualList.mjs`**: Virtual scrolling. Optional `getItemKey` enables keyed reconcile on `refresh()`. -- **`infiniteScroll.mjs`**: `ensureScrollSentinel` / `insertBeforeScrollSentinel` / `bindInfiniteScroll` / `disconnectInfiniteScroll`. Sentinel stays last via `insertBeforeScrollSentinel`. Rising-edge / replay traps: Social [ui-details.md](../parts/shells/social/public/ui-details.md#feed-pagination--replay). +- **`lib/virtualList.mjs`**: Virtual scrolling. Optional `getItemKey` enables keyed reconcile on `refresh()`. +- **`lib/infiniteScroll.mjs`**: `ensureScrollSentinel` / `insertBeforeScrollSentinel` / `bindInfiniteScroll` / `disconnectInfiniteScroll`. Sentinel stays last via `insertBeforeScrollSentinel`. Rising-edge / replay traps: Social [ui-details.md](../parts/shells/social/public/ui-details.md#feed-pagination--replay). - **`lib/base64.mjs`**: `arrayBufferToBase64` / `blobToBase64` — reuse for upload bodies; do not copy per shell. - **`lib/svgInliner.mjs`**: Inline `.svg` `` for `currentColor`. Put `svg-inliner-ignore` on user/media avatars so they stay `` (inlining untrusted SVG activates scripts). - **`user-content`**: boolean attr on user/dynamic text & inputs (post/reply bodies, message bubbles, composer fields, …). `test_watch` locale-script scan hides `[user-content]` — same opt-out style as `svg-inliner-ignore`. diff --git a/src/public/pages/desktop.ini b/src/public/pages/desktop.ini index a1e7f87ac..06fde56f8 100644 --- a/src/public/pages/desktop.ini +++ b/src/public/pages/desktop.ini @@ -1,5 +1,5 @@ [.ShellClassInfo] -IconResource=C:\WINDOWS\System32\SHELL32.dll,189 +IconResource=%SystemRoot%\System32\SHELL32.dll,189 [ViewState] Mode= Vid= diff --git a/src/public/pages/directory-listing/desktop.ini b/src/public/pages/directory-listing/desktop.ini index 598e66436..04658167e 100644 --- a/src/public/pages/directory-listing/desktop.ini +++ b/src/public/pages/directory-listing/desktop.ini @@ -1,5 +1,5 @@ [.ShellClassInfo] -IconResource=C:\WINDOWS\System32\SHELL32.dll,270 +IconResource=%SystemRoot%\System32\SHELL32.dll,270 [ViewState] Mode= Vid= diff --git a/src/public/pages/log_viewer/desktop.ini b/src/public/pages/log_viewer/desktop.ini index dfe7b2342..209cde4c6 100644 --- a/src/public/pages/log_viewer/desktop.ini +++ b/src/public/pages/log_viewer/desktop.ini @@ -1,5 +1,5 @@ [.ShellClassInfo] -IconResource=C:\Windows\System32\cmd.exe,0 +IconResource=%SystemRoot%\cmd.exe,0 [ViewState] Mode= Vid= diff --git a/src/public/pages/log_viewer/repl/desktop.ini b/src/public/pages/log_viewer/repl/desktop.ini new file mode 100644 index 000000000..209cde4c6 --- /dev/null +++ b/src/public/pages/log_viewer/repl/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\cmd.exe,0 +[ViewState] +Mode= +Vid= +FolderType=Generic diff --git a/src/public/pages/login/desktop.ini b/src/public/pages/login/desktop.ini index 8dde7f739..2cbdc4aac 100644 --- a/src/public/pages/login/desktop.ini +++ b/src/public/pages/login/desktop.ini @@ -1,5 +1,5 @@ [.ShellClassInfo] -IconResource=C:\WINDOWS\System32\SHELL32.dll,166 +IconResource=%SystemRoot%\System32\SHELL32.dll,166 [ViewState] Mode= Vid= diff --git a/src/public/pages/preloadrunner/desktop.ini b/src/public/pages/preloadrunner/desktop.ini index 3d0bb3912..82c4ed9ab 100644 --- a/src/public/pages/preloadrunner/desktop.ini +++ b/src/public/pages/preloadrunner/desktop.ini @@ -1,5 +1,5 @@ [.ShellClassInfo] -IconResource=C:\WINDOWS\System32\SHELL32.dll,135 +IconResource=%SystemRoot%\System32\SHELL32.dll,135 [ViewState] Mode= Vid= diff --git a/src/public/pages/protocolhandler/desktop.ini b/src/public/pages/protocolhandler/desktop.ini index 335ac8dc9..b2e56ee1a 100644 --- a/src/public/pages/protocolhandler/desktop.ini +++ b/src/public/pages/protocolhandler/desktop.ini @@ -1,5 +1,5 @@ [.ShellClassInfo] -IconResource=C:\WINDOWS\System32\SHELL32.dll,137 +IconResource=%SystemRoot%\System32\SHELL32.dll,137 [ViewState] Mode= Vid= diff --git a/src/public/pages/scripts/api/desktop.ini b/src/public/pages/scripts/api/desktop.ini new file mode 100644 index 000000000..8c602c72e --- /dev/null +++ b/src/public/pages/scripts/api/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\System32\SHELL32.dll,293 +[ViewState] +Mode= +Vid= +FolderType=Generic diff --git a/src/public/pages/scripts/api/p2p/desktop.ini b/src/public/pages/scripts/api/p2p/desktop.ini new file mode 100644 index 000000000..b4c3de45e --- /dev/null +++ b/src/public/pages/scripts/api/p2p/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\System32\SHELL32.dll,18 +[ViewState] +Mode= +Vid= +FolderType=Generic diff --git a/src/public/pages/scripts/components/POWcaptcha.mjs b/src/public/pages/scripts/components/POWcaptcha.mjs index 38408ef59..7504f97a6 100644 --- a/src/public/pages/scripts/components/POWcaptcha.mjs +++ b/src/public/pages/scripts/components/POWcaptcha.mjs @@ -1,11 +1,6 @@ import { showToastI18n } from '../features/toast.mjs' import { geti18n, setLocalizeLogic } from '../i18n/index.mjs' -/** - * 注入主题适应的样式。 - */ -let styleElement - /** * 创建并管理一个 POW (Proof-of-Work) CAPTCHA 小部件。 * @param {HTMLElement} container 要附加小部件的 DOM 元素。 @@ -13,23 +8,6 @@ let styleElement */ export async function createPOWCaptcha(container) { const capLibLoaded = import('https://esm.sh/@cap.js/widget') - styleElement ??= document.head.appendChild(Object.assign(document.createElement('style'), { - textContent: /* css */ `\ -cap-widget { - --cap-background: var(--color-base-100); - --cap-border-color: var(--color-base-300); - --cap-border-radius: var(--radius-box, 1rem); - --cap-color: var(--color-base-content); - --cap-checkbox-border: 1px solid var(--color-info); - --cap-checkbox-border-radius: var(--radius-field, 0.5rem); - --cap-checkbox-background: var(--color-base-200); - --cap-font: inherit; - --cap-spinner-color: var(--color-primary); - --cap-spinner-background-color: var(--color-secondary); -} -` - })) - const widget = document.createElement('cap-widget') // Apply translations @@ -55,3 +33,22 @@ cap-widget { return cap } + +// --- 全局样式注入 --- + +document.head.prepend(Object.assign(document.createElement('style'), { + textContent: /* css */ `\ +cap-widget { + --cap-background: var(--color-base-100); + --cap-border-color: var(--color-base-300); + --cap-border-radius: var(--radius-box, 1rem); + --cap-color: var(--color-base-content); + --cap-checkbox-border: 1px solid var(--color-info); + --cap-checkbox-border-radius: var(--radius-field, 0.5rem); + --cap-checkbox-background: var(--color-base-200); + --cap-font: inherit; + --cap-spinner-color: var(--color-primary); + --cap-spinner-background-color: var(--color-secondary); +} +`, +})) diff --git a/src/public/pages/scripts/components/desktop.ini b/src/public/pages/scripts/components/desktop.ini new file mode 100644 index 000000000..381835d51 --- /dev/null +++ b/src/public/pages/scripts/components/desktop.ini @@ -0,0 +1,6 @@ +[.ShellClassInfo] +IconResource=%SystemRoot%\System32\SHELL32.dll,80 +[ViewState] +Mode= +Vid= +FolderType=Generic diff --git a/src/public/pages/scripts/components/emojiPackPreview.mjs b/src/public/pages/scripts/components/emojiPackPreview.mjs index 90a93c3d5..8b3b32aef 100644 --- a/src/public/pages/scripts/components/emojiPackPreview.mjs +++ b/src/public/pages/scripts/components/emojiPackPreview.mjs @@ -8,8 +8,6 @@ import { geti18n, loadPreferredLangs, primaryLocale } from '../i18n/index.mjs' import { escapeHtml } from '../lib/escapeHtml.mjs' import { isSafeHtmlUrl } from '../lib/sanitizeHtml.mjs' -const CSS_ID = 'fount-emoji-pack-preview-css' -const CSS_HREF = '/scripts/components/emojiPackPreview.css' const CARD_ID = 'fount-emoji-pack-preview' const CHAT_API = '/api/parts/shells:chat' @@ -18,18 +16,6 @@ const SOCIAL_API = '/api/parts/shells:social' /** @type {(() => void) | null} */ let disposeOutsideClose = null -/** - * @returns {void} - */ -function ensureCss() { - if (document.getElementById(CSS_ID)) return - const link = document.createElement('link') - link.id = CSS_ID - link.rel = 'stylesheet' - link.href = CSS_HREF - document.head.appendChild(link) -} - /** * @param {HTMLElement} card 卡 * @param {HTMLElement} anchor 锚点 @@ -167,7 +153,6 @@ async function resolveCollection(pack, provider) { */ export async function showEmojiPackPreview(anchor, options) { if (!(anchor instanceof HTMLElement) || !options?.pack) return - ensureCss() const card = ensureCard() const pack = options.pack const provider = options.provider || pack._provider || null @@ -281,3 +266,10 @@ export async function showEmojiPackPreview(anchor, options) { positionNearAnchor(card, anchor) } + +// --- 全局样式注入 --- + +document.head.prepend(Object.assign(document.createElement('link'), { + rel: 'stylesheet', + href: '/scripts/components/emojiPackPreview.css', +})) diff --git a/src/public/pages/scripts/components/emojiPicker.mjs b/src/public/pages/scripts/components/emojiPicker.mjs index 2049f870e..96a3f4421 100644 --- a/src/public/pages/scripts/components/emojiPicker.mjs +++ b/src/public/pages/scripts/components/emojiPicker.mjs @@ -30,9 +30,6 @@ export { showEmojiPackPreview } from './emojiPackPreview.mjs' const JUMP_START_ICON = '' const JUMP_UNICODE_ICON = '' -const CSS_ID = 'fount-emoji-picker-css' -const CSS_HREF = '/scripts/components/emojiPicker.css' - /** * 来源侧默认包:由 provider/API 回显的 defaultEmojiPackId(已在后端 resolve)判定。 @@ -58,18 +55,6 @@ function enrichPackItem(packId, item) { } } -/** - * @returns {void} - */ -function ensureEmojiPickerCss() { - if (document.getElementById(CSS_ID)) return - const link = document.createElement('link') - link.id = CSS_ID - link.rel = 'stylesheet' - link.href = CSS_HREF - document.head.appendChild(link) -} - /** * 在输入框光标处插入 token。 * @param {HTMLTextAreaElement | HTMLInputElement} inputElement 目标输入框 @@ -330,7 +315,6 @@ function openSectionPackPreview(anchor, section) { * @returns {{ disconnect: () => void, scrollElement: HTMLElement, railElement: HTMLElement }} DOM 引用与清理句柄 */ function renderContinuousPicker(host, sections, handlers) { - ensureEmojiPickerCss() host.replaceChildren() const sectionById = new Map(sections.map(section => [section.id, section])) @@ -522,7 +506,6 @@ export async function mountDockedEmojiPicker(options) { pickerContext = {}, getPickerContext, onInsert, closeWhenOpening, } = options - ensureEmojiPickerCss() /** @returns {object} 当前 picker 上下文 */ const resolvePickerContext = () => getPickerContext?.() ?? pickerContext @@ -589,7 +572,6 @@ export async function mountDockedEmojiPicker(options) { */ export async function mountEmojiPicker(anchor, onInsert, pickerContext = {}) { document.getElementById('fount-shared-emoji-picker')?.remove() - ensureEmojiPickerCss() const panel = document.createElement('div') panel.id = 'fount-shared-emoji-picker' @@ -636,3 +618,10 @@ export function wireEmojiPickerButton(button, onInsert, pickerContext = {}) { void mountEmojiPicker(button, onInsert, pickerContext) }) } + +// --- 全局样式注入 --- + +document.head.prepend(Object.assign(document.createElement('link'), { + rel: 'stylesheet', + href: '/scripts/components/emojiPicker.css', +})) diff --git a/src/public/pages/scripts/imageEditor/index.mjs b/src/public/pages/scripts/components/imageEditor.mjs similarity index 81% rename from src/public/pages/scripts/imageEditor/index.mjs rename to src/public/pages/scripts/components/imageEditor.mjs index b2d08c4b3..7f463fda3 100644 --- a/src/public/pages/scripts/imageEditor/index.mjs +++ b/src/public/pages/scripts/components/imageEditor.mjs @@ -4,54 +4,32 @@ import { escapeHtml } from '../lib/escapeHtml.mjs' -const IMAGE_EDITOR_CSS = '/scripts/imageEditor/imageEditor.css' - -/** - * @returns {void} - */ -function ensureImageEditorStyles() { - if (document.querySelector(`link[href="${IMAGE_EDITOR_CSS}"]`)) return - const link = document.createElement('link') - link.rel = 'stylesheet' - link.href = IMAGE_EDITOR_CSS - document.head.appendChild(link) -} - /** * @param {File | Blob} file 源图片 - * @param {{ titleI18n?: string, cropI18n?: string, mosaicI18n?: string, brushI18n?: string, brushColorI18n?: string, brushSizeI18n?: string, applyI18n?: string, cancelI18n?: string }} [labels] 文案键 + * @param {{ titleI18n?: string, cropI18n?: string, mosaicI18n?: string, brushI18n?: string, brushColorI18n?: string, brushSizeI18n?: string, applyI18n?: string, cancelI18n?: string }} [labels] 文案键(默认 `util.imageEditor.*` / `util.common.cancel`) * @returns {Promise} 编辑后的文件;取消为 null */ export function openImageEditor(file, labels = {}) { - ensureImageEditorStyles() return new Promise((resolve, reject) => { const objectUrl = URL.createObjectURL(file) const dialog = document.createElement('dialog') dialog.className = 'modal image-editor-modal' - const titleI18n = escapeHtml(labels.titleI18n || 'social.composer.edit.image') - const cropI18n = escapeHtml(labels.cropI18n || 'social.composer.edit.crop') - const mosaicI18n = escapeHtml(labels.mosaicI18n || 'social.composer.edit.mosaic') - const brushI18n = escapeHtml(labels.brushI18n || 'social.composer.edit.brush') - const brushColorI18n = escapeHtml(labels.brushColorI18n || 'social.composer.edit.brushColor') - const brushSizeI18n = escapeHtml(labels.brushSizeI18n || 'social.composer.edit.brushSize') - const cancelI18n = escapeHtml(labels.cancelI18n || 'social.composer.edit.cancel') - const applyI18n = escapeHtml(labels.applyI18n || 'social.composer.edit.apply') dialog.innerHTML = `\ -