mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-22 12:13:48 +01:00
copy button
This commit is contained in:
parent
025b598ed5
commit
a52a9156f2
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "calckey",
|
||||
"version": "12.119.0-calc.19-b6",
|
||||
"version": "12.119.0-calc.19-b7",
|
||||
"codename": "aqua",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -40,6 +40,7 @@ import bytes from '@/filters/bytes';
|
||||
import * as os from '@/os';
|
||||
import { i18n } from '@/i18n';
|
||||
import { $i } from '@/account';
|
||||
import copyToClipboard from '@/scripts/copy-to-clipboard';
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
file: Misskey.entities.DriveFile;
|
||||
|
@ -15,6 +15,7 @@
|
||||
<h1>{{ page.title }}</h1>
|
||||
</div>
|
||||
<div class="menu-actions">
|
||||
<button v-tooltip="i18n.ts.copyUrl" @click="copyUrl" class="menu _button"><i class="ph-link-simple-bold ph-lg"/></button>
|
||||
<MkA v-tooltip="i18n.ts._pages.viewSource" :to="`/@${username}/pages/${pageName}/view-source`" class="menu _button"><i class="ph-code-bold ph-lg"/></MkA>
|
||||
<template v-if="$i && $i.id === page.userId">
|
||||
<MkA v-tooltip="i18n.ts._pages.editPage" class="menu _button" :to="`/pages/edit/${page.id}`"><i class="ph-pencil-bold ph-lg"/></MkA>
|
||||
@ -80,6 +81,7 @@ import MkContainer from '@/components/MkContainer.vue';
|
||||
import MkPagination from '@/components/MkPagination.vue';
|
||||
import MkPagePreview from '@/components/MkPagePreview.vue';
|
||||
import { i18n } from '@/i18n';
|
||||
import copyToClipboard from '@/scripts/copy-to-clipboard';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata';
|
||||
import { shareAvailable } from '@/scripts/share-available';
|
||||
|
||||
@ -113,6 +115,11 @@ function fetchPage() {
|
||||
});
|
||||
}
|
||||
|
||||
function copyUrl() {
|
||||
copyToClipboard(window.location.href);
|
||||
os.success();
|
||||
}
|
||||
|
||||
function getBgImg(): string {
|
||||
if (page.eyeCatchingImage != null) {
|
||||
return `url(${page.eyeCatchingImage.url})`;
|
||||
|
Loading…
Reference in New Issue
Block a user