soscripted / sox

Stack Overflow Extras: a userscript for the Stack Exchange websites to add a bunch of optional toggle-able features
http://stackapps.com/q/6091/
MIT License
72 stars 15 forks source link

Does color answerer's comments work? #343

Closed GaurangTandon closed 6 years ago

GaurangTandon commented 6 years ago

Installed Version: 2.2.3DEV Environment: Tampermonkey

Current Behaviour

image

Unless I am misunderstanding something, the answerer's comments are not at all colored below their posts. You can see this behavior anywhere, for example, here. They're the same as they used to be before and after enabling this feature.

Expected behavior: some coloring should be there:

I'll look into this issue right now.


Features Enabled

["Appearance-colorAnswerer","Appearance-isQuestionHot","Appearance-markEmployees","Appearance-metaChatBlogStackExchangeButton","Appearance-tabularReviewerStats","Appearance-addTimelineAndRevisionLinks","Comments-autoShowCommentImages","Comments-confirmNavigateAway","Editing-addSBSBtn","Editing-inlineEditorEverywhere","Flags-flagPercentages","Flags-flagPercentageBar","Sidebar-hideHireMe","Sidebar-hideChatSidebar","Sidebar-hideLoveThisSite","Sidebar-hideHotNetworkQuestions","Chat-replyToOwnChatMessages","Extras-showMetaReviewCount","Extras-copyCode","Extras-dailyReviewBar","Extras-showQuestionStateInSuggestedEditReviewQueue"]
shu8 commented 6 years ago

@GaurangTandon you're right, I never noticed it stop working!

In:

function colour() {
    $('.answercell').each(function(i, obj) {
        $(this).parent().next().find('.comment-user:contains("' + $.trim($(this).find('.user-details').last().clone().children('.-flair').remove().end().text()) + '")').css({
            'background-color': '#f9e2b6',
            'padding': '1px 5px'
        }); //Find the comments on each post that contain the answerer's name. Also, .last() is necessary, or else it will use the name of someone who edits the answer.
    });
}

Changing $(this).parent().next() to $(this).next() fixes it :)

GaurangTandon commented 6 years ago

Hmm, great, wait a second though, I think I have a few more optimizations. Sending in ten minutes.