(mTurk) ProductRnR Query Image

Selects "Related" for all images. Click the image to flag. Left click selects "Unrelated". Right click selects "Related". Middle click selects "Image didn't load".

  1. // ==UserScript==
  2. // @name (mTurk) ProductRnR Query Image
  3. // @version 0.1
  4. // @description Selects "Related" for all images. Click the image to flag. Left click selects "Unrelated". Right click selects "Related". Middle click selects "Image didn't load".
  5. // @author Original: Eric Fraze, Query Image Clone: Young Tuga
  6. // @match https://s3.amazonaws.com/mturk_bulk/hits/*
  7. // @match https://www.mturkcontent.com/dynamic/hit*
  8. // @grant none
  9. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js
  10. // @namespace https://gf.qytechs.cn/users/11594
  11. // ==/UserScript==
  12.  
  13. $(document).ready(function() {
  14. // Make sure we are on the right HIT
  15. if ( $("title:contains('Query Image Labeling')").length ) {
  16.  
  17. // Select 'Related' as default
  18. $("input[value='QueryImage_Related']").click();
  19.  
  20. // Detect mouse clicks
  21. $('.imagebox').mouseup(function (evt) {
  22. var par = $(this).parent();
  23. if (evt.which === 1) { // left-click
  24. if (evt.originalEvent.detail === 1) {
  25. $("input[value='QueryImage_Unrelated']", par).click();
  26. $("#SubmitButton").focusWithoutScrolling();
  27. }
  28. }
  29.  
  30. if (evt.which === 2) { // middle-click
  31. if (evt.originalEvent.detail === 1) {
  32. $("input[value='NoLoad']", par).click();
  33. $("#SubmitButton").focusWithoutScrolling();
  34. }
  35. }
  36.  
  37. if (evt.which === 3) { // right-click
  38. if (evt.originalEvent.detail === 1) {
  39. $("input[value='QueryImage_Related']", par).click();
  40. $("#SubmitButton").focusWithoutScrolling();
  41. }
  42. }
  43. });
  44.  
  45. // Disable image link and make a new link under the image.
  46. $(".imagebox").filter(function(index) {
  47. var url = $("a", this).attr("href");
  48. $(this).after("<a href='" + url + "' target='_blank'>Open full image</a>");
  49. $("a", this).removeAttr("href");
  50. $("a", this).removeAttr("target");
  51. });
  52.  
  53. // suppress the right-click menu
  54. $('.imagebox').on('contextmenu', function (evt) {
  55. evt.preventDefault();
  56. });
  57.  
  58. // Stop scrolling on focus of radio button
  59. $.fn.focusWithoutScrolling = function(){
  60. var x = window.scrollX, y = window.scrollY;
  61. this.focus();
  62. window.scrollTo(x, y);
  63. };
  64.  
  65. // Stop scrolling on middle mouse press
  66. $(".imagebox").on("mousedown", function (e) { e.preventDefault(); } );
  67. }
  68. });

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址