More things
Some checks failed
Test / test (push) Failing after 5s
Build and Deploy Nuxt / build (push) Successful in 2m3s

This commit is contained in:
2026-11-20 18:59:01 +01:00
parent b83f64ff9e
commit d61659cfdd
51 changed files with 1777 additions and 3817 deletions

View File

@@ -1,6 +1,6 @@
<script setup>
import { onBeforeUnmount, onMounted, ref } from 'vue';
import { SetupHandle, SetSize, ResetPosition, ClearWindow } from '@/services/Windows';
import { SetupHandle, SetSize, ResetPosition, ClearWindow, Top } from '@/services/Windows';
import WindowHandle from './partials/WindowHandle.vue';
import Server from '~/services/Server';
import { emitter } from '~/services/Emitter';
@@ -34,6 +34,7 @@ function initialForm() {
const form = ref(initialForm());
onMounted(() => {
Top(wrapper);
SetupHandle(id, handle);
SetSize(id, isActor ? { width: 420, height: 220 } : { width: 500, height: 560 });
ResetPosition(id, 'center');
@@ -71,7 +72,6 @@ async function saveEntry() {
<WindowHandle :window="id" ref="handle" />
<div class="body">
<h3>{{ $t(editing ? 'campaigns.item.edit' : (isActor ? 'campaigns.actor.new' : 'campaigns.item.new')) }}</h3>
<p v-if="!isActor && editing?.foundryItemId" class="sync-note">{{ $t('campaigns.item.foundry-sync-note') }}</p>
<form @submit.prevent="saveEntry">
<label class="form-field">
<span>{{ $t('campaigns.fields.name') }}</span>
@@ -134,7 +134,6 @@ async function saveEntry() {
.window-wrapper { display: flex; align-items: center; flex-direction: column; }
.body { width: 100%; padding: 10px 18px 16px; overflow-y: auto; }
h3 { margin: 0 0 12px; font-family: MrEavesRemake; }
.sync-note { margin: -8px 0 12px; font-size: 12px; opacity: 0.72; }
form { display: flex; flex-direction: column; gap: 10px; }
.form-field { min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

View File

@@ -0,0 +1,57 @@
<script setup>
import { computed, onMounted, ref } from 'vue';
import { SetupHandle, SetSize, ResetPosition, Top } from '@/services/Windows';
import { getBaseUrl } from '~/services/Server';
import WindowHandle from './partials/WindowHandle.vue';
// One media file of the note tree, shown in a window of its own: an image fills it, a sound and a
// video play in it, and anything else (a PDF, a document) is offered as a link to open.
const props = defineProps(['data']);
const id = props.data.id;
const media = props.data.media;
const handle = ref(null);
const wrapper = ref(null);
const url = computed(() => media?.file ? `${getBaseUrl()}/public/${media.file}` : '');
const kind = computed(() => {
const type = media?.mimeType ?? '';
if (type.startsWith('image/')) return 'image';
if (type.startsWith('audio/')) return 'audio';
if (type.startsWith('video/')) return 'video';
return 'file';
});
onMounted(() => {
Top(wrapper);
SetupHandle(id, handle);
SetSize(id, {
width: Math.max(420, Math.min(900, window.innerWidth - 24)),
height: Math.max(320, Math.min(700, window.innerHeight - 32))
});
ResetPosition(id, 'center');
});
</script>
<template>
<div class="window-wrapper media-window" :id="'window-wrapper-' + id" ref="wrapper">
<WindowHandle :window="id" ref="handle" />
<div class="media-body">
<img v-if="kind === 'image'" class="media-image" :src="url" :alt="media?.name">
<audio v-else-if="kind === 'audio'" :src="url" controls></audio>
<video v-else-if="kind === 'video'" :src="url" controls></video>
<a v-else class="media-file" :href="url" target="_blank" rel="noopener">{{ media?.name }}</a>
</div>
</div>
</template>
<style scoped>
.media-window { min-width: 320px; min-height: 0; }
.media-body {
flex: 1; min-height: 0; box-sizing: border-box; padding: 10px;
display: flex; align-items: center; justify-content: center; overflow: auto;
}
.media-image { max-width: 100%; max-height: 100%; object-fit: contain; }
audio, video { max-width: 100%; }
.media-file { color: var(--color-link); word-break: break-word; }
</style>

View File

@@ -1,6 +1,6 @@
<script setup>
import { onBeforeUnmount, onMounted, ref } from 'vue';
import { SetupHandle, SetSize, ResetPosition, ClearWindow } from '@/services/Windows';
import { SetupHandle, SetSize, ResetPosition, ClearWindow, Top } from '@/services/Windows';
import WindowHandle from './partials/WindowHandle.vue';
import Server from '~/services/Server';
import { emitter } from '~/services/Emitter';
@@ -18,6 +18,7 @@ const creating = !!data.name;
onMounted(() => {
newName.value = data.name || '';
Top(wrapper);
SetupHandle(id, handle);
SetSize(id, { width: 420, height: 200 });
ResetPosition(id, 'center');

View File

@@ -1,6 +1,6 @@
<script setup>
import { onBeforeUnmount, onMounted, ref } from 'vue';
import { SetupHandle, SetSize, ResetPosition, ClearWindow } from '@/services/Windows';
import { SetupHandle, SetSize, ResetPosition, ClearWindow, Top } from '@/services/Windows';
import WindowHandle from './partials/WindowHandle.vue';
import Server from '~/services/Server';
import { emitter } from '~/services/Emitter';
@@ -17,6 +17,7 @@ const newName = ref('');
onMounted(() => {
newName.value = data.title || '';
Top(wrapper);
SetupHandle(id, handle);
SetSize(id, { width: 420, height: 200 });
ResetPosition(id, 'center');