Vessel Turk speeder-upper

Defaults all radio buttons to "no", does the math at the end for you, and focuses the submit button

当前为 2015-11-22 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Vessel Turk speeder-upper
  3. // @namespace mobiusevalon.tibbius.com
  4. // @version 0.1
  5. // @description Defaults all radio buttons to "no", does the math at the end for you, and focuses the submit button
  6. // @author Mobius Evalon
  7. // @match https://www.mturkcontent.com/dynamic/hit*
  8. // @require https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. $(document).ready(function() {
  13. var matches = /What is (\d*)\+(\d*)\?/i.exec($("label").last().text());
  14.  
  15. if(matches !== null)
  16. {
  17. $("input:radio[value=no]").prop('checked',true);
  18. $("input:text[name=captcha]").val((matches[matches.length-1]*1)+(matches[matches.length-2]*1));
  19. $("#submitButton").focus();
  20. $(document).keydown(function(event) {if(event.which === 13) $("#submitButton").click();})
  21. }
  22. });