Merge branch 'openvk:master' into master

This commit is contained in:
Dmitry 2021-12-18 17:26:00 +07:00 committed by GitHub
commit 69b3822f89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 3 deletions

View file

@ -47,3 +47,7 @@
</script> </script>
</center> </center>
{/block} {/block}
{if isset($thisUser) && $thisUser->hasMicroblogEnabled()}
{script "js/al_comments.js"}
{/if}

View file

@ -17,3 +17,7 @@
{include "../components/paginator.xml", conf => $paginatorConf} {include "../components/paginator.xml", conf => $paginatorConf}
</center> </center>
{/block} {/block}
{if isset($thisUser) && $thisUser->hasMicroblogEnabled()}
{script "js/al_comments.js"}
{/if}

View file

@ -34,3 +34,7 @@
</div> </div>
</div> </div>
{/block} {/block}
{if isset($thisUser) && $thisUser->hasMicroblogEnabled()}
{script "js/al_comments.js"}
{/if}

View file

@ -1,8 +1,9 @@
{var author = $comment->getOwner()} {var author = $comment->getOwner()}
{var $Club = openvk\Web\Models\Entities\Club::class} {var $Club = openvk\Web\Models\Entities\Club::class}
{var postId = $comment->getTarget() instanceof \openvk\Web\Models\Entities\Post ? $comment->getTarget()->getId() : NULL}
<a name="cid={$comment->getId()}"></a> <a name="cid={$comment->getId()}"></a>
<table border="0" style="font-size: 11px;" class="post comment" id="_comment{$comment->getId()}" data-comment-id="{$comment->getId()}" data-owner-id="{$author->getId()}" data-from-group="{$comment->getOwner() instanceof $Club}"> <table border="0" style="font-size: 11px;" class="post comment" id="_comment{$comment->getId()}" data-comment-id="{$comment->getId()}" data-owner-id="{$author->getId()}" data-from-group="{$comment->getOwner() instanceof $Club}" n:attr="data-post-id => $postId">
<tbody> <tbody>
<tr> <tr>
<td width="30" valign="top"> <td width="30" valign="top">

View file

@ -25,3 +25,7 @@
</div> </div>
</div> </div>
</div> </div>
{if isset($thisUser) && $thisUser->hasMicroblogEnabled()}
{script "js/al_comments.js"}
{/if}

View file

@ -1,11 +1,10 @@
u(".comment-reply").on("click", function(e) { u(".comment-reply").on("click", function(e) {
let inputbox = u("#write textarea");
let comment = u(e.target).closest(".post"); let comment = u(e.target).closest(".post");
let authorId = comment.data("owner-id"); let authorId = comment.data("owner-id");
let authorNm = u(".post-author > a > b", comment.first()).text().trim(); let authorNm = u(".post-author > a > b", comment.first()).text().trim();
let fromGroup = Boolean(comment.data("from-group")); let fromGroup = Boolean(comment.data("from-group"));
let postId = comment.data("post-id"); let postId = comment.data("post-id");
console.log(postId) let inputbox = postId == null ? u("#write textarea") : u("#wall-post-input" + (postId || ""));
inputbox.text("[" + (fromGroup ? "club" : "id") + authorId + "|" + authorNm + "], "); inputbox.text("[" + (fromGroup ? "club" : "id") + authorId + "|" + authorNm + "], ");
inputbox.trigger("focusin"); inputbox.trigger("focusin");