[.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 提交的版本,檢視 最新版本

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

You will need to install an extension such as Tampermonkey to install this script.

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 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 ()