[.01 Nova] Flag images - Undesirable content

1-9 to select images, 0 to select none of the above. Hide instructions and autosubmit optional.

当前为 2015-07-23 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name            [.01 Nova] Flag images - Undesirable content
// @author          robert
// @namespace       https://greasyfork.org/en/users/13168-robert
// @include         https://www.mturkcontent.com/dynamic/hit*
// @description:en  1-9 to select images, 0 to select none of the above. Hide instructions and autosubmit optional. Works best with 10-key.
// @version         1.1
// @require         https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js
// @grant           none
// @description 1-9 to select images, 0 to select none of the above. Hide instructions and autosubmit optional.
// ==/UserScript==

// Based heavily on Kadauchi's Nova Compare two products
// https://greasyfork.org/en/scripts/10843-nova-compare-two-products/code
// THANK YOU to kadauchi and ikarma for getting this to work 

var hideInstructions=true;
var autoSubmit=false;

//if ($("p:contains('Please mark the images')").length)
  if ($("p:contains('Please mark the images')").length)
  runScript();

function runScript()
{
  if (hideInstructions)
  { 
      $(".panel-body").hide();
      $(".panel-heading").click
      (
          function() 
          {    
              $(".panel-body").toggle();
          }
      );
  }
  var cb1 = document.getElementById('checkbox1');
	var cb2 = document.getElementById('checkbox2');
	var cb3 = document.getElementById('checkbox3');
	var cb4 = document.getElementById('checkbox4');
	var cb5 = document.getElementById('checkbox5');		
	var cb6 = document.getElementById('checkbox6');
	var cb7 = document.getElementById('checkbox7');
	var cb8 = document.getElementById('checkbox8');
	var cb9 = document.getElementById('checkbox9');
	var cb0 = document.getElementById('checkbox0'); //none of the above
  cb4.focus();

  window.onkeydown = function(e)
  {
    if (e.keyCode === 97 || e.keyCode === 49) //1 key 
      cb7.click();
    if (e.keyCode === 98 || e.keyCode === 50) //2 key
      cb8.click();
    if (e.keyCode === 99 || e.keyCode === 51) //3 key
      cb9.click();
    if (e.keyCode === 100 || e.keyCode === 52) //4 key
      cb4.click();
    if (e.keyCode === 101 || e.keyCode === 53) //5 key
      cb5.click();
    if (e.keyCode === 102 || e.keyCode === 54) //6 key
      cb6.click();		
		if (e.keyCode === 103 || e.keyCode === 55) //7 key
      cb1.click();
    if (e.keyCode === 104 || e.keyCode === 56) //8 key
      cb2.click();
    if (e.keyCode === 105 || e.keyCode === 57) //9 key
      cb3.click();	
    if (e.keyCode === 96 || e.keyCode === 58) //0
    {
      cb0.click();
			if(autoSubmit)
				$("input[id='submitButton']" ).click();
    }     
    if (e.keyCode === 13 ) //enter
      $("input[id='submitButton']" ).click();
  };
} //end runscript ()