Commit | Line | Data |
---|---|---|
9543d9fe | 1 | <script data-relocate="true"> |
285b1d92 MW |
2 | //<![CDATA[ |
3 | $(function() { | |
4 | WCF.Language.addObject({ | |
5 | 'wcf.comment.add': '{lang}wcf.comment.add{/lang}', | |
6 | 'wcf.comment.button.response.add': '{lang}wcf.comment.button.response.add{/lang}', | |
7 | 'wcf.comment.delete.confirmMessage': '{lang}wcf.comment.delete.confirmMessage{/lang}', | |
8 | 'wcf.comment.description': '{lang}wcf.comment.description{/lang}', | |
96714cab | 9 | 'wcf.comment.guestDialog.title': '{lang}wcf.comment.guestDialog.title{/lang}', |
285b1d92 MW |
10 | 'wcf.comment.more': '{lang}wcf.comment.more{/lang}', |
11 | 'wcf.comment.response.add': '{lang}wcf.comment.response.add{/lang}', | |
12 | 'wcf.comment.response.more': '{lang}wcf.comment.response.more{/lang}', | |
13 | 'wcf.moderation.report.reportContent': '{lang}wcf.moderation.report.reportContent{/lang}', | |
14 | 'wcf.moderation.report.success': '{lang}wcf.moderation.report.success{/lang}' | |
15 | }); | |
16 | ||
929f7e47 | 17 | new {if $commentHandlerClass|isset}{@$commentHandlerClass}{else}WCF.Comment.Handler{/if}('{$commentContainerID}', '{@$__wcf->getUserProfileHandler()->getAvatar()->getImageTag(48)}', '{@$__wcf->getUserProfileHandler()->getAvatar()->getImageTag(32)}'); |
166d2b91 | 18 | {if MODULE_LIKE && $commentList->getCommentManager()->supportsLike() && $__wcf->getSession()->getPermission('user.like.canViewLike')} |
4015c35d AE |
19 | require(['WoltLab/WCF/Ui/Like/Handler'], function(UiLikeHandler) { |
20 | var canDislike = {if LIKE_ENABLE_DISLIKE}true{else}false{/if}; | |
21 | var canLike = {if $__wcf->getUser()->userID && $__wcf->getSession()->getPermission('user.like.canLike')}true{else}false{/if}; | |
22 | var canLikeOwnContent = {if LIKE_ALLOW_FOR_OWN_CONTENT}true{else}false{/if}; | |
23 | ||
24 | new UiLikeHandler('com.woltlab.wcf.comment', { | |
25 | // settings | |
26 | badgeClassNames: 'separatorLeft', | |
27 | markListItemAsActive: true, | |
28 | renderAsButton: false, | |
29 | ||
30 | // permissions | |
31 | canDislike: canDislike, | |
32 | canLike: canLike, | |
33 | canLikeOwnContent: canLikeOwnContent, | |
34 | canViewSummary: false, | |
35 | ||
36 | // selectors | |
37 | badgeContainerSelector: '.commentContent:not(.commentResponseContent) > .containerHeadline > h3', | |
38 | buttonAppendToSelector: '.commentContent .buttonList', | |
39 | containerSelector: '.comment', | |
40 | summarySelector: '' | |
41 | }); | |
42 | ||
43 | new UiLikeHandler('com.woltlab.wcf.comment.response', { | |
44 | // settings | |
45 | badgeClassNames: 'separatorLeft', | |
46 | markListItemAsActive: true, | |
47 | renderAsButton: false, | |
48 | ||
49 | // permissions | |
50 | canDislike: canDislike, | |
51 | canLike: canLike, | |
52 | canLikeOwnContent: canLikeOwnContent, | |
53 | canViewSummary: false, | |
54 | ||
55 | // selectors | |
56 | badgeContainerSelector: '.commentResponseContent > .containerHeadline > h3', | |
57 | buttonAppendToSelector: '.commentContent .buttonList', | |
58 | containerSelector: '.commentResponse', | |
59 | summarySelector: '' | |
60 | }); | |
61 | }); | |
285b1d92 MW |
62 | {/if} |
63 | ||
166d2b91 | 64 | {if $commentList->getCommentManager()->supportsReport() && $__wcf->session->getPermission('user.profile.canReportContent')} |
e6de9aeb MW |
65 | new WCF.Moderation.Report.Content('com.woltlab.wcf.comment.comment', '.jsReportCommentComment'); |
66 | new WCF.Moderation.Report.Content('com.woltlab.wcf.comment.response', '.jsReportCommentResponse'); | |
67 | {/if} | |
285b1d92 MW |
68 | }); |
69 | //]]> | |
70 | </script> | |
71 | ||
72 | {event name='javascriptInclude'} |