mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
Merge pull request #48620 from nextcloud/backport/48520/stable30
This commit is contained in:
commit
4ee76302a7
7 changed files with 57 additions and 38 deletions
|
|
@ -203,7 +203,7 @@ Files: core/img/apps/richdocumentscode.svg
|
|||
Copyright: 2016-2024 Collabora Ltd.
|
||||
License: LicenseRef-CollaboraTrademarks
|
||||
|
||||
Files: core/img/twitter.svg core/img/actions/twitter.svg apps/federatedfilesharing/img/social-twitter.svg
|
||||
Files: core/img/x.svg core/img/twitter.svg core/img/actions/twitter.svg apps/federatedfilesharing/img/social-twitter.svg
|
||||
Copyright: X Corp.
|
||||
License: LicenseRef-XTrademarks
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
:title="copyLinkTooltip"
|
||||
:aria-label="copyLinkTooltip"
|
||||
class="clipboard"
|
||||
type="tertiary-no-background"
|
||||
type="tertiary"
|
||||
@click.prevent="copyCloudId">
|
||||
<template #icon>
|
||||
<Clipboard :size="20" />
|
||||
|
|
@ -26,22 +26,20 @@
|
|||
<NcButton @click="goTo(shareFacebookUrl)">
|
||||
{{ t('federatedfilesharing', 'Facebook') }}
|
||||
<template #icon>
|
||||
<Facebook :size="20" />
|
||||
<img class="social-button__icon social-button__icon--bright" :src="urlFacebookIcon">
|
||||
</template>
|
||||
</NcButton>
|
||||
<NcButton @click="goTo(shareTwitterUrl)">
|
||||
{{ t('federatedfilesharing', 'Twitter') }}
|
||||
<NcButton :aria-label="t('federatedfilesharing', 'X (formerly Twitter)')"
|
||||
@click="goTo(shareXUrl)">
|
||||
{{ t('federatedfilesharing', 'formerly Twitter') }}
|
||||
<template #icon>
|
||||
<Twitter :size="20" />
|
||||
<img class="social-button__icon" :src="urlXIcon">
|
||||
</template>
|
||||
</NcButton>
|
||||
<NcButton @click="goTo(shareDiasporaUrl)">
|
||||
{{ t('federatedfilesharing', 'Diaspora') }}
|
||||
<NcButton @click="goTo(shareMastodonUrl)">
|
||||
{{ t('federatedfilesharing', 'Mastodon') }}
|
||||
<template #icon>
|
||||
<svg width="20"
|
||||
height="20"
|
||||
viewBox="-10 -5 1034 1034"
|
||||
xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M502 197q-96 0-96.5 1.5t-1.5 137-1.5 138-2 2.5T266 432.5 132.5 390t-30 94T74 578l232 77q21 8 21 10t-79.5 117.5T168 899t79.5 56.5T328 1011t81-110 82-110 41 55l83 115q43 60 44 60t79.5-58 79-59-76-112.5-76-113.5T795 632.5t129.5-44-28-94T867 400t-128 42-128.5 43-2.5-7.5-1-38.5l-3-108q-4-133-5-133.5t-97-.5z" /></svg>
|
||||
<img class="social-button__icon" :src="urlMastodonIcon">
|
||||
</template>
|
||||
</NcButton>
|
||||
<NcButton class="social-button__website-button"
|
||||
|
|
@ -73,13 +71,13 @@
|
|||
</NcSettingsSection>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { showError, showSuccess } from '@nextcloud/dialogs'
|
||||
<script lang="ts">
|
||||
import { showSuccess } from '@nextcloud/dialogs'
|
||||
import { loadState } from '@nextcloud/initial-state'
|
||||
import { t } from '@nextcloud/l10n'
|
||||
import { imagePath } from '@nextcloud/router'
|
||||
import NcSettingsSection from '@nextcloud/vue/dist/Components/NcSettingsSection.js'
|
||||
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
|
||||
import Twitter from 'vue-material-design-icons/Twitter.vue'
|
||||
import Facebook from 'vue-material-design-icons/Facebook.vue'
|
||||
import Web from 'vue-material-design-icons/Web.vue'
|
||||
import Clipboard from 'vue-material-design-icons/ContentCopy.vue'
|
||||
|
||||
|
|
@ -88,18 +86,25 @@ export default {
|
|||
components: {
|
||||
NcButton,
|
||||
NcSettingsSection,
|
||||
Twitter,
|
||||
Facebook,
|
||||
Web,
|
||||
Clipboard,
|
||||
},
|
||||
setup() {
|
||||
return {
|
||||
t,
|
||||
|
||||
cloudId: loadState<string>('federatedfilesharing', 'cloudId'),
|
||||
reference: loadState<string>('federatedfilesharing', 'reference'),
|
||||
urlFacebookIcon: imagePath('core', 'facebook'),
|
||||
urlMastodonIcon: imagePath('core', 'mastodon'),
|
||||
urlXIcon: imagePath('core', 'x'),
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
color: loadState('federatedfilesharing', 'color'),
|
||||
textColor: loadState('federatedfilesharing', 'textColor'),
|
||||
logoPath: loadState('federatedfilesharing', 'logoPath'),
|
||||
reference: loadState('federatedfilesharing', 'reference'),
|
||||
cloudId: loadState('federatedfilesharing', 'cloudId'),
|
||||
docUrlFederated: loadState('federatedfilesharing', 'docUrlFederated'),
|
||||
showHtml: false,
|
||||
isCopied: false,
|
||||
|
|
@ -112,11 +117,11 @@ export default {
|
|||
messageWithoutURL() {
|
||||
return t('federatedfilesharing', 'Share with me through my #Nextcloud Federated Cloud ID')
|
||||
},
|
||||
shareDiasporaUrl() {
|
||||
return `https://share.diasporafoundation.org/?title=${encodeURIComponent(this.messageWithoutURL)}&url=${encodeURIComponent(this.reference)}`
|
||||
shareMastodonUrl() {
|
||||
return `https://mastodon.social/?text=${encodeURIComponent(this.messageWithoutURL)}&url=${encodeURIComponent(this.reference)}`
|
||||
},
|
||||
shareTwitterUrl() {
|
||||
return `https://twitter.com/intent/tweet?text=${encodeURIComponent(this.messageWithURL)}`
|
||||
shareXUrl() {
|
||||
return `https://x.com/intent/tweet?text=${encodeURIComponent(this.messageWithURL)}`
|
||||
},
|
||||
shareFacebookUrl() {
|
||||
return `https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(this.reference)}`
|
||||
|
|
@ -141,18 +146,18 @@ export default {
|
|||
},
|
||||
},
|
||||
methods: {
|
||||
async copyCloudId() {
|
||||
if (!navigator.clipboard) {
|
||||
// Clipboard API not available
|
||||
showError(t('federatedfilesharing', 'Clipboard is not available'))
|
||||
return
|
||||
async copyCloudId(): Promise<void> {
|
||||
try {
|
||||
await navigator.clipboard.writeText(this.cloudId)
|
||||
showSuccess(t('federatedfilesharing', 'Cloud ID copied to the clipboard'))
|
||||
} catch (e) {
|
||||
// no secure context or really old browser - need a fallback
|
||||
window.prompt(t('federatedfilesharing', 'Clipboard not available. Please copy the cloud ID manually.'), this.reference)
|
||||
}
|
||||
await navigator.clipboard.writeText(this.cloudId)
|
||||
this.isCopied = true
|
||||
showSuccess(t('federatedfilesharing', 'Copied!'))
|
||||
this.$refs.clipboard.$el.focus()
|
||||
},
|
||||
goTo(url) {
|
||||
|
||||
goTo(url: string): void {
|
||||
window.location.href = url
|
||||
},
|
||||
},
|
||||
|
|
@ -162,14 +167,27 @@ export default {
|
|||
<style lang="scss" scoped>
|
||||
.social-button {
|
||||
margin-top: 0.5rem;
|
||||
|
||||
button {
|
||||
display: inline-flex;
|
||||
margin-left: 0.5rem;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
&__website-button {
|
||||
width: min(100%, 400px) !important;
|
||||
}
|
||||
|
||||
&__icon {
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
filter: var(--background-invert-if-dark);
|
||||
|
||||
&--bright {
|
||||
// Some logos like the Facebook logo have bright color schema
|
||||
filter: var(--background-invert-if-bright);
|
||||
}
|
||||
}
|
||||
}
|
||||
.cloud-id-text {
|
||||
display: flex;
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
<svg viewBox="0 0 16 16" height="16" width="16" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"><circle cx="8" cy="8" r="8" style="fill:#3a5ba2"/><path d="M0 1.831c0-138.071-111.929-250-250-250s-250 111.929-250 250c0 117.245 80.715 215.622 189.606 242.638V78.227h-51.552V1.831h51.552v-32.919c0-85.092 38.508-124.532 122.048-124.532 15.838 0 43.167 3.105 54.347 6.211v69.254c-5.901-.621-16.149-.932-28.882-.932-40.993 0-56.832 15.528-56.832 55.9V1.831h81.659l-14.028 76.396h-67.631V250C-95.927 235.049 0 129.649 0 1.831" style="fill:#fff;fill-rule:nonzero" transform="matrix(.02 0 0 .02 13 7.963)"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><defs><clipPath id="a" clipPathUnits="userSpaceOnUse"><path d="M-600 350h700v-700h-700Z"/></clipPath></defs><path d="M0 0c0 138.071-111.929 250-250 250S-500 138.071-500 0c0-117.245 80.715-215.622 189.606-242.638v166.242h-51.552V0h51.552v32.919c0 85.092 38.508 124.532 122.048 124.532 15.838 0 43.167-3.105 54.347-6.211V81.986c-5.901.621-16.149.932-28.882.932-40.993 0-56.832-15.528-56.832-55.9V0h81.659l-14.028-76.396h-67.631v-171.773C-95.927-233.218 0-127.818 0 0" clip-path="url(#a)" style="fill:#fff;fill-opacity:1;fill-rule:nonzero;stroke:none" transform="matrix(.032 0 0 -.032 18 10)"/></svg>
|
||||
|
Before Width: | Height: | Size: 698 B After Width: | Height: | Size: 660 B |
|
|
@ -1 +1 @@
|
|||
<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><circle cx="8" cy="8" r="8" fill="#2b90d2"/><path d="m13.183 9.2819c-0.1566 0.80567-1.4026 1.6874-2.8336 1.8583-0.74623 0.08903-1.4809 0.17088-2.2644 0.13494-1.2813-0.05872-2.2923-0.30582-2.2923-0.30582 0 0.12473 0.0077 0.24349 0.02307 0.35456 0.16657 1.2645 1.2538 1.3402 2.2837 1.3755 1.0395 0.03557 1.9651-0.25629 1.9651-0.25629l0.0427 0.93975s-0.72709 0.39044-2.0223 0.46224c-0.71423 0.03926-1.6011-0.01798-2.634-0.29136-2.2402-0.59294-2.6255-2.9809-2.6844-5.4039-0.01797-0.7194-0.00687-1.3977-0.00687-1.9651 0-2.4776 1.6233-3.2038 1.6233-3.2038 0.81852-0.37591 2.223-0.53399 3.6832-0.54593h0.035867c1.4601 0.011937 2.8656 0.17002 3.6841 0.54593 0 0 1.6233 0.72623 1.6233 3.2038 0 0 0.02036 1.828-0.22639 3.0971" fill="#fff" stroke-width=".049227"/><path d="m11.494 6.377v3h-1.1885v-2.9118c0-0.6138-0.25826-0.92535-0.77484-0.92535-0.57116 0-0.85742 0.36957-0.85742 1.1004v1.5938h-1.1815v-1.5938c0-0.73078-0.28632-1.1004-0.85748-1.1004-0.51658 0-0.77484 0.31155-0.77484 0.92535v2.9118h-1.1885v-3c0-0.61313 0.15611-1.1004 0.46969-1.4608 0.32336-0.36047 0.74684-0.54525 1.2725-0.54525 0.6082 0 1.0688 0.23377 1.3733 0.70137l0.29604 0.49627 0.2961-0.49627c0.30447-0.4676 0.76505-0.70137 1.3733-0.70137 0.52563 0 0.9491 0.18479 1.2725 0.54525 0.31352 0.36047 0.46963 0.84769 0.46963 1.4608" fill="#2b90d9" stroke-width=".049227"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path fill="inherit" d="M17.194 5.542c-.235-1.719-1.757-3.074-3.562-3.336C13.328 2.16 12.174 2 9.502 2h-.02c-2.673 0-3.246.161-3.55.206-1.755.255-3.357 1.472-3.746 3.212-.187.857-.207 1.806-.172 2.677.05 1.25.06 2.497.174 3.741.08.827.22 1.647.416 2.454.37 1.49 1.866 2.731 3.331 3.237a9.07 9.07 0 0 0 4.873.253c.178-.04.354-.087.528-.141.392-.123.853-.26 1.191-.502a.038.038 0 0 0 .016-.03v-1.205a.035.035 0 0 0-.014-.027.035.035 0 0 0-.015-.007.038.038 0 0 0-.016 0 13.713 13.713 0 0 1-3.162.364c-1.833 0-2.326-.856-2.467-1.213a3.707 3.707 0 0 1-.214-.955.035.035 0 0 1 .028-.036.037.037 0 0 1 .016 0c1.019.242 2.063.364 3.11.364.253 0 .504 0 .756-.007 1.054-.029 2.164-.082 3.201-.281.026-.005.052-.01.074-.016 1.636-.31 3.192-1.28 3.35-3.736.006-.097.02-1.013.02-1.113.001-.341.112-2.42-.016-3.697zm-2.517 6.13h-1.72V7.527c0-.873-.369-1.318-1.12-1.318-.826 0-1.24.527-1.24 1.567v2.268h-1.71V7.776c0-1.04-.414-1.567-1.24-1.567-.747 0-1.12.445-1.121 1.318v4.145H4.807V7.4c0-.873.227-1.566.68-2.08.467-.513 1.08-.776 1.84-.776.88 0 1.545.333 1.988.999l.428.707.429-.707c.443-.666 1.108-.999 1.987-.999.76 0 1.372.263 1.84.776.454.514.68 1.207.68 2.08z" style="stroke-width:.206161"/></svg>
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.2 KiB |
1
core/img/x.svg
Normal file
1
core/img/x.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M11.317 8.775 17.146 2h-1.381l-5.061 5.883L6.662 2H2l6.112 8.895L2 18h1.381l5.344-6.212L12.995 18h4.661l-6.339-9.225Zm-1.891 2.199-.62-.886L3.88 3.04H6l3.977 5.688.62.886 5.168 7.394h-2.121l-4.218-6.034Z" style="stroke-width:.0130466"/></svg>
|
||||
|
After Width: | Height: | Size: 314 B |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue