Merge branch '3.1' into 5.2
authorMarcel Werk <burntime@woltlab.com>
Wed, 10 Jun 2020 18:16:38 +0000 (20:16 +0200)
committerMarcel Werk <burntime@woltlab.com>
Wed, 10 Jun 2020 18:16:38 +0000 (20:16 +0200)
1  2 
com.woltlab.wcf/templates/__commentJavaScript.tpl

index c717c51d87a34bc04b288f1432dcb386a861da35,a19edfa5ac769a4d39e08cd7d09847c0a9933c94..3e6d952a8ad9779b0b0ef960efa28bd033ae1a8c
                        'wcf.moderation.report.success': '{lang}wcf.moderation.report.success{/lang}'
                });
                
-               new {if $commentHandlerClass|isset}{@$commentHandlerClass}{else}WCF.Comment.Handler{/if}('{$commentContainerID}');
+               new {if $commentHandlerClass|isset}{@$commentHandlerClass}{else}WCF.Comment.Handler{/if}('{@$commentContainerID}');
 -              {if MODULE_LIKE && $commentList->getCommentManager()->supportsLike() && $__wcf->getSession()->getPermission('user.like.canViewLike')}
 -                      require(['WoltLabSuite/Core/Ui/Like/Handler'], function(UiLikeHandler) {
 -                              var canDislike = {if LIKE_ENABLE_DISLIKE}true{else}false{/if};
 -                              var canLike = {if $__wcf->getUser()->userID && $__wcf->getSession()->getPermission('user.like.canLike')}true{else}false{/if};
 -                              var canLikeOwnContent = {if LIKE_ALLOW_FOR_OWN_CONTENT}true{else}false{/if};
 -                              
 -                              new UiLikeHandler('com.woltlab.wcf.comment', {
 -                                      // settings
 -                                      badgeClassNames: 'separatorLeft',
 -                                      markListItemAsActive: true,
 -                                      renderAsButton: false,
 -                                      
 -                                      // permissions
 -                                      canDislike: canDislike,
 -                                      canLike: canLike,
 -                                      canLikeOwnContent: canLikeOwnContent,
 -                                      canViewSummary: false,
 -                                      
 +              {if MODULE_LIKE && $commentList->getCommentManager()->supportsLike() && $__wcf->getSession()->getPermission('user.like.canViewLike') || $__wcf->getSession()->getPermission('user.like.canLike')}
 +                      require(['WoltLabSuite/Core/Ui/Reaction/Handler'], function(UiReactionHandler) {
 +                              new UiReactionHandler('com.woltlab.wcf.comment', {
                                        // selectors
-                                       containerSelector: 'li.comment',
 -                                      badgeContainerSelector: '.commentContent:not(.commentResponseContent) > .containerHeadline > h3',
 -                                      buttonAppendToSelector: '.commentContent .buttonList',
 -                                      containerSelector: '#{@$commentContainerID} .comment',
 -                                      summarySelector: ''
++                                      containerSelector: '#{@$commentContainerID} li.comment',
 +                                      summaryListSelector: '.reactionSummaryList',
 +                                      isButtonGroupNavigation: true
                                });
                                
 -                              new UiLikeHandler('com.woltlab.wcf.comment.response', {
 -                                      // settings
 -                                      badgeClassNames: 'separatorLeft',
 -                                      markListItemAsActive: true,
 -                                      renderAsButton: false,
 -                                      
 -                                      // permissions
 -                                      canDislike: canDislike,
 -                                      canLike: canLike,
 -                                      canLikeOwnContent: canLikeOwnContent,
 -                                      canViewSummary: false,
 -                                      
 +                              new UiReactionHandler('com.woltlab.wcf.comment.response', {
                                        // selectors
-                                       containerSelector: '.commentResponse',
 -                                      badgeContainerSelector: '.commentResponseContent > .containerHeadline > h3',
 -                                      buttonAppendToSelector: '.commentContent .buttonList',
+                                       containerSelector: '#{@$commentContainerID} .commentResponse',
 -                                      summarySelector: ''
 +                                      summaryListSelector: '.reactionSummaryList',
 +                                      isButtonGroupNavigation: true
                                });
                        });
                {/if}