Last active
August 1, 2018 13:21
-
-
Save eegeeZA/7c7ddc568beca394708284306b220a51 to your computer and use it in GitHub Desktop.
Add the total line number difference to Bitbucket pull requests.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
let added = 0; | |
let removed = 0; | |
const fileItem = $(".iterable-item.file"); | |
fileItem.each((i, element) => { | |
added += parseInt($(element).find(".lines-added")[0].innerHTML); | |
removed += parseInt($(element).find(".lines-removed")[0].innerHTML); | |
}); | |
fileItem.last().after(`<li class="iterable-item file"><div class="commit-file-diff-stats"><span class="lines-added">+${added}</span><span class="lines-removed">${removed}</span></div><span class="diff-summary-lozenge aui-lozenge aui-lozenge-subtle aui-lozenge-complete" style="width: 48px;">Total</span><a class="commit-files-summary--filename execute"></a></li>`); | |
})(); | |
// Bookmarklet => javascript:(function(){var b=0,c=0,a=$(".iterable-item.file");a.each(function(a,d){b+=parseInt($(d).find(".lines-added")[0].innerHTML);c+=parseInt($(d).find(".lines-removed")[0].innerHTML)});a.last().after('<li class="iterable-item file"><div class="commit-file-diff-stats"><span class="lines-added">+'+b+'</span><span class="lines-removed">'+c+'</span></div><span class="diff-summary-lozenge aui-lozenge aui-lozenge-subtle aui-lozenge-complete" style="width: 48px;">Total</span><a class="commit-files-summary--filename execute"></a></li>')})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment