Heart smiley

Custom Userscript fo replace <3 by an heart

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

  1. // ==UserScript==
  2. // @name Heart smiley
  3. // @namespace HF - Hash G.
  4. // @description Custom Userscript fo replace <3 by an heart
  5. // @include *hackforums.net/showthread.php*
  6. // @include *hackforums.net/newreply.php*
  7. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js
  8. // @version 0.1
  9. // @grant GM_getValue
  10. // ==/UserScript==
  11.  
  12.  
  13.  
  14. if (location.href.match(/newreply.php/i)) {
  15. $(".quick_keys > form[action*='newreply.php']").submit(function(e) {
  16. //e.preventDefault();
  17. msg = $("textarea[id*='message']").val()
  18. msg = msg.replace("<3", "❤");
  19. $("textarea[id*='message']").val(msg);
  20. $(".quick_keys > form[action*='newreply.php']").submit();
  21. });
  22. } else if (location.href.match(/showthread.php/i)) {
  23. $("#quick_reply_submit").on("click", function() {
  24. msg = $("#message").val()
  25. msg = msg.replace("<3", "❤");
  26. $("#message").val(msg);
  27. console.log("k");
  28. });
  29. }