Fontz Quiz Timer & Keyboard Shortcuts

%description%

当前为 2015-09-12 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Fontz Quiz Timer & Keyboard Shortcuts
  3. // @namespace http://idlewords.net
  4. // @description %description%
  5. // @include http://50.116.7.11:9998/learningQuizController_turk/quiz
  6. // @include http://50.116.7.11:9998/learningQuizController_turk/quiz_answer
  7. // @version 0.1
  8. // @require https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js
  9. // @require https://greasyfork.org/scripts/12377-timecircles/code/TimeCircles.js?version=73868
  10. // @grant GM_log
  11. // ==/UserScript==
  12.  
  13. this.$ = this.jQuery = jQuery.noConflict(true);
  14. $(document).ready(function() {
  15. if (document.location.href.search('answer') < 0) {
  16. $("head").append(
  17. $("<link></link>")
  18. .attr('rel', 'stylesheet')
  19. .attr('href', 'http://git.wimbarelds.nl/TimeCircles/inc/TimeCircles.css')
  20. .attr('type', 'text/css')
  21. );
  22. $("div[align='right']").after(
  23. $("<div></div>")
  24. .css({'height': '200px', 'width': '500'})
  25. .addClass('timer')
  26. );
  27. $(".timer").TimeCircles({
  28. time: {
  29. Days: { show: false },
  30. Hours: { show: false },
  31. Minutes: { color: "#BBFFBB" },
  32. Seconds: { color: "#FF9999" }
  33. }
  34. });
  35. $(document).keydown(function(event) {
  36. if (event.which == 83 && event.ctrlKey) {
  37. event.preventDefault();
  38. $("#submitButton").click();
  39. } else if (event.which == 89) {
  40. event.preventDefault();
  41. $("#deformfield1-0").prop('checked', true);
  42. } else if (event.which == 78) {
  43. event.preventDefault();
  44. $("#deformfield1-1").prop('checked', true);
  45. }
  46. });
  47. } else {
  48. $(document).keydown(function(event) {
  49. if (event.which == 83 && event.ctrlKey) {
  50. event.preventDefault();
  51. $("input[name='Continue']").click();
  52. }
  53. });
  54. }
  55. });