Greasy Fork

MTURK IC3 Speech QA HITs quick play w/hotkey

Auto play sound clip when clicking on a new tab (hotkeys for tabs 1 - 12 are numbers 1 - 0 , the '-' key for tab 11, and the '=' key for tab 12 )

当前为 2020-04-12 提交的版本,查看 最新版本

// ==UserScript==
// @name         MTURK IC3 Speech QA HITs quick play w/hotkey
// @namespace    https://greasyfork.org/en/scripts/400509-mturk-ic3-ai-team-speech-qa
// @version      1.4
// @description  Auto play sound clip when clicking on a new tab (hotkeys for tabs 1 - 12 are numbers 1 - 0 , the '-' key for tab 11, and the '=' key for tab 12 )
// @author       curtidawg
// @include      *mturkcontent.com/*
// @include      *worker.mturk.com/projects/*
// @exclude      https://worker.mturk.com/direct_deposit*
// @exclude      https://worker.mturk.com/payment_schedule*
// @require      http://code.jquery.com/jquery-3.4.1.js
// @grant        GM_getValue // this will help prevent a bug in js
// ==/UserScript==




$( "#Q1-tab" ).click(function() { // if Q1-tab is clicked
    document.querySelector("#baudio_q1").click(); // baudio_q1 audio clip will play
});

$( "#Q2-tab" ).click(function() {
    document.querySelector("#baudio_q2").click();
});

$( "#Q3-tab" ).click(function() {
    document.querySelector("#baudio_q3").click();
});

$( "#Q4-tab" ).click(function() {
    document.querySelector("#baudio_q4").click();
});

$( "#Q5-tab" ).click(function() {
    document.querySelector("#baudio_q5").click();
});

$( "#Q6-tab" ).click(function() {
    document.querySelector("#baudio_q6").click();
});

$( "#Q7-tab" ).click(function() {
    document.querySelector("#baudio_q7").click();
});

$( "#Q8-tab" ).click(function() {
    document.querySelector("#baudio_q8").click();
});

$( "#Q9-tab" ).click(function() {
    document.querySelector("#baudio_q9").click();
});

$( "#Q10-tab" ).click(function() {
    document.querySelector("#baudio_q10").click();
});

$( "#Q11-tab" ).click(function() {
    document.querySelector("#baudio_q11").click();
});

$( "#Q12-tab" ).click(function() {
    document.querySelector("#baudio_q12").click();
});



    $(document).keypress(function(event) { //press a keyboard button
        if ( event.which == 49 ) { // 49 is the 1 key....the keycode number identifies which key... go to "https://www.w3schools.com/charsets/ref_html_8859.asp" to find out which key is which this HIT is using ISO-8859-1 Character Set
            document.querySelector("#Q1-tab").click(); // this will select the tab by Id and click on that tab... replace Q1-tab to change
    }
});

	$(document).keypress(function(event) {
        if ( event.which == 50 ) {
            document.querySelector("#Q2-tab").click();
    }
});

    $(document).keypress(function(event) {
        if ( event.which == 51 ) {
            document.querySelector("#Q3-tab").click();
      }
});
    $(document).keypress(function (event) {
        if ( event.which == 52 ) {
            document.querySelector("#Q4-tab").click();
        }
});

    $(document).keypress(function(event) {
        if ( event.which == 53 ) {
            document.querySelector("#Q5-tab").click();
          }
});

    $(document).keypress(function(event) {
        if ( event.which == 54 ) {
            document.querySelector("#Q6-tab").click();
            }
});

    $(document).keypress(function(event) {
        if ( event.which == 55 ) {
            document.querySelector("#Q7-tab").click();
              }
});

    $(document).keypress(function(event) {
        if ( event.which == 56 ) {
            document.querySelector("#Q8-tab").click();
                }
});

    $(document).keypress(function(event) {
        if ( event.which == 57 ) {
            document.querySelector("#Q9-tab").click();
                  }
});

    $(document).keypress(function(event) {
        if ( event.which == 48 ) {
            document.querySelector("#Q10-tab").click();
                    }
});

    $(document).keypress(function(event) {
        if ( event.which == 45 ) {
            document.querySelector("#Q11-tab").click();
                    }
});

    $(document).keypress(function(event) {
		if ( event.which == 61 ) {
			document.querySelector("#Q12-tab").click();
			                    }
});