🏠 Home 

Commits2PR

Add the commits to PR textarea.


Install this script?
  1. // ==UserScript==
  2. // @name Commits2PR
  3. // @namespace https://git.os#####.net/
  4. // @version 1.0
  5. // @description Add the commits to PR textarea.
  6. // @author Ruter
  7. // @match http://git.os#####.net/*
  8. // @match http://gitee.com/*
  9. // @match https://git.os#####.net/*
  10. // @match https://gitee.com/*
  11. // @grant none
  12. // ==/UserScript==
  13. (function() {
  14. 'use strict';
  15. var btn2Pr = '<div class="btn-group"><button type="button" title="Add commits to PR textarea" tabindex="-1" data-hotkey="Ctrl+Alt+P" data-toggle="button" class="add2pr"><span class="fa fa-arrow-down"></span></button></div>';
  16. $(".md-editor > .md-header.btn-toolbar").append(btn2Pr);
  17. function add2Pr () {
  18. var commits = [];
  19. $(".row_title").each(function(){
  20. commits.push($(this).text());
  21. });
  22. $("textarea.md-input").first().val(commits.join('\n\n'));
  23. }
  24. $(".add2pr").click(add2Pr);
  25. })();