Detect coracle links and open them inline

This commit is contained in:
Jon Staab 2024-06-12 16:27:17 -07:00
parent b132867967
commit e9b24d5f1d
2 changed files with 11 additions and 3 deletions

View File

@ -323,9 +323,9 @@
<Popover theme="transparent" opts={{hideOnClick: true}}>
<button
slot="trigger"
class="relative flex items-center gap-1 pt-1 transition-all hover:pb-1 hover:pt-0"
class="relative flex items-center gap-1 pt-1 transition-all hover:pb-1 hover:pt-0 h-6"
on:click={showHandlersPopover}>
<i class="fa fa-up-right-from-square" />
<i class="fa fa-up-right-from-square fa-sm" />
</button>
<div slot="tooltip" class="max-h-[300px] min-w-[180px] overflow-auto">
<Menu>

View File

@ -17,7 +17,15 @@
let hidden = false
</script>
{#if showMedia && value.isMedia && !hidden}
{#if url.includes('coracle.social/')}
<Anchor
modal
stopPropagation
class="overflow-hidden text-ellipsis whitespace-nowrap underline"
href={url.replace(/(https?:\/\/)?(app\.)?coracle.social/, '')}>
{displayUrl(url)}
</Anchor>
{:else if showMedia && value.isMedia && !hidden}
<div class="py-2">
<Media url={url} onClose={close} />
</div>