add (back) pwa install button to help menu

This commit is contained in:
Kainoa Kanter 2023-05-11 18:59:42 -07:00
parent d743f53db6
commit 298960f4dd
9 changed files with 83 additions and 2 deletions

View File

@ -1085,7 +1085,7 @@ apps: "Apps"
sendModMail: "Send Moderation Notice" sendModMail: "Send Moderation Notice"
preventAiLearning: "Prevent AI bot scraping" preventAiLearning: "Prevent AI bot scraping"
preventAiLearningDescription: "Request third-party AI language models not to study content you upload, such as posts and images." preventAiLearningDescription: "Request third-party AI language models not to study content you upload, such as posts and images."
pwa: "Install PWA"
_sensitiveMediaDetection: _sensitiveMediaDetection:
description: "Reduces the effort of server moderation through automatically recognizing\ description: "Reduces the effort of server moderation through automatically recognizing\

View File

@ -975,6 +975,7 @@ customKaTeXMacroDescription: "数式入力を楽にするためのマクロを
enableCustomKaTeXMacro: "カスタムKaTeXマクロを有効にする" enableCustomKaTeXMacro: "カスタムKaTeXマクロを有効にする"
preventAiLearning: "AIによる学習を防止" preventAiLearning: "AIによる学習を防止"
preventAiLearningDescription: "投稿したート、添付した画像などのコンテンツを学習の対象にしないようAIに要求します。これはnoaiフラグをHTMLレスポンスに含めることによって実現されます。" preventAiLearningDescription: "投稿したート、添付した画像などのコンテンツを学習の対象にしないようAIに要求します。これはnoaiフラグをHTMLレスポンスに含めることによって実現されます。"
pwa: "PWAをインストール"
_sensitiveMediaDetection: _sensitiveMediaDetection:
description: "機械学習を使って自動でセンシティブなメディアを検出し、モデレーションに役立てられます。サーバーの負荷が少し増えます。" description: "機械学習を使って自動でセンシティブなメディアを検出し、モデレーションに役立てられます。サーバーの負荷が少し増えます。"

View File

@ -1,6 +1,6 @@
{ {
"name": "calckey", "name": "calckey",
"version": "14.0.0-dev8", "version": "14.0.0-dev9",
"codename": "aqua", "codename": "aqua",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -9,6 +9,7 @@
}, },
"devDependencies": { "devDependencies": {
"@discordapp/twemoji": "14.0.2", "@discordapp/twemoji": "14.0.2",
"@khmyznikov/pwa-install": "^0.2.0",
"@phosphor-icons/web": "^2.0.3", "@phosphor-icons/web": "^2.0.3",
"@rollup/plugin-alias": "3.1.9", "@rollup/plugin-alias": "3.1.9",
"@rollup/plugin-json": "4.1.0", "@rollup/plugin-json": "4.1.0",

View File

@ -180,6 +180,13 @@
primary primary
show-only-to-register show-only-to-register
/> />
<pwa-install />
<MkButton
primary
inline
@click="installPwa"
>{{ i18n.ts.pwa }}</MkButton
>
</div> </div>
</Transition> </Transition>
</div> </div>
@ -201,6 +208,7 @@ import { defaultStore } from "@/store";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import { $i } from "@/account"; import { $i } from "@/account";
import { instance } from "@/instance"; import { instance } from "@/instance";
import "@khmyznikov/pwa-install";
const isLocalTimelineAvailable = const isLocalTimelineAvailable =
!instance.disableLocalTimeline || !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) { function close(res) {
tutorial.value = -1; tutorial.value = -1;
dialog.close(); dialog.close();

View File

@ -4,6 +4,7 @@ import { host } from "@/config";
import * as os from "@/os"; import * as os from "@/os";
import XTutorial from "../components/MkTutorialDialog.vue"; import XTutorial from "../components/MkTutorialDialog.vue";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import "@khmyznikov/pwa-install";
export function openHelpMenu_(ev: MouseEvent) { export function openHelpMenu_(ev: MouseEvent) {
os.popupMenu( os.popupMenu(
@ -24,6 +25,14 @@ export function openHelpMenu_(ev: MouseEvent) {
icon: "ph-lightbulb ph-bold ph-lg", icon: "ph-lightbulb ph-bold ph-lg",
to: "/about-calckey", 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", type: "button",
text: i18n.ts.apps, text: i18n.ts.apps,

View File

@ -105,6 +105,7 @@
<i class="icon ph-pencil ph-bold ph-lg ph-fw ph-lg"></i <i class="icon ph-pencil ph-bold ph-lg ph-fw ph-lg"></i
><span class="text">{{ i18n.ts.note }}</span> ><span class="text">{{ i18n.ts.note }}</span>
</button> </button>
<pwa-install />
<button <button
v-tooltip.noDelay.right="i18n.ts.help" v-tooltip.noDelay.right="i18n.ts.help"
class="item _button help" class="item _button help"
@ -132,6 +133,7 @@ import { openAccountMenu as openAccountMenu_ } from "@/account";
import { openHelpMenu_ } from "@/scripts/helpMenu"; import { openHelpMenu_ } from "@/scripts/helpMenu";
import { defaultStore } from "@/store"; import { defaultStore } from "@/store";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import "@khmyznikov/pwa-install";
const menu = toRef(defaultStore.state, "menu"); const menu = toRef(defaultStore.state, "menu");
const otherMenuItemIndicated = computed(() => { const otherMenuItemIndicated = computed(() => {

View File

@ -122,6 +122,7 @@
<i class="icon ph-pencil ph-bold ph-fw ph-lg"></i <i class="icon ph-pencil ph-bold ph-fw ph-lg"></i
><span class="text">{{ i18n.ts.note }}</span> ><span class="text">{{ i18n.ts.note }}</span>
</button> </button>
<pwa-install />
<button <button
v-tooltip.noDelay.right="i18n.ts.help" v-tooltip.noDelay.right="i18n.ts.help"
class="item _button help" class="item _button help"
@ -150,6 +151,7 @@ import { defaultStore } from "@/store";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import { instance } from "@/instance"; import { instance } from "@/instance";
import { version } from "@/config"; import { version } from "@/config";
import "@khmyznikov/pwa-install";
const isEmpty = (x: string | null) => x == null || x === ""; const isEmpty = (x: string | null) => x == null || x === "";

View File

@ -659,6 +659,9 @@ importers:
'@discordapp/twemoji': '@discordapp/twemoji':
specifier: 14.0.2 specifier: 14.0.2
version: 14.0.2 version: 14.0.2
'@khmyznikov/pwa-install':
specifier: ^0.2.0
version: 0.2.0
'@phosphor-icons/web': '@phosphor-icons/web':
specifier: ^2.0.3 specifier: ^2.0.3
version: 2.0.3 version: 2.0.3
@ -2094,6 +2097,13 @@ packages:
'@jridgewell/resolve-uri': 3.1.0 '@jridgewell/resolve-uri': 3.1.0
'@jridgewell/sourcemap-codec': 1.4.14 '@jridgewell/sourcemap-codec': 1.4.14
/@khmyznikov/pwa-install@0.2.0:
resolution: {integrity: sha512-Lz8lvCf47/DCVzXgLyCGt46HDpie2U/lga++vOgVwil3B8bSMj8fL1+a/8oBhDikHjtLKinTCMf0jZvgW2xCZQ==}
dependencies:
'@lit/localize': 0.11.4
lit: 2.7.4
dev: true
/@koa/cors@3.4.3: /@koa/cors@3.4.3:
resolution: {integrity: sha512-WPXQUaAeAMVaLTEFpoq3T2O1C+FstkjJnDQqy95Ck1UdILajsRhu6mhJ8H2f4NFPRBoCNN+qywTJfq/gGki5mw==} resolution: {integrity: sha512-WPXQUaAeAMVaLTEFpoq3T2O1C+FstkjJnDQqy95Ck1UdILajsRhu6mhJ8H2f4NFPRBoCNN+qywTJfq/gGki5mw==}
engines: {node: '>= 8.0.0'} engines: {node: '>= 8.0.0'}
@ -2127,6 +2137,23 @@ packages:
resolution: {integrity: sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw==} resolution: {integrity: sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw==}
dev: true dev: true
/@lit-labs/ssr-dom-shim@1.1.1:
resolution: {integrity: sha512-kXOeFbfCm4fFf2A3WwVEeQj55tMZa8c8/f9AKHMobQMkzNUfUj+antR3fRPaZJawsa1aZiP/Da3ndpZrwEe4rQ==}
dev: true
/@lit/localize@0.11.4:
resolution: {integrity: sha512-RRIwIX2tAm3+DuEndoXSJrFjGrAK5cb5IXo5K6jcJ6sbgD829B8rSqHC5MaKVUmXTVLIR1bk5IZOZDf9wFereA==}
dependencies:
'@lit/reactive-element': 1.6.1
lit: 2.7.4
dev: true
/@lit/reactive-element@1.6.1:
resolution: {integrity: sha512-va15kYZr7KZNNPZdxONGQzpUr+4sxVu7V/VG7a8mRfPPXUyhEYj5RzXCQmGrlP3tAh0L3HHm5AjBMFYRqlM9SA==}
dependencies:
'@lit-labs/ssr-dom-shim': 1.1.1
dev: true
/@mapbox/node-pre-gyp@1.0.10: /@mapbox/node-pre-gyp@1.0.10:
resolution: {integrity: sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==} resolution: {integrity: sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==}
hasBin: true hasBin: true
@ -3582,6 +3609,10 @@ packages:
resolution: {integrity: sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==} resolution: {integrity: sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==}
dev: true dev: true
/@types/trusted-types@2.0.3:
resolution: {integrity: sha512-NfQ4gyz38SL8sDNrSixxU2Os1a5xcdFxipAFxYEuLUlvU2uDwS4NUpsImcf1//SlWItCVMMLiylsxbmNMToV/g==}
dev: true
/@types/undertaker-registry@1.0.1: /@types/undertaker-registry@1.0.1:
resolution: {integrity: sha512-Z4TYuEKn9+RbNVk1Ll2SS4x1JeLHecolIbM/a8gveaHsW0Hr+RQMraZACwTO2VD7JvepgA6UO1A1VrbktQrIbQ==} resolution: {integrity: sha512-Z4TYuEKn9+RbNVk1Ll2SS4x1JeLHecolIbM/a8gveaHsW0Hr+RQMraZACwTO2VD7JvepgA6UO1A1VrbktQrIbQ==}
dev: true dev: true
@ -10073,6 +10104,28 @@ packages:
wrap-ansi: 7.0.0 wrap-ansi: 7.0.0
dev: true dev: true
/lit-element@3.3.2:
resolution: {integrity: sha512-xXAeVWKGr4/njq0rGC9dethMnYCq5hpKYrgQZYTzawt9YQhMiXfD+T1RgrdY3NamOxwq2aXlb0vOI6e29CKgVQ==}
dependencies:
'@lit-labs/ssr-dom-shim': 1.1.1
'@lit/reactive-element': 1.6.1
lit-html: 2.7.4
dev: true
/lit-html@2.7.4:
resolution: {integrity: sha512-/Jw+FBpeEN+z8X6PJva5n7+0MzCVAH2yypN99qHYYkq8bI+j7I39GH+68Z/MZD6rGKDK9RpzBw7CocfmHfq6+g==}
dependencies:
'@types/trusted-types': 2.0.3
dev: true
/lit@2.7.4:
resolution: {integrity: sha512-cgD7xrZoYr21mbrkZIuIrj98YTMw/snJPg52deWVV4A8icLyNHI3bF70xsJeAgwTuiq5Kkd+ZR8gybSJDCPB7g==}
dependencies:
'@lit/reactive-element': 1.6.1
lit-element: 3.3.2
lit-html: 2.7.4
dev: true
/load-json-file@1.1.0: /load-json-file@1.1.0:
resolution: {integrity: sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==} resolution: {integrity: sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}