Notepad in Full Reply mode

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

  1. // ==UserScript==
  2. // @name Notepad in Full Reply mode
  3. // @namespace Notepad in Full Reply
  4. // @description http://hackforums.net/showthread.php?tid=5212290
  5. // @include *hackforums.net/newreply.php?tid=*
  6. // @include *hackforums.net/newthread.php?fid=*
  7. // @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js
  8. // @version 0.1.1
  9. // @grant GM_getValue
  10. // @grant GM_setValue
  11. // ==/UserScript==
  12.  
  13. var notepadContent = GM_getValue("notepadContent", "Put content here and click save");
  14.  
  15. setTimeout(function() {
  16. console.log("azeae");
  17. $("head").append("<style>.messageEditor { float: left }</style>");
  18. $("table.tborder:nth-child(2) > tbody:nth-child(1) > tr:nth-child(4) > td:nth-child(2)").attr("style", "width: 50%");
  19. $("#message_old").after("<div style='float: center; margin-left: " + ($(".messageEditor").width() + 70) + "px;' ><textarea id='notepad' style='height:"+($(".messageEditor").height() - 70)+"px;width:200px'>"+notepadContent+"</textarea><div><button id='saveNotepad' class='button'>Save</button></div></div>");
  20. $("#saveNotepad").on("click", function() {
  21. GM_setValue("notepadContent", $("#notepad").val());
  22. return false;
  23. });
  24. }, 600);