Skip to content

Commit

Permalink
Add ability to select by score in queues (#214)
Browse files Browse the repository at this point in the history
* add select by score

added ability to select by score greater than or less than x

* Update queuetools.js

* Accept suggestion to fix selectors

Co-Authored-By: George <georgej1088@gmail.com>

* Accept suggestion to fix selectors

Co-Authored-By: George <georgej1088@gmail.com>

Co-authored-by: George <georgej1088@gmail.com>
  • Loading branch information
Blank-Cheque and eritbh committed Feb 10, 2020
1 parent 83613b4 commit cc6e6a5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions extension/data/modules/queuetools.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@ function queuetools () {
<a class="choice" href="javascript:;" type="links">all submissions</a>
<a class="choice dashed" href="javascript:;" type="self">self posts</a>
<a class="choice" href="javascript:;" type="flair">posts with flair</a>
<a class="choice" href="javascript:;" type="pointsgt">points >...</a>
<a class="choice" href="javascript:;" type="pointslt">points <...</a>
</div>
&nbsp;
<a href="javascript:;" class="tb-general-button inoffensive unhide-selected" accesskey="U">unhide&nbsp;all</a>
Expand Down Expand Up @@ -556,6 +558,16 @@ function queuetools () {
case 'flair':
selector = ':has(.linkflairlabel)';
break;
case 'pointsgt': {
const min = parseInt(prompt('points greater than:', ''));
selector = (_, el) => $(el).find('.score.unvoted').attr('title') > min;
break;
}
case 'pointslt': {
const max = parseInt(prompt('points less than:', ''));
selector = (_, el) => $(el).find('.score.unvoted').attr('title') < max;
break;
}
}
things.filter(selector).find('input[type=checkbox]').prop('checked', true);
});
Expand Down

0 comments on commit cc6e6a5

Please sign in to comment.