diff --git a/resources/assets/js/components/ComposeModal.vue b/resources/assets/js/components/ComposeModal.vue index a98028efe..e2c054ac3 100644 --- a/resources/assets/js/components/ComposeModal.vue +++ b/resources/assets/js/components/ComposeModal.vue @@ -295,7 +295,9 @@
- + + +

{{composeTextLength}}/{{config.uploader.max_caption_length}}

@@ -647,11 +649,14 @@ import VueCropper from 'vue-cropperjs'; import 'cropperjs/dist/cropper.css'; import Autocomplete from '@trevoreyre/autocomplete-vue' import '@trevoreyre/autocomplete-vue/dist/style.css' +import VueTribute from 'vue-tribute' export default { + components: { VueCropper, - Autocomplete + Autocomplete, + VueTribute }, data() { @@ -707,7 +712,39 @@ export default { cameraRollMedia: [], taggedUsernames: [], taggedPeopleSearch: null, - textMode: false + textMode: false, + tributeSettings: { + collection: [ + { + trigger: '@', + menuShowMinLength: 2, + values: (function (text, cb) { + let url = '/api/compose/v0/search/mention'; + axios.get(url, { params: { q: text }}) + .then(res => { + cb(res.data); + }) + .catch(err => { + console.log(err); + }) + }) + }, + { + trigger: '#', + menuShowMinLength: 2, + values: (function (text, cb) { + let url = '/api/compose/v0/search/hashtag'; + axios.get(url, { params: { q: text }}) + .then(res => { + cb(res.data); + }) + .catch(err => { + console.log(err); + }) + }) + } + ] + } } }, diff --git a/resources/assets/js/components/PostComponent.vue b/resources/assets/js/components/PostComponent.vue index 7525db9c9..b9302f9ba 100644 --- a/resources/assets/js/components/PostComponent.vue +++ b/resources/assets/js/components/PostComponent.vue @@ -643,8 +643,10 @@ size="md" body-class="p-2 rounded">
- + + +