add_download_button

Add second download button just above Thanks box

  1. // ==UserScript==
  2. // @name add_download_button
  3. // @namespace empornium.me
  4. // @version 0.1
  5. // @author hwang
  6. // @description Add second download button just above Thanks box
  7. // @include http://*empornium*/torrents.php?id*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. //Find and clone download button element
  12. var link = Sizzle("#torrent_buttons")[0].cloneNode(true);
  13.  
  14. //Find <div> to insert into
  15. var main = Sizzle("#content .main_column")[0];
  16.  
  17. //Find <div> to insert before
  18. var target = Sizzle('.head:contains(Thanks)')[0];
  19.  
  20. //Create new <div> element and place button into it
  21. var new_div = document.createElement('div');
  22. new_div.innerHTML = link.innerHTML;
  23.  
  24. //Insert new <div> into page
  25. main.insertBefore(new_div, target);