diff --git a/locales/en-US.yml b/locales/en-US.yml index bd32c836a..a7ea78a72 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1085,7 +1085,7 @@ apps: "Apps" sendModMail: "Send Moderation Notice" preventAiLearning: "Prevent AI bot scraping" preventAiLearningDescription: "Request third-party AI language models not to study content you upload, such as posts and images." - +pwa: "Install PWA" _sensitiveMediaDetection: description: "Reduces the effort of server moderation through automatically recognizing\ diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 4fc2f42d7..445d839b3 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -975,6 +975,7 @@ customKaTeXMacroDescription: "数式入力を楽にするためのマクロを enableCustomKaTeXMacro: "カスタムKaTeXマクロを有効にする" preventAiLearning: "AIによる学習を防止" preventAiLearningDescription: "投稿したノート、添付した画像などのコンテンツを学習の対象にしないようAIに要求します。これはnoaiフラグをHTMLレスポンスに含めることによって実現されます。" +pwa: "PWAをインストール" _sensitiveMediaDetection: description: "機械学習を使って自動でセンシティブなメディアを検出し、モデレーションに役立てられます。サーバーの負荷が少し増えます。" diff --git a/package.json b/package.json index 8aaa427a1..74c9506cf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "calckey", - "version": "14.0.0-dev8", + "version": "14.0.0-dev9", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/package.json b/packages/client/package.json index 69346651d..173585503 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -9,6 +9,7 @@ }, "devDependencies": { "@discordapp/twemoji": "14.0.2", + "@khmyznikov/pwa-install": "^0.2.0", "@phosphor-icons/web": "^2.0.3", "@rollup/plugin-alias": "3.1.9", "@rollup/plugin-json": "4.1.0", diff --git a/packages/client/src/components/MkTutorialDialog.vue b/packages/client/src/components/MkTutorialDialog.vue index eafc88295..8fecc4429 100644 --- a/packages/client/src/components/MkTutorialDialog.vue +++ b/packages/client/src/components/MkTutorialDialog.vue @@ -180,6 +180,13 @@ primary show-only-to-register /> + + {{ i18n.ts.pwa }} @@ -201,6 +208,7 @@ import { defaultStore } from "@/store"; import { i18n } from "@/i18n"; import { $i } from "@/account"; import { instance } from "@/instance"; +import "@khmyznikov/pwa-install"; const isLocalTimelineAvailable = !instance.disableLocalTimeline || @@ -243,6 +251,11 @@ const tutorial = computed({ }, }); +function installPwa(ev: MouseEvent) { + const pwaInstall = document.getElementsByTagName("pwa-install")[0]; + pwaInstall.showDialog(); +} + function close(res) { tutorial.value = -1; dialog.close(); diff --git a/packages/client/src/scripts/helpMenu.ts b/packages/client/src/scripts/helpMenu.ts index 81e0a08ec..c630d5a1b 100644 --- a/packages/client/src/scripts/helpMenu.ts +++ b/packages/client/src/scripts/helpMenu.ts @@ -4,6 +4,7 @@ import { host } from "@/config"; import * as os from "@/os"; import XTutorial from "../components/MkTutorialDialog.vue"; import { i18n } from "@/i18n"; +import "@khmyznikov/pwa-install"; export function openHelpMenu_(ev: MouseEvent) { os.popupMenu( @@ -24,6 +25,14 @@ export function openHelpMenu_(ev: MouseEvent) { icon: "ph-lightbulb ph-bold ph-lg", to: "/about-calckey", }, + { + type: "button", + text: i18n.ts.pwa, + icon: "ph-export ph-bold ph-lg", + action: () => { + document.getElementsByTagName("pwa-install")[0].showDialog(); + } + }, { type: "button", text: i18n.ts.apps, diff --git a/packages/client/src/ui/_common_/navbar-for-mobile.vue b/packages/client/src/ui/_common_/navbar-for-mobile.vue index 39abb7c26..9ea373025 100644 --- a/packages/client/src/ui/_common_/navbar-for-mobile.vue +++ b/packages/client/src/ui/_common_/navbar-for-mobile.vue @@ -105,6 +105,7 @@ {{ i18n.ts.note }} + +