diff --git a/src/disqus.js b/src/disqus.js index 956d110..442b67f 100644 --- a/src/disqus.js +++ b/src/disqus.js @@ -239,6 +239,7 @@ * disqusjs.config,api - Where to get data * disqusjs.config.apikey - The apikey used to request Disqus API * disqusjs.config.admin - The disqus forum admin username + * disqusjs.config.adminLabel - The disqus moderator badge text * * DisqusJS Info * disqusjs.page.id = The thread id, used at next API call @@ -549,6 +550,10 @@ renderComment = (data) => { comment.authorEl = `${comment.author.name}` } + if (comment.author.name === disqusjs.config.admin) { + comment.authorEl += `${disqusjs.config.adminLabel}` + } + s.nesting = nesting + 1 html += `
  • ` @@ -577,6 +582,10 @@ renderComment = (data) => { comment.authorEl = `${comment.author.name}` } + if (comment.author.name === disqusjs.config.admin) { + comment.authorEl += `${disqusjs.config.adminLabel}` + } + if (s.children) { s.nesting = 1 } diff --git a/src/disqusjs.css b/src/disqusjs.css index d0509b4..6917bc8 100644 --- a/src/disqusjs.css +++ b/src/disqusjs.css @@ -78,6 +78,21 @@ font-weight: 700; } +#dsqjs .dsqjs-author .dsqjs-admin-badge { + color: #fff; + background: #687a86; + padding: 1px 3px; + margin-left: 4px; + font-size: 12px; + line-height: 1.1; + font-weight: 700; + border-radius: 3px; + display: inline-block; + position: relative; + top: -1px; + left: 1px; +} + #dsqjs .dsqjs-meta { font-size: 12px; color: #656c7a;