diff --git a/dist/css/styles.css b/dist/css/styles.css index dcff563..fd91cc4 100644 --- a/dist/css/styles.css +++ b/dist/css/styles.css @@ -767,6 +767,9 @@ input[type="submit"]:hover, float: left; width: 100%; } +#post .comment .meta p.stickied { + color: green; +} #post .comment .meta p.author a { font-weight: initial; margin-left: 10px; diff --git a/inc/compilePostComments.js b/inc/compilePostComments.js index 2e48b1f..37d940c 100644 --- a/inc/compilePostComments.js +++ b/inc/compilePostComments.js @@ -6,27 +6,35 @@ module.exports = function() { if(comments.author !== undefined && comments.body_html !== undefined) { let classlist = [] let submitter_link = '' + let moderator = false + let submitter = false + if(post_author === comments.author) { classlist.push('submitter') submitter_link = `[S]` + submitter = true } - if(comments.author === 'AutoModerator') { + if(comments.distinguished === 'moderator') { classlist.push('green') + moderator_badge = ` [M]` + moderator = true } comments_html = `
- ${comments.author} + ${comments.author}${moderator ? moderator_badge : ''}

${kFormatter(comments.ups)} points

${timeDifference(comments.created)}

+

${comments.stickied ? 'stickied comment' : ''}

-

${comments.author}${comments.author === post_author ? submitter_link : ''}

+

${comments.author}${submitter ? submitter_link : ''}${moderator ? moderator_badge : ''}

${kFormatter(comments.ups)} points

${timeDifference(comments.created)} -

+

+

${comments.stickied ? 'stickied comment' : ''}

${unescape(comments.body_html)}
` @@ -74,28 +82,35 @@ module.exports = function() { if(comment.type !== 'load_more') { let classlist = [] let submitter_link = '' + let moderator = false + let submitter = false if(post_author === comment.author) { classlist.push('submitter') submitter_link = `[S]` + submitter = true } - if(comment.author === 'AutoModerator') { + if(comments.distinguished === 'moderator') { classlist.push('green') + moderator_badge = ` [M]` + moderator = true } comments_html += `
- ${comment.author} + ${comment.author}${moderator ? moderator_badge : ''}

${kFormatter(comment.ups)} points

${timeDifference(comment.created)}

+

${comment.stickied ? 'stickied comment' : ''}

-

${comment.author}${comment.author === post_author ? submitter_link : ''}

+

${comment.author}${submitter ? submitter_link : ''}${moderator ? moderator_badge : ''}

${kFormatter(comment.ups)} points

${timeDifference(comment.created)}

+

${comment.stickied ? 'stickied comment' : ''}

${unescape(comment.body_html)}
` diff --git a/inc/processJsonPost.js b/inc/processJsonPost.js index 14cc4b7..3e79f90 100644 --- a/inc/processJsonPost.js +++ b/inc/processJsonPost.js @@ -136,6 +136,8 @@ module.exports = function(fetch) { ups: comment.ups, id: comment.id, permalink: comment.permalink, + stickied: comment.stickied, + distinguished: comment.distinguished, replies: [] } } else { @@ -208,6 +210,8 @@ module.exports = function(fetch) { ups: reply.ups, id: reply.id, permalink: reply.permalink, + stickied: reply.stickied, + distinguished: reply.distinguished, replies: [] } } else {