Commits2PR

Add the commits to PR textarea.

目前为 2017-03-30 提交的版本。查看 最新版本

// ==UserScript==
// @name         Commits2PR
// @namespace    https://git.oschina.net/
// @version      0.2
// @description  Add the commits to PR textarea.
// @author       Ruter
// @match        https://git.oschina.net/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    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>';
    $(".md-editor > .md-header.btn-toolbar").append(btn2Pr);
    
    function add2Pr () {
        var commits = [];
        $(".row_title").each(function(){
            commits.push($(this).text());
        });
        $("textarea.md-input").first().val(commits.join('\n\n'));
    }
    
    $(".add2pr").click(add2Pr);
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址