Merge pull request #290 from dansup/frontend-ui-refactor

Update compiled assets
This commit is contained in:
daniel 2018-06-17 23:29:10 -06:00 committed by GitHub
commit dc1749e382
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 4 deletions

View file

@ -34,7 +34,7 @@ class CommentController extends Controller
$reply = new Status();
$reply->profile_id = $profile->id;
$reply->caption = e(strip_tags($comment));
$reply->caption = e($comment);
$reply->rendered = $comment;
$reply->in_reply_to_id = $status->id;
$reply->in_reply_to_profile_id = $status->profile_id;
@ -44,7 +44,7 @@ class CommentController extends Controller
CommentPipeline::dispatch($status, $reply);
if($request->ajax()) {
$response = ['code' => 200, 'msg' => 'Comment saved', 'username' => $profile->username, 'url' => $reply->url(), 'profile' => $profile->url()];
$response = ['code' => 200, 'msg' => 'Comment saved', 'username' => $profile->username, 'url' => $reply->url(), 'profile' => $profile->url(), 'comment' => $reply->caption];
} else {
$response = redirect($status->url());
}

BIN
public/js/app.js vendored

Binary file not shown.

Binary file not shown.

View file

@ -11,7 +11,7 @@ $(document).ready(function() {
let el = $(this);
let id = el.data('id');
let commentform = el.find('input[name="comment"]');
let commenttext = $(commentform.val()).text();
let commenttext = commentform.val();
let item = {item: id, comment: commenttext};
commentform.prop('disabled', true);
@ -21,6 +21,7 @@ $(document).ready(function() {
var username = res.data.username;
var permalink = res.data.url;
var profile = res.data.profile;
var reply = res.data.comment;
if($('.status-container').length == 1) {
var comments = el.parents().eq(3).find('.comments');
@ -28,7 +29,7 @@ $(document).ready(function() {
var comments = el.parents().eq(1).find('.comments');
}
var comment = '<p class="mb-0"><span class="font-weight-bold pr-1"><bdi><a class="text-dark" href="' + profile + '">' + username + '</a></bdi></span><span class="comment-text">'+ commenttext + '</span><span class="float-right"><a href="' + permalink + '" class="text-dark small font-weight-bold">1s</a></span></p>';
var comment = '<p class="mb-0"><span class="font-weight-bold pr-1"><bdi><a class="text-dark" href="' + profile + '">' + username + '</a></bdi></span><span class="comment-text">'+ reply + '</span><span class="float-right"><a href="' + permalink + '" class="text-dark small font-weight-bold">1s</a></span></p>';
comments.prepend(comment);