Guest User

Untitled

a guest
Mar 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. var commits = '';
  2. Array.prototype.slice.call(document.getElementsByTagName('code')).filter(function (code) {
  3. return code.children[0].classList.contains("message");
  4. }).forEach(function (code) {
  5. var commit = code.children[0].text;
  6. if (commit.indexOf('Merge') != 0) commits += commit + "\r";
  7. });
  8. var body = document.getElementsByTagName('body')[0];
  9. var span = document.createElement('span');
  10. span.textContent = commits;
  11. body.appendChild(span);
  12. var range = document.createRange();
  13. range.selectNodeContents(span);
  14. var selection = window.getSelection();
  15. selection.removeAllRanges();
  16. selection.addRange(range);
  17. document.execCommand('copy');
  18. selection.removeAllRanges();
  19. body.removeChild(span);
Add Comment
Please, Sign In to add comment