CTRL+S Shortcut

http://hackforums.net/showthread.php?tid=5207086

当前为 2016-03-19 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name CTRL+S Shortcut
  3. // @namespace Shortcut
  4. // @description http://hackforums.net/showthread.php?tid=5207086
  5. // @include *hackforums.net/showthread.php?tid=*
  6. // @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js
  7. // @version 0.2
  8. // @grant GM_getValue
  9. // ==/UserScript==
  10.  
  11. $(document).on("keydown", function(e){
  12. if (e.ctrlKey && e.which === 83) {
  13. if ($("#message").val() === "") {
  14. $(document).scrollTop(10000);
  15. $("#message").focus();
  16. } else {
  17. $("#quick_reply_submit").click();
  18. }
  19. e.preventDefault();
  20. return false;
  21. }
  22. });