Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Mark accepted answer if it is not the highest-scored answer
// ==UserScript==
// @name Mark accepted answer if it is not the highest-scored answer
// @namespace http://stackexchange.com/users/4337810/
// @version 1.0
// @description Mark accepted answer if it is not the highest-scored answer
// @author ᔕᖺᘎᕊ (http://stackexchange.com/users/4337810/)
// @match *://*.stackexchange.com/questions/*
// @match *://*.stackoverflow.com/questions/*
// @match *://*.superuser.com/questions/*
// @match *://*.serverfault.com/questions/*
// @match *://*.askubuntu.com/questions/*
// @match *://*.stackapps.com/questions/*
// @match *://*.mathoverflow.net/questions/*
// @grant none
// ==/UserScript==
/* jshint -W097 */
'use strict';
setTimeout(function() {
if($('.accepted-answer').length) {
var accepted_score = $('.accepted-answer').find('.vote-count-post').text();
$('.answer').each(function() {
if(+$(this).find('.vote-count-post').text() > (+accepted_score+10)) {
$('.accepted-answer').find('.answercell').prepend('<span style="color: red;">Note: There may be other good answers here!</span>');
return;
}
});
}
}, 500);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment