@christianriedl/media 1.0.252 → 1.0.254
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { inject, ref, toRef, computed, onMounted, watch } from 'vue';
|
|
4
4
|
import { GoogleMap } from 'vue3-google-map'
|
|
5
5
|
import { authorizeSymbol } from '@christianriedl/rest';
|
|
6
|
-
import { IPhotoMarker, IPhotoRegion, IPictureFile, getMediaBinSymbol, EOrientation } from '@christianriedl/media';
|
|
6
|
+
import { IPhotoMarker, IPhotoRegion, IPictureFile, getMediaBinSymbol, EOrientation, MediaHelper } from '@christianriedl/media';
|
|
7
7
|
|
|
8
8
|
const props = defineProps<{ location: string, zoom: number, selectRegion?: IPhotoRegion, fotos?: IPhotoMarker[] }>();
|
|
9
9
|
const emits = defineEmits<{ (e: 'select', value: IPhotoRegion): void }>();
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
const photoWidth = ref(0);
|
|
42
42
|
const photoLeft = ref({ 'left': '0px' });
|
|
43
43
|
let photoUrl = "";
|
|
44
|
+
let photoTitle = "";
|
|
44
45
|
|
|
45
46
|
watch(fotosRef, () => showFotos(props.fotos!));
|
|
46
47
|
watch(locationRef, () => {
|
|
@@ -231,6 +232,7 @@
|
|
|
231
232
|
const albumUrl = mediaService.getFolder(photo.dlnaParentId).url;
|
|
232
233
|
photoUrl = mediaService.getPhotoUrl(albumUrl, photo.url, `${0}x${photoHeight.value}x${photo.orientation}x70`);
|
|
233
234
|
console.log (`left:${left} w:${photoWidth.value} h:${photoHeight.value} : ${photoUrl}`);
|
|
235
|
+
photoTitle = photo.title ? photo.title ? photo.name;
|
|
234
236
|
showPhoto.value = true;
|
|
235
237
|
}
|
|
236
238
|
function createPin(loc: google.maps.LatLng, text: string, color: string, background: string): google.maps.marker.AdvancedMarkerElement {
|
|
@@ -264,7 +266,8 @@
|
|
|
264
266
|
<google-map ref="mapRef" class="map" :style="mapSizeStyle" :apiKey="apiKey" mapId="60c7744a5bdbb04ae71bd377" :zoom="props.zoom">
|
|
265
267
|
</google-map>
|
|
266
268
|
<v-dialog v-model="showPhoto">
|
|
267
|
-
<v-card
|
|
269
|
+
<v-card-title>{{photoTitle}}</v-card-title>
|
|
270
|
+
<v-card :style="photoLeft" :width="photoWidth + 50" :height="photoHeight + 140">
|
|
268
271
|
<v-card-text>
|
|
269
272
|
<v-img :src="photoUrl" :height="photoHeight" ></v-img>
|
|
270
273
|
</v-card-text>
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
const selectMode = ref<boolean>(false);
|
|
35
35
|
const showDownload = ref(false);
|
|
36
36
|
const showLocation = ref(false);
|
|
37
|
-
const showText = ref("
|
|
37
|
+
const showText = ref("");
|
|
38
38
|
let selectedFotos: IPictureFile[] | undefined;
|
|
39
39
|
// GPS selection
|
|
40
40
|
const center = ref("Wien");
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
let latLength = 0;
|
|
49
49
|
let lngLength = 0;
|
|
50
50
|
let selectedRegion: IPhotoRegion = { latLength: 0, lngLength: 0, latFrom: 0, lngFrom: 0, latTo: 0, lngTo: 0 };
|
|
51
|
+
setShowText();
|
|
51
52
|
|
|
52
53
|
onMounted(async () => {
|
|
53
54
|
//if (mediaAppConfig.useMediaBin) {
|
|
@@ -87,15 +88,15 @@
|
|
|
87
88
|
titles.value = await MediaHelper.getPhotoTitles(mediaService, mediaService.photoSelection.rating, withLocation.value, withPerson.value);
|
|
88
89
|
}
|
|
89
90
|
async function onTitleChanged() {
|
|
90
|
-
if (isMobile
|
|
91
|
+
if (isMobile && title.value.length < 3)
|
|
91
92
|
return;
|
|
92
93
|
selectedFotos = await MediaHelper.searchPictures (mediaService, title.value, withPerson.value, withLocation.value, mediaService.photoSelection.rating, 100000);
|
|
93
|
-
|
|
94
|
+
setShowText();
|
|
94
95
|
}
|
|
95
96
|
async function onShow() {
|
|
96
97
|
if (!selectedFotos) {
|
|
97
98
|
selectedFotos = await MediaHelper.searchPictures (mediaService, title.value, withPerson.value, withLocation.value, mediaService.photoSelection.rating, mediaAppConfig.pictureSearchLimit);
|
|
98
|
-
|
|
99
|
+
setShowText();
|
|
99
100
|
}
|
|
100
101
|
photos.value.splice(0, photos.value.length, ...selectedFotos);
|
|
101
102
|
console.log(photos.value.length);
|
|
@@ -146,6 +147,16 @@
|
|
|
146
147
|
window.alert(`Not Pasted : ${err} !`);
|
|
147
148
|
}
|
|
148
149
|
}
|
|
150
|
+
function setShowText() {
|
|
151
|
+
if (selectedFotos) {
|
|
152
|
+
if (isMobile)
|
|
153
|
+
showText.value = `${selectedFotos.length}`;
|
|
154
|
+
else
|
|
155
|
+
showText.value = `SHOW ${selectedFotos.length}`;
|
|
156
|
+
}
|
|
157
|
+
else
|
|
158
|
+
showText.value = isMobile ? "0" : "SHOW 0";
|
|
159
|
+
}
|
|
149
160
|
function onDownload() {
|
|
150
161
|
showDownload.value = true;
|
|
151
162
|
}
|
|
@@ -170,7 +181,7 @@
|
|
|
170
181
|
showGps.value = false;
|
|
171
182
|
if (selectedRegion) {
|
|
172
183
|
selectedFotos = await MediaHelper.searchPicturesGPS(mediaService, selectedRegion.latFrom, selectedRegion.latTo, selectedRegion.lngFrom, selectedRegion.lngTo, mediaService.photoSelection.rating);
|
|
173
|
-
|
|
184
|
+
setShowText();
|
|
174
185
|
}
|
|
175
186
|
}
|
|
176
187
|
async function onGpsSelect (region: IPhotoRegion) {
|
|
@@ -179,7 +190,7 @@
|
|
|
179
190
|
if (region.key) {
|
|
180
191
|
selectedFotos = foundMap.get(region.key);
|
|
181
192
|
if (selectedFotos) {
|
|
182
|
-
|
|
193
|
+
setShowText();
|
|
183
194
|
photos.value.splice(0, photos.value.length, ...selectedFotos);
|
|
184
195
|
console.log(photos.value.length);
|
|
185
196
|
showGps.value = false;
|
|
@@ -255,9 +266,10 @@
|
|
|
255
266
|
<v-checkbox v-model="withPerson" hide-details density="compact" label="Pers" @update:modelValue="onLocPersChanged"></v-checkbox>
|
|
256
267
|
</v-col>
|
|
257
268
|
<v-col cols="2">
|
|
258
|
-
<v-btn v-if="isMobile" icon="$
|
|
269
|
+
<v-btn v-if="isMobile" icon="$gps" density="compact" variant="tonal" @click="onGps"></v-btn>
|
|
270
|
+
<v-btn v-else prepend-icon="$gps" variant="tonal" @click="onGps">GPS</v-btn>
|
|
271
|
+
<v-btn v-if="isMobile" icon="$search" density="compact" variant="tonal" @click="onShow"></v-btn>
|
|
259
272
|
<v-btn v-else prepend-icon="$search" variant="tonal" @click="onShow">{{showText}}</v-btn>
|
|
260
|
-
<v-btn v-if="!isMobile" prepend-icon="$gps" variant="tonal" @click="onGps">GPS</v-btn>
|
|
261
273
|
</v-col>
|
|
262
274
|
</v-row>
|
|
263
275
|
<v-row v-if="mediaAppConfig.showThumbnailText" dense align="center" >
|