Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var commits = '';
- Array.prototype.slice.call(document.getElementsByTagName('code')).filter(function (code) {
- return code.children[0].classList.contains("message");
- }).forEach(function (code) {
- var commit = code.children[0].text;
- if (commit.indexOf('Merge') != 0) commits += commit + "\r";
- });
- var body = document.getElementsByTagName('body')[0];
- var span = document.createElement('span');
- span.textContent = commits;
- body.appendChild(span);
- var range = document.createRange();
- range.selectNodeContents(span);
- var selection = window.getSelection();
- selection.removeAllRanges();
- selection.addRange(range);
- document.execCommand('copy');
- selection.removeAllRanges();
- body.removeChild(span);
Add Comment
Please, Sign In to add comment