Merge branches 'develop' and 'develop' of codeberg.org:calckey/calckey into develop

This commit is contained in:
ThatOneCalculator 2023-06-26 14:50:19 -07:00
commit 2e5af9c94a
No known key found for this signature in database
GPG key ID: 8703CACD01000000
11 changed files with 179 additions and 58 deletions

View file

@ -385,12 +385,13 @@ _cw:
chars: '{count} caràcters' chars: '{count} caràcters'
_visibility: _visibility:
followers: "Seguidors" followers: "Seguidors"
publicDescription: La teva publicació serà visible per a tots els usuaris publicDescription: La teva publicació serà visible per a totes les línies de temps
públiques
localOnly: Només Local localOnly: Només Local
specified: Directe specified: Directe
home: Sense llistar home: Sense llistar
homeDescription: Publica només a la línea de temps local homeDescription: Publica només a la línea de temps local
followersDescription: Fes visible només per als teus seguidors followersDescription: Fes visible només per als teus seguidors i usuaris mencionats
specifiedDescription: Fer visible només per a usuaris determinats specifiedDescription: Fer visible només per a usuaris determinats
public: Públic public: Públic
localOnlyDescription: No és visible per als usuaris remots localOnlyDescription: No és visible per als usuaris remots
@ -2031,11 +2032,12 @@ _auth:
shareAccessAsk: Estàs segur que vols autoritzar aquesta aplicació per accedir al shareAccessAsk: Estàs segur que vols autoritzar aquesta aplicació per accedir al
teu compte? teu compte?
shareAccess: Vols autoritzar "{name}" per accedir a aquest compte? shareAccess: Vols autoritzar "{name}" per accedir a aquest compte?
permissionAsk: Aquesta aplicació sol·licita els següents permisos permissionAsk: 'Aquesta aplicació sol·licita els següents permisos:'
callback: Tornant a l'aplicació callback: Tornant a l'aplicació
denied: Accés denegat denied: Accés denegat
pleaseGoBack: Si us plau, torneu a l'aplicació pleaseGoBack: Si us plau, torneu a l'aplicació
copyAsk: Posa el següent codi d'autorització a l'aplicació copyAsk: "Posa el següent codi d'autorització a l'aplicació:"
allPermissions: Accés complet al compte
_weekday: _weekday:
wednesday: Dimecres wednesday: Dimecres
saturday: Dissabte saturday: Dissabte

View file

@ -941,6 +941,7 @@ deleteAccountConfirm: "This will irreversibly delete your account. Proceed?"
incorrectPassword: "Incorrect password." incorrectPassword: "Incorrect password."
voteConfirm: "Confirm your vote for \"{choice}\"?" voteConfirm: "Confirm your vote for \"{choice}\"?"
hide: "Hide" hide: "Hide"
alt: "ALT"
leaveGroup: "Leave group" leaveGroup: "Leave group"
leaveGroupConfirm: "Are you sure you want to leave \"{name}\"?" leaveGroupConfirm: "Are you sure you want to leave \"{name}\"?"
useDrawerReactionPickerForMobile: "Display reaction picker as drawer on mobile" useDrawerReactionPickerForMobile: "Display reaction picker as drawer on mobile"

View file

@ -196,7 +196,13 @@ export default async (
data.channel = await Channels.findOneBy({ id: data.reply.channelId }); data.channel = await Channels.findOneBy({ id: data.reply.channelId });
} }
if (data.createdAt == null) data.createdAt = new Date(); const now = new Date();
if (
!data.createdAt ||
isNaN(data.createdAt.getTime()) ||
data.createdAt > now
)
data.createdAt = now;
if (data.visibility == null) data.visibility = "public"; if (data.visibility == null) data.visibility = "public";
if (data.localOnly == null) data.localOnly = false; if (data.localOnly == null) data.localOnly = false;
if (data.channel != null) data.visibility = "public"; if (data.channel != null) data.visibility = "public";

View file

@ -196,6 +196,7 @@ export default defineComponent({
&.scrollable { &.scrollable {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
flex-grow: 1;
> .content { > .content {
overflow: auto; overflow: auto;

View file

@ -16,25 +16,34 @@
</div> </div>
</button> </button>
<div v-else class="gqnyydlz"> <div v-else class="gqnyydlz">
<a :href="image.url" :title="image.name"> <a :href="image.url">
<ImgWithBlurhash <ImgWithBlurhash
:hash="image.blurhash" :hash="image.blurhash"
:src="url" :src="url"
:alt="image.comment" :alt="image.comment"
:type="image.type" :type="image.type"
:title="image.comment"
:cover="false" :cover="false"
/> />
<div v-if="image.type === 'image/gif'" class="gif">GIF</div> <div v-if="image.type === 'image/gif'" class="gif">GIF</div>
</a> </a>
<div class="buttons">
<button
v-if="image.comment"
v-tooltip="i18n.ts.alt"
class="_button"
@click.stop="captionPopup"
>
<i class="ph-subtitles ph-bold ph-lg"></i>
</button>
<button <button
v-tooltip="i18n.ts.hide" v-tooltip="i18n.ts.hide"
class="_button hide" class="_button"
@click="hide = true" @click="hide = true"
> >
<i class="ph-eye-slash ph-bold ph-lg"></i> <i class="ph-eye-slash ph-bold ph-lg"></i>
</button> </button>
</div> </div>
</div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -44,6 +53,8 @@ import { getStaticImageUrl } from "@/scripts/get-static-image-url";
import ImgWithBlurhash from "@/components/MkImgWithBlurhash.vue"; import ImgWithBlurhash from "@/components/MkImgWithBlurhash.vue";
import { defaultStore } from "@/store"; import { defaultStore } from "@/store";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import * as os from "@/os";
const props = defineProps<{ const props = defineProps<{
image: misskey.entities.DriveFile; image: misskey.entities.DriveFile;
@ -59,6 +70,13 @@ const url =
? getStaticImageUrl(props.image.thumbnailUrl) ? getStaticImageUrl(props.image.thumbnailUrl)
: props.image.thumbnailUrl; : props.image.thumbnailUrl;
function captionPopup() {
os.alert({
type: "info",
text: props.image.comment
})
}
// Plugin:register_note_view_interruptor 使watch // Plugin:register_note_view_interruptor 使watch
watch( watch(
() => props.image, () => props.image,
@ -110,10 +128,15 @@ watch(
position: relative; position: relative;
background: var(--bg); background: var(--bg);
> .hide { > .buttons {
display: block; display: flex;
gap: 4px;
position: absolute; position: absolute;
border-radius: 6px; border-radius: 6px;
overflow: hidden;
top: 12px;
right: 12px;
> * {
background-color: var(--accentedBg); background-color: var(--accentedBg);
-webkit-backdrop-filter: var(--blur, blur(15px)); -webkit-backdrop-filter: var(--blur, blur(15px));
backdrop-filter: var(--blur, blur(15px)); backdrop-filter: var(--blur, blur(15px));
@ -121,11 +144,6 @@ watch(
font-size: 0.8em; font-size: 0.8em;
padding: 6px 8px; padding: 6px 8px;
text-align: center; text-align: center;
top: 12px;
right: 12px;
> i {
display: block;
} }
} }

View file

@ -32,7 +32,6 @@
> >
<video <video
:poster="video.thumbnailUrl" :poster="video.thumbnailUrl"
:title="video.comment"
:aria-label="video.comment" :aria-label="video.comment"
preload="none" preload="none"
controls controls
@ -41,14 +40,24 @@
<source :src="video.url" :type="video.type" /> <source :src="video.url" :type="video.type" />
</video> </video>
</VuePlyr> </VuePlyr>
<div class="buttons">
<button
v-if="video.comment"
v-tooltip="i18n.ts.alt"
class="_button"
@click.stop="captionPopup"
>
<i class="ph-subtitles ph-bold ph-lg"></i>
</button>
<button <button
v-tooltip="i18n.ts.hide" v-tooltip="i18n.ts.hide"
class="_button hide" class="_button"
@click="hide = true" @click="hide = true"
> >
<i class="ph-eye-slash ph-bold ph-lg"></i> <i class="ph-eye-slash ph-bold ph-lg"></i>
</button> </button>
</div> </div>
</div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -58,6 +67,7 @@ import type * as misskey from "calckey-js";
import { defaultStore } from "@/store"; import { defaultStore } from "@/store";
import "vue-plyr/dist/vue-plyr.css"; import "vue-plyr/dist/vue-plyr.css";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import * as os from "@/os";
const props = defineProps<{ const props = defineProps<{
video: misskey.entities.DriveFile; video: misskey.entities.DriveFile;
@ -72,6 +82,13 @@ const hide = ref(
: props.video.isSensitive && defaultStore.state.nsfw !== "ignore" : props.video.isSensitive && defaultStore.state.nsfw !== "ignore"
); );
function captionPopup() {
os.alert({
type: "info",
text: props.video.comment
})
}
onMounted(() => { onMounted(() => {
mini.value = plyr.value.player.media.scrollWidth < 300; mini.value = plyr.value.player.media.scrollWidth < 300;
if (mini.value) { if (mini.value) {
@ -87,10 +104,15 @@ onMounted(() => {
position: relative; position: relative;
--plyr-color-main: var(--accent); --plyr-color-main: var(--accent);
> .hide { > .buttons {
display: block; display: flex;
gap: 4px;
position: absolute; position: absolute;
border-radius: 6px; border-radius: 6px;
overflow: hidden;
top: 12px;
right: 12px;
> * {
background-color: var(--accentedBg); background-color: var(--accentedBg);
-webkit-backdrop-filter: var(--blur, blur(15px)); -webkit-backdrop-filter: var(--blur, blur(15px));
backdrop-filter: var(--blur, blur(15px)); backdrop-filter: var(--blur, blur(15px));
@ -98,11 +120,6 @@ onMounted(() => {
font-size: 0.8em; font-size: 0.8em;
padding: 6px 8px; padding: 6px 8px;
text-align: center; text-align: center;
top: 12px;
right: 12px;
> i {
display: block;
} }
} }

View file

@ -172,6 +172,9 @@ function onContextmenu(widget: Widget, ev: MouseEvent) {
<style lang="scss" scoped> <style lang="scss" scoped>
.vjoppmmu { .vjoppmmu {
display: flex;
flex-direction: column;
flex-grow: 1;
> header { > header {
margin: 16px 0; margin: 16px 0;
@ -184,7 +187,7 @@ function onContextmenu(widget: Widget, ev: MouseEvent) {
> .widget, > .widget,
.customize-container { .customize-container {
contain: content; contain: content;
margin: var(--margin) 0; margin-bottom: var(--margin);
&:first-of-type { &:first-of-type {
margin-top: 0; margin-top: 0;

View file

@ -17,8 +17,13 @@
/> />
<div v-if="queue > 0" class="new"> <div v-if="queue > 0" class="new">
<button class="_buttonPrimary" @click="top()"> <button
class="_buttonPrimary _shadow"
@click="top()"
:class="{ instant: !$store.state.animation }"
>
{{ i18n.ts.newNoteRecived }} {{ i18n.ts.newNoteRecived }}
<i class="ph-arrow-up ph-bold"></i>
</button> </button>
</div> </div>
<!-- <div v-if="!isMobile" class="tl _block"> <!-- <div v-if="!isMobile" class="tl _block">
@ -328,22 +333,65 @@ onMounted(() => {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@keyframes slideUp {
to {
transform: translateY(-100%);
opacity: 0;
}
}
.cmuxhskf { .cmuxhskf {
--swiper-theme-color: var(--accent); --swiper-theme-color: var(--accent);
> .new { > .new {
position: sticky; position: sticky;
top: calc(var(--stickyTop, 0px) + 16px); display: flex;
justify-content: center;
top: calc(var(--stickyTop, 0px) - 60px);
z-index: 1000; z-index: 1000;
width: 100%; width: 600px;
max-width: 100%;
height: 60px;
margin-top: -60px;
pointer-events: none; pointer-events: none;
margin-inline: auto;
z-index: 1001;
box-shadow: 0 24px 24px -20px var(--accentedBg);
&::after {
content: "";
position: absolute;
inset: 0;
border: 2px solid var(--accentDarken);
mask: linear-gradient(to right, transparent,black 40% 60%,transparent);
-webkit-mask: linear-gradient(to right, transparent,black 40% 60%,transparent);
}
> button { > button {
display: block; display: flex;
margin: var(--margin) auto 0 auto; position: absolute;
padding: 8px 16px; top: 120%;
border-radius: 32px; margin-inline: auto;
border-radius: 2em;
padding: .5em 1.2em;
background: var(--accentedBg);
border: 0;
color: var(--accent);
overflow: hidden;
pointer-events: all; pointer-events: all;
transform: translateY(-100%);
opacity: 0;
animation: reset .4s forwards cubic-bezier(0,.4,0,1.1),
slideUp 1s 5s forwards cubic-bezier(1,0,1,1);
&::before {
content: "";
position: absolute;
inset: 0;
background: var(--bg);
z-index: -1;
}
i {
margin-left: .7em;
border-left: 1px solid var(--accentedBg);
padding-left: .4em;
}
} }
} }

View file

@ -842,6 +842,16 @@ hr {
margin: 0; margin: 0;
} }
@keyframes reset {
to {
transform: none;
opacity: 1;
}
}
.instant {
animation-duration: 0s !important;
}
@media(prefers-reduced-motion: no-preference) { @media(prefers-reduced-motion: no-preference) {
@keyframes scaleIn { @keyframes scaleIn {
from { from {

View file

@ -88,9 +88,11 @@ function updateWidgets(widgets) {
min-height: 100vh; min-height: 100vh;
padding: var(--margin) 0; padding: var(--margin) 0;
box-sizing: border-box; box-sizing: border-box;
display: flex;
flex-direction: column;
> * { > :deep(*) {
margin: var(--margin) 0; margin-top: var(--margin);
width: 300px; width: 300px;
&:first-child { &:first-child {
@ -98,6 +100,10 @@ function updateWidgets(widgets) {
} }
} }
.a:empty {
display: none;
}
> .add { > .add {
margin: 0 auto; margin: 0 auto;
} }

View file

@ -1,5 +1,10 @@
<template> <template>
<MkContainer :show-header="widgetProps.showHeader" class="mkw-rss"> <MkContainer
:show-header="widgetProps.showHeader"
class="mkw-rss"
:scrollable="true"
:style="`height: ${widgetProps.height}px;`"
>
<template #header><i class="ph-rss ph-bold ph-lg"></i>RSS</template> <template #header><i class="ph-rss ph-bold ph-lg"></i>RSS</template>
<template #func <template #func
><button class="_button" @click="configure"> ><button class="_button" @click="configure">
@ -44,6 +49,10 @@ const widgetPropsDef = {
type: "string" as const, type: "string" as const,
default: "http://feeds.afpbb.com/rss/afpbb/afpbbnews", default: "http://feeds.afpbb.com/rss/afpbb/afpbbnews",
}, },
height: {
type: "number" as const,
default: 300,
},
showHeader: { showHeader: {
type: "boolean" as const, type: "boolean" as const,
default: true, default: true,