Stack Exchange platziert die akzeptierte Antwort oft über allen anderen Antworten.
Ich werde oft dazu verleitet, die erste Antwort umzusetzen, nur um festzustellen, dass sie der zweiten Antwort weit unterlegen ist und viel mehr positive Stimmen hat. ( Beispiel )
Also suche ich nach einer Erweiterung, die die Antworten streng nach Stimmen sortiert.
Die Bestellung wird nicht davon beeinflusst, ob eine Antwort akzeptiert wird oder nicht.
Anforderungen:
Ich habe dazu ein Benutzerskript erstellt - es fügt eine weitere Sortierschaltfläche auf der Registerkarte "Antworten" hinzu:
Ich habe es auf Firefox und Chrome auf diese Frage getestet .
Es nimmt die Stimmen und sortiert sie in absteigender Reihenfolge, ohne zu berücksichtigen, welche die akzeptierte Antwort ist (was anscheinend die Registerkarte "Stimmen" tut).
Installieren Sie zur Verwendung Greasemonkey (auf Firefox) oder Tampermonkey (auf Chrome) und installieren Sie das Skript :
// ==UserScript==
// @name Sort by votes, properly...
// @namespace http://stackexchange.com/users/4337810
// @version 1.1
// @description Adds a new option on questions to sort answers by votes *ignoring the accepted answer* - unlike the current 'votes' tab.
// @author ᔕᖺᘎᕊ (http://stackexchange.com/users/4337810)
// @match *://*.stackexchange.com/*
// @match *://*.stackoverflow.com/*
// @match *://*.superuser.com/*
// @match *://*.serverfault.com/*
// @match *://*.askubuntu.com/*
// @match *://*.stackapps.com/*
// @match *://*.mathoverflow.net/*
// @grant none
// ==/UserScript==
setTimeout(function() {
if ( $('.answer').length ) {
$('.answer').each(function() {
votes = $(this).find('.vote-count-post').text();
$(this).attr('data-votes', votes); //add a 'votes' attribute to all the questions
});
var $wrapper = $('#answers');
$('#answers-header').insertBefore('#answers');
$('#tabs').append('<a href="javascript:void(0)" id="realVotesTab" title="Answers with the highest score first (ignoring accepted answers!)">real votes</a>');
$('#realVotesTab').on('click', function() {
$('#tabs a').removeClass('youarehere');
$(this).addClass('youarehere');
//Thanks: https://stackoverflow.com/a/14160529/3541881
$wrapper.find('.answer').sort(function(a, b) {
return +b.getAttribute('data-votes') - +a.getAttribute('data-votes');
}).prependTo($wrapper);
});
//Comment out the next 3 lines if you do not want the 'real votes' tab to automatically be chosen when yuo first arrive at a question (ie. prepend "//" to the next 3 lines)
if(document.URL.indexOf('?answertab=') == -1) {
$('#realVotesTab').trigger('click');
}
}
}, 100);
Hinweis: Dies basiert weitgehend auf meinem vorherigen Skript zum Sortieren von Kopfgeldern :)
Izzy
Nikolaus Raul
Izzy
ᔕᖺᘎᕊ
Izzy