{{ i18n.ts.sensitive }}{{ defaultStore.state.enableDataSaverMode ? ` (${i18n.ts.image}${image.size ? ' ' + bytes(image.size) : ''})` : '' }}
@@ -20,8 +20,10 @@
+
@@ -33,6 +35,8 @@ import bytes from '@/filters/bytes';
import ImgWithBlurhash from '@/components/MkImgWithBlurhash.vue';
import { defaultStore } from '@/store';
import { i18n } from '@/i18n';
+import * as os from '@/os';
+import { iAmModerator } from '@/account';
const props = defineProps<{
image: misskey.entities.DriveFile;
@@ -46,7 +50,7 @@ const url = $computed(() => (props.raw || defaultStore.state.loadRawImages)
? props.image.url
: defaultStore.state.disableShowingAnimatedImages
? getStaticImageUrl(props.image.url)
- : props.image.thumbnailUrl
+ : props.image.thumbnailUrl,
);
// Plugin:register_note_view_interruptor を使って書き換えられる可能性があるためwatchする
@@ -56,6 +60,17 @@ watch(() => props.image, () => {
deep: true,
immediate: true,
});
+
+function showMenu(ev: MouseEvent) {
+ os.popupMenu([...(iAmModerator ? [{
+ text: i18n.ts.markAsSensitive,
+ icon: 'ti ti-eye-off',
+ action: () => {
+ os.apiWithDialog('drive/files/update', { fileId: props.image.id, isSensitive: true });
+ },
+ }] : [])], ev.currentTarget ?? ev.target);
+}
+
diff --git a/packages/frontend/src/components/MkMediaList.vue b/packages/frontend/src/components/MkMediaList.vue
index d28c78fe5..e456ff3ee 100644
--- a/packages/frontend/src/components/MkMediaList.vue
+++ b/packages/frontend/src/components/MkMediaList.vue
@@ -7,7 +7,6 @@
:class="[
$style.medias,
count <= 4 ? $style['n' + count] : $style.nMany,
- $style[`n1${defaultStore.reactiveState.mediaListWithOneImageAppearance.value}`]
]"
>
@@ -44,37 +43,6 @@ const pswpZIndex = os.claimZIndex('middle');
document.documentElement.style.setProperty('--mk-pswp-root-z-index', pswpZIndex.toString());
const count = $computed(() => props.mediaList.filter(media => previewable(media)).length);
-function calcAspectRatio() {
- if (!gallery.value) return;
-
- let img = props.mediaList[0];
-
- if (props.mediaList.length !== 1 || !(img.properties.width && img.properties.height)) {
- gallery.value.style.aspectRatio = '';
- return;
- }
-
- // アスペクト比上限設定では、横長の場合は高さを縮小させる
- const ratioMax = (ratio: number) => `${Math.max(ratio, img.properties.width / img.properties.height).toString()} / 1`;
-
- switch (defaultStore.state.mediaListWithOneImageAppearance) {
- case '16_9':
- gallery.value.style.aspectRatio = ratioMax(16 / 9);
- break;
- case '1_1':
- gallery.value.style.aspectRatio = ratioMax(1);
- break;
- case '2_3':
- gallery.value.style.aspectRatio = ratioMax(2 / 3);
- break;
- default:
- gallery.value.style.aspectRatio = '';
- break;
- }
-}
-
-watch([defaultStore.reactiveState.mediaListWithOneImageAppearance, gallery], () => calcAspectRatio());
-
onMounted(() => {
const lightbox = new PhotoSwipeLightbox({
dataSource: props.mediaList
@@ -194,36 +162,12 @@ const previewable = (file: misskey.entities.DriveFile): boolean => {
display: grid;
grid-gap: 8px;
+ // for webkit
height: 100%;
&.n1 {
+ aspect-ratio: 16/9;
grid-template-rows: 1fr;
-
- // default (expand)
- min-height: 64px;
- max-height: clamp(
- 64px,
- calc(var(--containerHeight, 100svh) * 0.5), // but --containerHeight can broken (too big)
- min(334px, 50vh)
- );
-
- &.n116_9 {
- min-height: none;
- max-height: none;
- aspect-ratio: 16 / 9; // fallback
- }
-
- &.n11_1{
- min-height: none;
- max-height: none;
- aspect-ratio: 1 / 1; // fallback
- }
-
- &.n12_3 {
- min-height: none;
- max-height: none;
- aspect-ratio: 2 / 3; // fallback
- }
}
&.n2 {
diff --git a/packages/frontend/src/components/MkModalWindow.vue b/packages/frontend/src/components/MkModalWindow.vue
index 2d2f8411f..63c55b904 100644
--- a/packages/frontend/src/components/MkModalWindow.vue
+++ b/packages/frontend/src/components/MkModalWindow.vue
@@ -1,15 +1,15 @@
-
-