|
1 | 1 | // ==UserScript== |
2 | 2 | // @name Auto-Merge Dependabot PRs |
3 | 3 | // @namespace typpi.online |
4 | | -// @version 6.3 |
| 4 | +// @version 6.4 |
5 | 5 | // @description Merges Dependabot PRs in any of your repositories - pulls the PRs into a table and lets you select which ones to merge. |
6 | 6 | // @author Nick2bad4u |
7 | 7 | // @match https://github.com/notifications |
|
20 | 20 | // @downloadURL https://update.greasyfork.org/scripts/525498/Auto-Merge%20Dependabot%20PRs.user.js |
21 | 21 | // @updateURL https://update.greasyfork.org/scripts/525498/Auto-Merge%20Dependabot%20PRs.meta.js |
22 | 22 | // ==/UserScript== |
23 | | -/* global GM_getValue, GM_setValue, GM_xmlhttpRequest */ |
| 23 | +/* global GM_getValue, GM_setValue, GM_addStyle, GM_xmlhttpRequest */ |
24 | 24 | // @var number merge_delay "Delay between merge requests in milliseconds" 2000 |
25 | 25 |
|
26 | 26 | (async function () { |
|
727 | 727 | }, 5000); |
728 | 728 | } |
729 | 729 |
|
730 | | - const style = document.createElement('style'); |
731 | | - document.head.appendChild(style); |
732 | | - style.textContent = ` |
| 730 | + const mainCSS = ` |
733 | 731 | .merge-button, mergebutton, body > div.pr-selection-container > button { |
734 | 732 | position: fixed; |
735 | 733 | bottom: 10px; |
|
779 | 777 | } |
780 | 778 | .merge-button { |
781 | 779 | transition: background-color 0.3s ease; |
| 780 | + } |
| 781 | + .pr-selection-container { |
| 782 | + position: fixed; |
| 783 | + bottom: 50px; |
| 784 | + right: 10px; |
| 785 | + z-index: 1000; |
| 786 | + background-color: #79e4f2; |
| 787 | + color: #000000; |
| 788 | + padding: 10px; |
| 789 | + border: 1px solid #ccc; |
| 790 | + max-height: 300px; |
| 791 | + overflow-y: auto; |
| 792 | + min-width: 350px; |
| 793 | + box-sizing: border-box; |
| 794 | + box-shadow: 0 2px 8px rgba(0,0,0,0.15); |
| 795 | + } |
| 796 | + .pr-selection-close { |
| 797 | + display: inline-block; |
| 798 | + width: 32px; |
| 799 | + height: 32px; |
| 800 | + line-height: 32px; |
| 801 | + text-align: center; |
| 802 | + position: absolute; |
| 803 | + top: 2px; |
| 804 | + right: 6px; |
| 805 | + cursor: pointer; |
| 806 | + font-weight: bold; |
| 807 | + color: #333; |
| 808 | + background: none; |
| 809 | + border: none; |
| 810 | + font-size: 1.2em; |
| 811 | + padding: 0; |
782 | 812 | } |
783 | 813 | `; |
| 814 | + if (typeof GM_addStyle === 'function') { |
| 815 | + GM_addStyle(mainCSS); |
| 816 | + } else { |
| 817 | + // fallback for environments without GM_addStyle |
| 818 | + const fallbackStyle = document.createElement('style'); |
| 819 | + fallbackStyle.textContent = mainCSS; |
| 820 | + document.head.appendChild(fallbackStyle); |
| 821 | + } |
| 822 | + |
784 | 823 | window.addEventListener('load', addButton); |
785 | 824 |
|
786 | 825 | function showConfigPanel() { |
|
0 commit comments