diff --git a/src/components/ArticleFooter.vue b/src/components/ArticleFooter.vue index 12850bb354c0ca98eb3f0ce86dec8ea59a77038a..c48598d4b5cff076b5cdee3611b97e24bae3a14c 100644 --- a/src/components/ArticleFooter.vue +++ b/src/components/ArticleFooter.vue @@ -9,10 +9,7 @@ <span v-else> <button class="share_button"> <ShareNetwork network="facebook" - :url="share_link" - title="TITLE" - description="DESCRIPTION" - quote="QUOTE"> + :url="share_link"> <font-awesome-icon :icon="['fab', 'facebook-square']" size="lg" /> </ShareNetwork> </button> @@ -20,9 +17,8 @@ <ShareNetwork network="twitter" :url="share_link" - title="TITLE" - description="DESCRIPTION" - hashtags="Ordbøkene.no"> + :title="dict_label" + hashtags="#ordbøkene"> <font-awesome-icon :icon="['fab', 'twitter-square']" size="lg" /> </ShareNetwork> </button> @@ -39,20 +35,26 @@ export default { article: Object }, computed: { + dict_label: function() { // TODO: reuse code used in header + return { + 'bob': 'Fra bokmålsordboka', + 'nob': 'Frå nynorskordboka' + }[this.article.dictionary] + ': ' + this.article.lemmas[0].lemma || '' + }, webShareApiSupported() { return navigator.share && !(navigator.platform==="Win64" || navigator.platform==="Win32") }, share_link: function() { - let host = window.location.hostname === 'localhost'? 'https://dev.ordbok.uib.no' : 'https://' + window.location.host - return host + "/" + this.dictionary + '/' + this.article.article_id + '/' + encodeURIComponent(this.article.lemmas[0].lemma) + let host = window.location.hostname === 'localhost'? 'https://dev.ordbok.uib.no/' : window.location.href + return host + this.article.dictionary + '/' + this.article.article_id + '/' + encodeURIComponent(this.article.lemmas[0].lemma) } }, methods: { shareViaWebShare() { navigator.share({ - title: 'Title to be shared', - text: 'Text to be shared', - url: 'URL to be shared' + title: "Ordbøkene.no: " + encodeURIComponent(this.article.lemmas[0].lemma), + text: "", + url: "/" + this.article.dictionary + '/' + this.article.article_id + '/' + encodeURIComponent(this.article.lemmas[0].lemma) }) } } diff --git a/vue.config.js b/vue.config.js index 650ea49f0f51e5f12e062b0332cd204fbe2e7d65..d2af4127a5528fd60650873ed54c409757b0c18f 100644 --- a/vue.config.js +++ b/vue.config.js @@ -2,5 +2,8 @@ module.exports = { runtimeCompiler: true, transpileDependencies: [ 'vuetify' - ] + ], + devServer: { + https: false + } }