Greasy Fork is available in English.

Pastebin Keybindings

Binds keys to the Pastebin website.

  1. // ==UserScript==
  2. // @name Pastebin Keybindings
  3. // @version 1.1.1
  4. // @description Binds keys to the Pastebin website.
  5. // @author celliott1997
  6. // @iconURL http://www.pastebin.com/favicon.ico
  7. // @include http*://*pastebin.com/*
  8. // @run-at document-body
  9. // @grant none
  10. // @namespace https://greatest.deepsurf.us/users/8398
  11. // ==/UserScript==
  12.  
  13. $(document).ready(function(){
  14. var TextArea = $("textarea#paste_code");
  15. var SubmitBtn = $("input.button1.btnbold[type='submit']");
  16. var PasteInfo = $(".paste_box_info");
  17. function GetID(){return location.href.match("pastebin.com/([0-9a-zA-Z]+)")[1]};
  18. $(document).keydown(function(evt){
  19. if (evt.ctrlKey && (evt.which == 83)){
  20. evt.preventDefault();
  21. if (TextArea.length && SubmitBtn.length){
  22. SubmitBtn.click();
  23. }else if (PasteInfo.length){
  24. location.href = "/download.php?i="+GetID();
  25. };
  26. }else if(evt.ctrlKey && (evt.which == 79)){
  27. evt.preventDefault();
  28. if (PasteInfo.length){
  29. location.href = "/edit.php?i="+GetID();
  30. };
  31. };
  32. });
  33. });