diff options
author | dartcafe <github@dartcafe.de> | 2020-09-03 22:29:47 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2020-09-03 22:29:47 +0300 |
commit | 85793d7bef21ca9e16d5224a46d50bd4ebccfd3c (patch) | |
tree | e5f18220b968cc3edf49b0ebfab64064d4d57e46 | |
parent | c72e917f10ca25c691813e191ebec90b7da88d92 (diff) |
use linkifyjs for description
-rw-r--r-- | package.json | 1 | ||||
-rw-r--r-- | src/js/views/Vote.vue | 26 |
2 files changed, 17 insertions, 10 deletions
diff --git a/package.json b/package.json index b8181d8d..d9b3e9bd 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "@nextcloud/router": "^1.2.0", "@nextcloud/vue": "^2.6.1", "core-js": "^3.6.5", + "linkifyjs": "^2.1.9", "lodash": "^4.17.20", "moment": "^2.27.0", "v-click-outside": "^3.1.0", diff --git a/src/js/views/Vote.vue b/src/js/views/Vote.vue index 980ece4d..f8816f93 100644 --- a/src/js/views/Vote.vue +++ b/src/js/views/Vote.vue @@ -57,8 +57,9 @@ </h2> <PollInformation /> - <h3 class="description"> - {{ poll.description ? poll.description : t('polls', 'No description provided') }} + <!-- eslint-disable-next-line vue/no-v-html --> + <h3 class="description" v-html="linkifyDescription"> + {{ poll.description ? linkifyDescription : t('polls', 'No description provided') }} </h3> </div> @@ -90,19 +91,20 @@ </template> <script> +import linkifyStr from 'linkifyjs/string' +import { mapState, mapGetters } from 'vuex' import { Actions, ActionButton, AppContent } from '@nextcloud/vue' -import Subscription from '../components/Subscription/Subscription' +import { getCurrentUser } from '@nextcloud/auth' +import { emit } from '@nextcloud/event-bus' +import moment from '@nextcloud/moment' import Badge from '../components/Base/Badge' +import LoadingOverlay from '../components/Base/LoadingOverlay' import ParticipantsList from '../components/Base/ParticipantsList' import PersonalLink from '../components/Base/PersonalLink' import PollInformation from '../components/Base/PollInformation' -import LoadingOverlay from '../components/Base/LoadingOverlay' import PublicRegisterModal from '../components/Base/PublicRegisterModal' +import Subscription from '../components/Subscription/Subscription' import VoteTable from '../components/VoteTable/VoteTable' -import { mapState, mapGetters } from 'vuex' -import { getCurrentUser } from '@nextcloud/auth' -import { emit } from '@nextcloud/event-bus' -import moment from '@nextcloud/moment' export default { name: 'Vote', @@ -142,7 +144,11 @@ export default { isExpired: 'poll/expired', }), - windowTitle: function() { + linkifyDescription() { + return linkifyStr(this.poll.description) + }, + + windowTitle() { return t('polls', 'Polls') + ' - ' + this.poll.title }, @@ -188,7 +194,7 @@ export default { } }, - toggleViewIcon: function() { + toggleViewIcon() { if (this.tableMode) { return 'icon-phone' } else { |