Feature: add link to the original provider, see #2387

This commit is contained in:
Pieter Vander Vennet 2025-04-23 21:35:43 +02:00
parent 991925ba35
commit 3e5b1444cc
10 changed files with 51 additions and 5 deletions

View file

@ -22,6 +22,7 @@
import { MenuState } from "../../Models/MenuState"
import ThemeViewState from "../../Models/ThemeViewState"
import Panorama360 from "../../assets/svg/Panorama360.svelte"
import { ExternalLinkIcon } from "@rgossiaux/svelte-heroicons/solid"
export let image: Partial<ProvidedImage> & { id: string; url: string }
let fallbackImage: string = undefined
@ -40,6 +41,7 @@
| Store<Feature<Geometry, HotspotProperties>[]> = []
let loaded = false
let visitUrl = image.provider.visitUrl(image)
let showBigPreview = new UIEventSource(false)
onDestroy(
showBigPreview.addCallbackAndRun((shown) => {
@ -110,9 +112,13 @@
on:mouseenter={() => highlight()}
on:mouseleave={() => highlight(false)}
>
{#if $$slots["dot-menu-actions"]}
{#if $$slots["dot-menu-actions"] || visitUrl !== undefined}
<DotMenu dotsPosition="top-0 left-0 absolute" hideBackground>
<slot name="dot-menu-actions" />
<a href={visitUrl} target="_blank" rel="noopener">
<ExternalLinkIcon class="w-6" />
<Tr t={Translations.t.image.openOnWebsite.Subs(image.provider)} />
</a>
</DotMenu>
{/if}
{#if !loaded}