Sergey Schmidt Submit

Fix buttons, clean instructions, use other scripts for individual HITs for efficient workflow. Make hide instructions from Kadauchi work for Sergey's (usual) formatting.

Від 18.10.2016. Дивіться остання версія.

  1. // ==UserScript==
  2. // @name Sergey Schmidt Submit
  3. // @description Fix buttons, clean instructions, use other scripts for individual HITs for efficient workflow. Make hide instructions from Kadauchi work for Sergey's (usual) formatting.
  4. // @author ChrisTurk
  5. // @require https://code.jquery.com/jquery-3.1.0.min.js
  6. // @include /^https://(www|s3)\.(mturkcontent|amazonaws)\.com/
  7. // @version 0.0.1.20161018145318
  8. // @namespace https://greasyfork.org/users/53857
  9. // ==/UserScript==
  10.  
  11. $(document).ready(function(){
  12. if ($( 'body:contains(Instructions [-])' ).length) { SergeyPls(); }
  13. });
  14.  
  15. function SergeyPls() {
  16. // Fix submit button, enable it just in case
  17. $( '#submitButton' ).css('display','block');
  18. $( '#submitButton' ).prop("disabled", false);
  19.  
  20. // Creates button and hides instructions.
  21. $( '#instructions' ).before('<button id="toggle" type="button"><span>Show Instructions</span></button>');
  22. $( '#instructions' ).hide();
  23. $( '#sample-task' ).hide();
  24. $( '#please-note' ).hide();
  25.  
  26. // Toggles instructions and changes toggle text.
  27. $( '#toggle' ).click(function() {
  28. $( '#instructions' ).toggle();
  29. $( '#sample-task' ).toggle();
  30. $( '#please-note' ).toggle();
  31. $( '#toggle' ).text() == 'Show Instructions' ? str = 'Hide Instructions' : str = 'Show Instructions';
  32. $( '#toggle span' ).html(str);
  33. }); //toggle function end
  34.  
  35. }