Merge remote-tracking branch 'misskey-dev/develop' into io
This commit is contained in:
commit
acab2bfc72
83 changed files with 1149 additions and 173 deletions
|
@ -1,3 +1,8 @@
|
|||
<!--
|
||||
SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
-->
|
||||
|
||||
<template>
|
||||
<render/>
|
||||
</template>
|
||||
|
|
|
@ -4,13 +4,13 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
-->
|
||||
|
||||
<template>
|
||||
<a :href="to" :class="active ? activeClass : null" @click.prevent="nav" @contextmenu.prevent.stop="onContextmenu">
|
||||
<a ref="el" :href="to" :class="active ? activeClass : null" @click.prevent="nav" @contextmenu.prevent.stop="onContextmenu">
|
||||
<slot></slot>
|
||||
</a>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from 'vue';
|
||||
import { computed, shallowRef } from 'vue';
|
||||
import * as os from '@/os.js';
|
||||
import copyToClipboard from '@/scripts/copy-to-clipboard.js';
|
||||
import { url } from '@/config.js';
|
||||
|
@ -26,6 +26,10 @@ const props = withDefaults(defineProps<{
|
|||
behavior: null,
|
||||
});
|
||||
|
||||
const el = shallowRef<HTMLElement>();
|
||||
|
||||
defineExpose({ $el: el });
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const active = computed(() => {
|
||||
|
|
|
@ -14,10 +14,20 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
[$style.form_vertical]: chosen.place === 'vertical',
|
||||
}]"
|
||||
>
|
||||
<a :href="chosen.url" rel="noopener" target="_blank" :class="$style.link">
|
||||
<component
|
||||
:is="self ? 'MkA' : 'a'"
|
||||
:class="$style.link"
|
||||
v-bind="self ? {
|
||||
to: chosen.url.substring(local.length),
|
||||
} : {
|
||||
href: chosen.url,
|
||||
rel: 'nofollow noopener',
|
||||
target: '_blank',
|
||||
}"
|
||||
>
|
||||
<img :src="chosen.imageUrl" :class="$style.img">
|
||||
<button class="_button" :class="$style.i" @click.prevent.stop="toggleMenu"><i :class="$style.iIcon" class="ti ti-info-circle"></i></button>
|
||||
</a>
|
||||
</component>
|
||||
</div>
|
||||
<div v-else :class="$style.menu">
|
||||
<div :class="$style.menuContainer">
|
||||
|
@ -32,10 +42,10 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { ref, computed } from 'vue';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { instance } from '@/instance.js';
|
||||
import { host } from '@/config.js';
|
||||
import { url as local, host } from '@/config.js';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import { defaultStore } from '@/store.js';
|
||||
import * as os from '@/os.js';
|
||||
|
@ -100,6 +110,9 @@ const choseAd = (): Ad | null => {
|
|||
};
|
||||
|
||||
const chosen = ref(choseAd());
|
||||
|
||||
const self = computed(() => chosen.value?.url.startsWith(local));
|
||||
|
||||
const shouldHide = ref(!defaultStore.state.forceShowAds && $i && $i.policies.canHideAds && (props.specify == null));
|
||||
|
||||
function reduceFrequency(): void {
|
||||
|
|
|
@ -49,7 +49,7 @@ if (props.showUrlPreview) {
|
|||
os.popup(defineAsyncComponent(() => import('@/components/MkUrlPreviewPopup.vue')), {
|
||||
showing,
|
||||
url: props.url,
|
||||
source: el.value,
|
||||
source: el.value instanceof HTMLElement ? el.value : el.value?.$el,
|
||||
}, {}, 'closed');
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue