diff --git a/scripts/github.user.js b/scripts/github.user.js index 6fe4e88..e9aa973 100644 --- a/scripts/github.user.js +++ b/scripts/github.user.js @@ -11,14 +11,15 @@ function addButton() { const buttonContainerElement = document.querySelector('.gh-header-actions'); + const pr= window.location.pathname.split('/')[4]; + const div = document.createElement('div'); div.classList = 'flex-md-order-2 pr_tracker'; - const pr= window.location.pathname.split('/')[4]; const btn = document.createElement('button'); btn.classList = 'Button--secondary Button--small Button'; btn.type = 'button'; - btn.innerText = `Subscribe`; + btn.innerText = `nim add`; btn.addEventListener('click', function() { navigator.clipboard.writeText("nim add-pr " + pr); }); @@ -26,6 +27,21 @@ function addButton() { div.appendChild(btn); buttonContainerElement.firstElementChild.before(div); + + const div2 = document.createElement('div'); + div2.classList = 'flex-md-order-2 pr_tracker'; + + const btn2 = document.createElement('button'); + btn2.classList = 'Button--secondary Button--small Button'; + btn2.type = 'button'; + btn2.innerText = `nixpkgs-review`; + btn2.addEventListener('click', function() { + navigator.clipboard.writeText("nixpkgs-review pr " + pr); + }); + + + div2.appendChild(btn2); + buttonContainerElement.firstElementChild.before(div2); } function maybeAddButton(){