PTH Fixed submit link

Add a link that can submit the upload form from anywhere on the page

目前为 2016-12-18 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name PTH Fixed submit link
  3. // @version 0.1
  4. // @description Add a link that can submit the upload form from anywhere on the page
  5. // @author Chameleon
  6. // @include http*://passtheheadphones.me/upload.php*
  7. // @grant none
  8. // @namespace https://greasyfork.org/users/87476
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. var a=document.createElement('a');
  15. document.body.appendChild(a);
  16. a.href='javascript:void(0);';
  17. a.setAttribute('style', 'display: block; padding: 10px; border-radius: 10px; background: rgba(0,0,0,0.7); color: white; position: fixed; bottom: 10px; margin: auto; left: 0; right: 0; text-align: center; width: 100px; border: rgba(255,255,255,0.3) solid 2px;');
  18. a.innerHTML = 'Upload torrents';
  19. a.addEventListener('click', uploadTorrents, false);
  20. })();
  21.  
  22. function uploadTorrents()
  23. {
  24. document.getElementById('post').click();
  25. }