From 228f7b230ba2b4374e4227193de1c21c96a02afd Mon Sep 17 00:00:00 2001 From: Qwreey Date: Thu, 2 Nov 2023 22:13:47 +0000 Subject: [PATCH 1/2] feat: double click to open nsfw media --- locales/en-US.yml | 4 +++ locales/index.d.ts | 5 ++++ locales/ja-JP.yml | 5 ++++ locales/ko-KR.yml | 4 +++ .../frontend/src/components/MkMediaImage.vue | 26 +++++++++++++++---- .../frontend/src/components/MkMediaList.vue | 8 ++++++ .../frontend/src/pages/settings/general.vue | 7 +++++ packages/frontend/src/store.ts | 4 +++ 8 files changed, 58 insertions(+), 5 deletions(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index 234fb183a2..0eda5b40d1 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1246,6 +1246,7 @@ additionalPermissionsForFlash: "Allow to add permission to Play" thisFlashRequiresTheFollowingPermissions: "This Play requires the following permissions" doYouWantToAllowThisPlayToAccessYourAccount: "Do you want to allow this Play to access your account?" translateProfile: "Translate profile" +nsfwOpenBehavior: "NSFW media open behavior" _vibrations: click: "When an element is clicked" note: "When a new note is posted on the timeline" @@ -2521,3 +2522,6 @@ _imageCompressionMode: noResizeCompress: "Compression without resize" resizeCompressLossy: "Resize and lossy compression" noResizeCompressLossy: "Lossy compression without resize" +_nsfwOpenBehavior: + click: "Click to open" + doubleClick: "Double click to open" diff --git a/locales/index.d.ts b/locales/index.d.ts index b9af2a734c..524cb989d3 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -1251,6 +1251,7 @@ export interface Locale { "thisFlashRequiresTheFollowingPermissions": string; "doYouWantToAllowThisPlayToAccessYourAccount": string; "translateProfile": string; + "nsfwOpenBehavior": string; "_vibrations": { "click": string; "note": string; @@ -2708,6 +2709,10 @@ export interface Locale { }; }; }; + "_nsfwOpenBehavior": { + "click": string; + "doubleClick": string; + }; } declare const locales: { [lang: string]: Locale; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index a58bde1844..84b277ea35 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1248,6 +1248,7 @@ additionalPermissionsForFlash: "Playへの追加許可" thisFlashRequiresTheFollowingPermissions: "このPlayは以下の権限を要求しています" doYouWantToAllowThisPlayToAccessYourAccount: "このPlayによるアカウントへのアクセスを許可しますか?" translateProfile: "プロフィールを翻訳する" +nsfwOpenBehavior: "閲覧注意の開き方" _vibrations: click: "要素をクリックしたとき" @@ -2603,3 +2604,7 @@ _externalResourceInstaller: _themeInstallFailed: title: "テーマのインストールに失敗しました" description: "テーマのインストール中に問題が発生しました。もう一度お試しください。エラーの詳細はJavascriptコンソールをご覧ください。" + +_nsfwOpenBehavior: + click: "タップして開く" + doubleClick: "二回タップして開く" diff --git a/locales/ko-KR.yml b/locales/ko-KR.yml index a108b9994c..3fbc0deb70 100644 --- a/locales/ko-KR.yml +++ b/locales/ko-KR.yml @@ -1223,6 +1223,7 @@ additionalPermissionsForFlash: "Play에 대한 추가 권한" thisFlashRequiresTheFollowingPermissions: "이 Play는 다음 권한을 요구해요" doYouWantToAllowThisPlayToAccessYourAccount: "이 Play가 계정에 접근하도록 허용할까요?" translateProfile: "프로필 번역하기" +nsfwOpenBehavior: "열람주의 여는 방법" _vibrations: click: "요소를 클릭했을 때" note: "타임라인에 새 노트가 올라왔을 때" @@ -2447,3 +2448,6 @@ _externalResourceInstaller: _themeInstallFailed: title: "테마 설치에 실패했어요" description: "테마를 설치하는 동안 문제가 발생했어요. 다시 시도해 주세요. 오류에 대한 자세한 내용은 자바스크립트 콘솔을 참고해 주세요." +_nsfwOpenBehavior: + click: "탭하여 열기" + doubleClick: "더블 탭 하여 열기" diff --git a/packages/frontend/src/components/MkMediaImage.vue b/packages/frontend/src/components/MkMediaImage.vue index 7ca10e0bc7..1dc15b2c8c 100644 --- a/packages/frontend/src/components/MkMediaImage.vue +++ b/packages/frontend/src/components/MkMediaImage.vue @@ -4,10 +4,10 @@ SPDX-License-Identifier: AGPL-3.0-only -->