Greasy Fork is available in English.

GitHub Copy Ticket Ref

Adds a button next to issue actions to copy issue ref (e.g. org/repo#123)

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

  1. // ==UserScript==
  2. // @name GitHub Copy Ticket Ref
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Adds a button next to issue actions to copy issue ref (e.g. org/repo#123)
  6. // @author Ryan Allison
  7. // @match https://github.com/*/*/issues/*
  8. // @grant GM_setClipboard
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function () {
  13. 'use strict';
  14.  
  15. const insertButton = () => {
  16. if (document.getElementById('copy-ticket-ref-btn')) return;
  17.  
  18. const pathMatch = window.location.pathname.match(/^\/([^\/]+)\/([^\/]+)\/issues\/(\d+)/);
  19. if (!pathMatch) return;
  20.  
  21. const [_, owner, repo, issueNum] = pathMatch;
  22. const issueRef = `${owner}/${repo}#${issueNum}`;
  23.  
  24. // Find the GitHub issue action button container
  25. const actionContainer = document.querySelector('[data-component="PH_Actions"] .Box-sc-g0xbh4-0');
  26. if (!actionContainer) return;
  27.  
  28. const button = document.createElement('button');
  29. button.id = 'copy-ticket-ref-btn';
  30. button.textContent = '📋 Copy Ticket Ref';
  31. button.className = 'prc-Button-ButtonBase-c50BI'; // Match GitHub style
  32. button.setAttribute('data-size', 'medium');
  33. button.setAttribute('data-variant', 'invisible');
  34. button.style.marginLeft = '8px';
  35.  
  36. button.onclick = () => {
  37. navigator.clipboard.writeText(issueRef);
  38. button.textContent = '✅ Copied!';
  39. setTimeout(() => {
  40. button.textContent = '📋 Copy Ticket Ref';
  41. }, 2000);
  42. };
  43.  
  44. actionContainer.appendChild(button);
  45. };
  46.  
  47. // Observe DOM for GitHub SPA navigation
  48. const observer = new MutationObserver(() => {
  49. insertButton();
  50. });
  51.  
  52. observer.observe(document.body, {
  53. childList: true,
  54. subtree: true,
  55. });
  56.  
  57. insertButton();
  58. })();