Created
May 20, 2014 20:05
-
-
Save mzabriskie/b08a2a444b806f746326 to your computer and use it in GitHub Desktop.
Sort voting results for UtahJS Conf - http://conf.utahjs.com/vote
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[].slice.call(document.querySelectorAll('tr.paper')).sort(function (a, b) { | |
a = parseInt(a.querySelector('td:first-of-type span.score').innerHTML); | |
b = parseInt(b.querySelector('td:first-of-type span.score').innerHTML); | |
return a > b ? -1 : b > a ? 1 : 0; | |
}).forEach(function (node) { | |
node.parentNode.appendChild(node); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment