upd: add a download button to videos and audio

this only works for media from the same origin due to annoying browser
restrictions, but then the same applies to every other download button
in misskey (e.g. the one in drive) and there's basically nothing i can
to do solve it.
This commit is contained in:
ShittyKopper 2024-01-24 19:26:28 +03:00
parent d19812eba9
commit 8a55d8a468
3 changed files with 10 additions and 0 deletions

View file

@ -32,6 +32,9 @@ SPDX-License-Identifier: AGPL-3.0-only
</button> </button>
</div> </div>
<div :class="[$style.controlsChild, $style.controlsRight]"> <div :class="[$style.controlsChild, $style.controlsRight]">
<a class="_button" :class="$style.controlButton" :href="audio.url" :download="audio.name" target="_blank">
<i class="ph-download ph-bold ph-lg"></i>
</a>
<button class="_button" :class="$style.controlButton" @click="showMenu"> <button class="_button" :class="$style.controlButton" @click="showMenu">
<i class="ph-gear ph-bold ph-lg"></i> <i class="ph-gear ph-bold ph-lg"></i>
</button> </button>

View file

@ -51,6 +51,9 @@ SPDX-License-Identifier: AGPL-3.0-only
</button> </button>
</div> </div>
<div :class="[$style.controlsChild, $style.controlsRight]"> <div :class="[$style.controlsChild, $style.controlsRight]">
<a class="_button" :class="$style.controlButton" :href="video.url" :download="video.name" target="_blank">
<i class="ph-download ph-bold ph-lg"></i>
</a>
<button class="_button" :class="$style.controlButton" @click="showMenu"> <button class="_button" :class="$style.controlButton" @click="showMenu">
<i class="ph-settings ph-bold ph-lg"></i> <i class="ph-settings ph-bold ph-lg"></i>
</button> </button>

View file

@ -253,6 +253,10 @@ rt {
line-height: inherit; line-height: inherit;
max-width: 100%; max-width: 100%;
&:hover {
text-decoration: none;
}
&:focus-visible { &:focus-visible {
outline: none; outline: none;
} }