RelevanceQuest HIT Helper

(mTurk) Selects all "Non Adult" radio buttons in "Flag images - (WARNING: This HIT may contain adult content. Worker discretion is advised.)" Clicking on an image flags it as explicit. Clicking on an image twice flags it as fetish. Right clicking on an image flags it as gruesome. Middle clicking an image flags it as suggestive.

目前為 2014-10-21 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name       RelevanceQuest HIT Helper
// @namespace  http://ericfraze.com
// @version    0.6
// @description  (mTurk) Selects all "Non Adult" radio buttons in "Flag images - (WARNING: This HIT may contain adult content. Worker discretion is advised.)" Clicking on an image flags it as explicit. Clicking on an image twice flags it as fetish. Right clicking on an image flags it as gruesome. Middle clicking an image flags it as suggestive.
// @include    https://s3.amazonaws.com/mturk_bulk/hits/*
// @include    https://www.mturkcontent.com/dynamic/hit*
// @copyright  2014+, Eric Fraze
// @require    http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js
// ==/UserScript==

$(document).ready(function() {
    // Check all radi buttons as non-adult
	$("input[value='NOT_ADULT']").prop('checked', true);
    
    // Check "fetish" on double click
    $("img").dblclick( function() {
        // Check the button
        $(this).parents("td").find("input[value='PERVERSION']").click();

        // Focus so the enter key can submit the HIT
        $(this).parents("td").find("input[value='PERVERSION']").focusWithoutScrolling();

        // Change image opacity so the user knows the script ran correctly
        $(this).css("opacity", "0.6");
    });
    
    // All other mouse clicks
    $('img').mousedown(function(event) {
        switch (event.which) {
            case 1:
                // Check "Adult" on left click
                $(this).parents("td").find("input[value='EXPLICIT']").click();
                $(this).parents("td").find("input[value='EXPLICIT']").focusWithoutScrolling();
                $(this).css("opacity", "0.6");
                break;
            case 2:
                // Check "Suggestive" on middle click
                $(this).parents("td").find("input[value='SUGGESTIVE']").click();
                $(this).parents("td").find("input[value='SUGGESTIVE']").focusWithoutScrolling();
                $(this).css("opacity", "0.6");
                break;
            case 3:
                // Check "Gruesome" on right click
                $(this).parents("td").find("input[value='GRUESOME']").click();
                $(this).parents("td").find("input[value='GRUESOME']").focusWithoutScrolling();
                $(this).css("opacity", "0.6");
                break;
        }
    });
});

// Stop right click menu
document.addEventListener("contextmenu", function(e){
    if (e.target.nodeName === "IMG") {
        e.preventDefault();
    }
}, false);

// Stop scrolling on focus of radio button
$.fn.focusWithoutScrolling = function(){
  var x = window.scrollX, y = window.scrollY;
  this.focus();
  window.scrollTo(x, y);
};

// Stop scrolling on middle mouse press
$(document.body).on("mousedown", function (e) { e.preventDefault(); } );