Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Source for http://pastebin.com/qVqNYPzr
- // Collect posts and its marks
- var comments=$$('li.comment_holder'), marks=[];
- comments.each(function(item) {
- item.div=item.getChildren('.entry-content')[0].getChildren('.entry-content-only')[0];
- item.mark=parseInt(item.getChildren('.msg-meta')[0].getElements('li.mark span')[0].innerHTML.replace('–', '-'));
- marks.push(item.mark);
- });
- // Get threshold
- marks=marks.sort(function(a, b) {return a - b});
- var l=parseInt(marks.length * 0.05);
- var max=marks[marks.length - l];
- // Hide unwanted
- comments.each(function(item) {
- if (item.mark < max)
- item.div.addClass('bad5');
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement