// ==UserScript== // @name Commits2PR // @namespace https://git.oschina.net/ // @version 0.3 // @description Add the commits to PR textarea. // @author Ruter // @match http://git.oschina.net/* // @match https://git.oschina.net/* // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; var btn2Pr = '
'; $(".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); })();