mmmturkeybacon Single Page Queue

Shows all HITs in the queue on a single page.

目前為 2015-05-26 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name mmmturkeybacon Single Page Queue
  3. // @version 1.20
  4. // @description Shows all HITs in the queue on a single page.
  5. // @author mmmturkeybacon
  6. // @namespace http://userscripts.org/users/523367
  7. // @match https://*.mturk.com/mturk/myhits
  8. // @match https://*.mturk.com/mturk/sortmyhits?*
  9. // @match https://*.mturk.com/mturk/viewmyhits?*
  10. // @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
  11. // @grant GM_log
  12. // ==/UserScript==
  13.  
  14. $(document).ready(function()
  15. {
  16. var $searchSpec = $("input[type='hidden'][value^='HITSearch'][name='searchSpec']");
  17. var old_searchSpec = $searchSpec.val().match(/^HITSearch\#T\#1\#[0-9]*\#-1\#T\#/);
  18. var new_searchSpec = $searchSpec.val().replace(old_searchSpec, 'HITSearch#T#1#10#-1#T#');
  19. $searchSpec.val(new_searchSpec);
  20.  
  21. var $go_button = $('input[name="/sort"]');
  22. $go_button.after('<input id="mtbspq_button" type="button" value="SHOW ALL" style="vertical-align: middle; height: 21px; color: white; background-color: #CB6533; font-weight: 600; margin-left: 3px; border-radius: 10px; moz-border-radius: 10px; webkit-border-radius: 10px; border:1px white solid;">');
  23. $('input[id="mtbspq_button"]').bind('click', function()
  24. {
  25. // Show up to 99 HITs on a single page. The most HITs I've ever seen in a full queue is 27, so set the max to 99 (instead of 25) to get every HIT and to future proof.
  26. old_searchSpec = $searchSpec.val().match(/^HITSearch\#T\#1\#[0-9]*\#-1\#T\#/);
  27. new_searchSpec = $searchSpec.val().replace(old_searchSpec, 'HITSearch#T#1#99#-1#T#');
  28. $searchSpec.val(new_searchSpec);
  29. $go_button[0].click();
  30. });
  31. });