From 2cd1cd422cd0e20b8352c0e92b348919012077c4 Mon Sep 17 00:00:00 2001 From: smitten Date: Tue, 25 Jul 2023 21:33:40 -0400 Subject: [PATCH] Add fediLink buttons with circle-nodes icon --- .gitignore | 3 +- src/components/extra_buttons/extra_buttons.js | 14 +++++++-- .../extra_buttons/extra_buttons.vue | 31 ++++++++++++++++--- src/i18n/en.json | 2 ++ 4 files changed, 43 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index a0be5c16..eb1ac2dc 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ selenium-debug.log config/local.json config/local.*.json docs/site/ -.vscode/ \ No newline at end of file +.vscode/ +.yarn/ \ No newline at end of file diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js index 14c605fb..ae4e6d72 100644 --- a/src/components/extra_buttons/extra_buttons.js +++ b/src/components/extra_buttons/extra_buttons.js @@ -9,7 +9,8 @@ import { faShareAlt, faExternalLinkAlt, faHistory, - faFilePen + faFilePen, + faCircleNodes } from '@fortawesome/free-solid-svg-icons' import { faBookmark as faBookmarkReg, @@ -25,6 +26,7 @@ library.add( faThumbtack, faShareAlt, faExternalLinkAlt, + faCircleNodes, faFlag, faHistory, faFilePen @@ -95,6 +97,11 @@ const ExtraButtons = { .then(() => this.$emit('onSuccess')) .catch(err => this.$emit('onError', err.error.error)) }, + copyFediLink () { + navigator.clipboard.writeText(this.fediLink) + .then(() => this.$emit('onSuccess')) + .catch(err => this.$emit('onError', err.error.error)) + }, bookmarkStatus () { this.$store.dispatch('bookmark', { id: this.status.id }) .then(() => this.$emit('onSuccess')) @@ -170,7 +177,7 @@ const ExtraButtons = { canPin () { return this.ownStatus && (this.status.visibility === 'public' || this.status.visibility === 'unlisted') }, - canMute () { + canAuthAction () { return !!this.currentUser }, canTranslate () { @@ -186,6 +193,9 @@ const ExtraButtons = { return this.status.external_url } }, + fediLink () { + return this.statusLink.replace(/^https/, 'web+ap') + }, shouldConfirmDelete () { return this.$store.getters.mergedConfig.modalOnDelete }, diff --git a/src/components/extra_buttons/extra_buttons.vue b/src/components/extra_buttons/extra_buttons.vue index 9da2ad8c..5c33f4b0 100644 --- a/src/components/extra_buttons/extra_buttons.vue +++ b/src/components/extra_buttons/extra_buttons.vue @@ -10,7 +10,7 @@