share intend

This commit is contained in:
Kaibu 2021-06-17 03:01:22 +02:00
parent 1229a37d74
commit a695261b9c
6 changed files with 28 additions and 21 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -64,7 +64,7 @@
<input ref="share_link_ref" class="form-control" v-model="recipe_share_link"/> <input ref="share_link_ref" class="form-control" v-model="recipe_share_link"/>
<b-button class="mt-2 mb-3" variant="secondary" @click="$bvModal.hide(`modal-share-link_${modal_id}`)">{{ $t('Close') }}</b-button> <b-button class="mt-2 mb-3" variant="secondary" @click="$bvModal.hide(`modal-share-link_${modal_id}`)">{{ $t('Close') }}</b-button>
<b-button class="mt-2 mb-3 ml-2" variant="primary" @click="copyShareLink()">{{ $t('Copy') }}</b-button> <b-button class="mt-2 mb-3 ml-2" variant="primary" @click="copyShareLink()">{{ $t('Copy') }}</b-button>
<a :href="`whatsapp://send?text=${recipe_share_link}`" data-action="share/whatsapp/share"><b-button class="mt-2 mb-3 ml-2" >Test</b-button></a> <b-button class="mt-2 mb-3 ml-2 float-right" variant="success" @click="shareIntend()">{{ $t('Share') }} <i class="fa fa-share-alt"></i></b-button>
</div> </div>
</div> </div>
@ -121,10 +121,17 @@ export default {
}, },
copyShareLink: function () { copyShareLink: function () {
let share_input = this.$refs.share_link_ref; let share_input = this.$refs.share_link_ref;
share_input.select(); share_input.select();
document.execCommand("copy"); document.execCommand("copy");
},
shareIntend: function () {
let shareData = {
title: this.recipe.name,
text: this.$t('Check out this recipe!'),
url: this.recipe_share_link
}
navigator.share(shareData)
} }
} }
} }

View File

@ -1 +1 @@
{"status":"done","chunks":{"recipe_search_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/recipe_search_view.js"],"recipe_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/recipe_view.js"],"offline_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/offline_view.js"],"import_response_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/import_response_view.js"],"supermarket_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/supermarket_view.js"],"user_file_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/user_file_view.js"]},"assets":{"../../templates/sw.js":{"name":"../../templates/sw.js","path":"..\\..\\templates\\sw.js"},"css/chunk-vendors.css":{"name":"css/chunk-vendors.css","path":"css\\chunk-vendors.css"},"js/chunk-vendors.js":{"name":"js/chunk-vendors.js","path":"js\\chunk-vendors.js"},"js/import_response_view.js":{"name":"js/import_response_view.js","path":"js\\import_response_view.js"},"js/offline_view.js":{"name":"js/offline_view.js","path":"js\\offline_view.js"},"js/recipe_search_view.js":{"name":"js/recipe_search_view.js","path":"js\\recipe_search_view.js"},"js/recipe_view.js":{"name":"js/recipe_view.js","path":"js\\recipe_view.js"},"js/supermarket_view.js":{"name":"js/supermarket_view.js","path":"js\\supermarket_view.js"},"js/user_file_view.js":{"name":"js/user_file_view.js","path":"js\\user_file_view.js"},"recipe_search_view.html":{"name":"recipe_search_view.html","path":"recipe_search_view.html"},"recipe_view.html":{"name":"recipe_view.html","path":"recipe_view.html"},"offline_view.html":{"name":"offline_view.html","path":"offline_view.html"},"import_response_view.html":{"name":"import_response_view.html","path":"import_response_view.html"},"supermarket_view.html":{"name":"supermarket_view.html","path":"supermarket_view.html"},"user_file_view.html":{"name":"user_file_view.html","path":"user_file_view.html"},"manifest.json":{"name":"manifest.json","path":"manifest.json"}}} {"status":"done","chunks":{"recipe_search_view":["js/chunk-vendors.js","js/recipe_search_view.js","recipe_search_view.8ddb3d95083697d49aed.hot-update.js"],"recipe_view":["js/chunk-vendors.js","js/recipe_view.js","recipe_view.8ddb3d95083697d49aed.hot-update.js"],"offline_view":["js/chunk-vendors.js","js/offline_view.js"],"import_response_view":["js/chunk-vendors.js","js/import_response_view.js"],"supermarket_view":["js/chunk-vendors.js","js/supermarket_view.js"],"user_file_view":["js/chunk-vendors.js","js/user_file_view.js"]},"publicPath":"http://localhost:8080/","assets":{"js/chunk-vendors.js":{"name":"js/chunk-vendors.js","path":"js\\chunk-vendors.js","publicPath":"http://localhost:8080/js/chunk-vendors.js"},"js/import_response_view.js":{"name":"js/import_response_view.js","path":"js\\import_response_view.js","publicPath":"http://localhost:8080/js/import_response_view.js"},"js/offline_view.js":{"name":"js/offline_view.js","path":"js\\offline_view.js","publicPath":"http://localhost:8080/js/offline_view.js"},"js/recipe_search_view.js":{"name":"js/recipe_search_view.js","path":"js\\recipe_search_view.js","publicPath":"http://localhost:8080/js/recipe_search_view.js"},"js/recipe_view.js":{"name":"js/recipe_view.js","path":"js\\recipe_view.js","publicPath":"http://localhost:8080/js/recipe_view.js"},"js/supermarket_view.js":{"name":"js/supermarket_view.js","path":"js\\supermarket_view.js","publicPath":"http://localhost:8080/js/supermarket_view.js"},"js/user_file_view.js":{"name":"js/user_file_view.js","path":"js\\user_file_view.js","publicPath":"http://localhost:8080/js/user_file_view.js"},"recipe_search_view.8ddb3d95083697d49aed.hot-update.js":{"name":"recipe_search_view.8ddb3d95083697d49aed.hot-update.js","path":"recipe_search_view.8ddb3d95083697d49aed.hot-update.js","publicPath":"http://localhost:8080/recipe_search_view.8ddb3d95083697d49aed.hot-update.js"},"recipe_view.8ddb3d95083697d49aed.hot-update.js":{"name":"recipe_view.8ddb3d95083697d49aed.hot-update.js","path":"recipe_view.8ddb3d95083697d49aed.hot-update.js","publicPath":"http://localhost:8080/recipe_view.8ddb3d95083697d49aed.hot-update.js"},"8ddb3d95083697d49aed.hot-update.json":{"name":"8ddb3d95083697d49aed.hot-update.json","path":"8ddb3d95083697d49aed.hot-update.json","publicPath":"http://localhost:8080/8ddb3d95083697d49aed.hot-update.json"},"recipe_search_view.html":{"name":"recipe_search_view.html","path":"recipe_search_view.html","publicPath":"http://localhost:8080/recipe_search_view.html"},"recipe_view.html":{"name":"recipe_view.html","path":"recipe_view.html","publicPath":"http://localhost:8080/recipe_view.html"},"offline_view.html":{"name":"offline_view.html","path":"offline_view.html","publicPath":"http://localhost:8080/offline_view.html"},"import_response_view.html":{"name":"import_response_view.html","path":"import_response_view.html","publicPath":"http://localhost:8080/import_response_view.html"},"supermarket_view.html":{"name":"supermarket_view.html","path":"supermarket_view.html","publicPath":"http://localhost:8080/supermarket_view.html"},"user_file_view.html":{"name":"user_file_view.html","path":"user_file_view.html","publicPath":"http://localhost:8080/user_file_view.html"},"manifest.json":{"name":"manifest.json","path":"manifest.json","publicPath":"http://localhost:8080/manifest.json"}}}