diff --git a/resources/assets/js/components/PostComponent.vue b/resources/assets/js/components/PostComponent.vue index d6e3934af..3f5a369e2 100644 --- a/resources/assets/js/components/PostComponent.vue +++ b/resources/assets/js/components/PostComponent.vue @@ -144,7 +144,7 @@

{{statusUsername}} - +


@@ -179,7 +179,7 @@

{{truncate(reply.account.username,15)}} - + @@ -189,7 +189,7 @@

{{reply.favourites_count == 1 ? '1 like' : reply.favourites_count + ' likes'}} - Reply + Reply

@@ -202,7 +202,7 @@

{{s.account.username}} - + @@ -226,13 +226,13 @@

-
-

-

-

- -

+
+

+

+

+ +

+

@@ -726,6 +726,7 @@ export default { sharesPage: 1, lightboxMedia: false, replyText: '', + replyStatus: {}, replySensitive: false, relationship: {}, results: [], @@ -740,6 +741,7 @@ export default { loading: null, replyingToId: this.statusId, replyToIndex: 0, + replySending: false, emoji: window.App.util.emoji, showReadMore: true, showCaption: true, @@ -864,7 +866,11 @@ export default { }, likesModal() { - if(this.status.favourites_count == 0 || $('body').hasClass('loggedIn') == false) { + if($('body').hasClass('loggedIn') == false) { + window.location.href = '/login?next=' + encodeURIComponent('/p/' + this.status.shortcode); + return; + } + if(this.status.favourites_count == 0) { return; } this.$refs.likesModal.show(); @@ -1119,10 +1125,13 @@ export default { return e.substr(0, 10)+'...'; }, - replyFocus(e, index) { + replyFocus(e, index, prependUsername = false) { this.replyToIndex = index; this.replyingToId = e.id; this.reply_to_profile_id = e.account.id; + if(prependUsername == true) { + this.replyText = '@' + e.account.username + ' '; + } $('textarea[name="comment"]').focus(); }, @@ -1140,6 +1149,18 @@ export default { } $('.postCommentsLoader').addClass('d-none'); $('.postCommentsContainer').removeClass('d-none'); + setTimeout(function() { + document.querySelectorAll('.comments .comment-body a').forEach(function(i, e) { + if(i.href.startsWith(window.location.origin)) { + return; + } + let tag = i.innerText; + if(tag.startsWith('#')) { + tag = tag.substr(1); + } + i.href = '/discover/tags/'+tag+'?src=rph'; + }); + }, 500); }).catch(error => { if(!error.response) { $('.postCommentsLoader .lds-ring') @@ -1190,6 +1211,7 @@ export default { likeReply(status, $event) { if($('body').hasClass('loggedIn') == false) { + swal('Login', 'Please login to perform this action.', 'info'); return; } @@ -1410,7 +1432,6 @@ export default { swal('An Error Occurred', 'Please try again later.', 'error'); }); } - }, }