MTurkGrind.com Plus

Style tweaks and keyboard shortcuts for MTurkForum.com

目前为 2015-01-17 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name MTurkGrind.com Plus
  3. // @author Chet Manley
  4. // @version 0.2x
  5. // @description Style tweaks and keyboard shortcuts for MTurkForum.com
  6. // @include http://www.mturkgrind.com/*
  7. // @require http://code.jquery.com/jquery-latest.min.js
  8. // @grant GM_log
  9. // @namespace https://greasyfork.org/users/6438
  10. // ==/UserScript==
  11.  
  12. // v0.2x, 2015-01-17: updates by clickhappier for MTG migration from vbulletin to xenforo
  13.  
  14. // v0.1, 2013-10-19 Style tweaks and keyboard shortcuts on MTurkForum.com
  15. // ---------------------------------------------------------------------------
  16.  
  17. $(document).ready(function () {
  18. // $('.postrow > .content').attr('style', 'font-size: 14px;');
  19. // $('a.quickreply').hide().next().hide();
  20.  
  21. $(window).keyup(function (e) {
  22. if (!$('input, textarea').is(':focus')) {
  23. var key = (e.keyCode ? e.keyCode : e.which);
  24. switch (key) {
  25. case 37: // Left arrow - Previous page
  26. if ($('div.PageNav > nav > a:contains("Prev")').first().attr('href')) {
  27. window.location.href = $('div.PageNav > nav > a:contains("Prev")').first().attr('href');
  28. }
  29. break;
  30. case 39: // Right arrow - Next page
  31. if ($('div.PageNav > nav > a:contains("Next")').first().attr('href')) {
  32. window.location.href = $('div.PageNav > nav > a:contains("Next")').first().attr('href');
  33. }
  34. break;
  35. case 73: // I - Inbox
  36. window.location.href = 'http://www.mturkgrind.com/conversations/';
  37. break;
  38. case 82: // R - Start a reply
  39. $('html, body').animate({ scrollTop: $("form#QuickReply").offset().top }, 100);
  40. break;
  41. case 83: // S - Settings
  42. window.location.href = 'http://www.mturkgrind.com/account/';
  43. break;
  44. default:
  45. break;
  46. }
  47. }
  48. });
  49. });