Created
January 24, 2016 18:52
-
-
Save drmohundro/eef967b2d64c46088fb1 to your computer and use it in GitHub Desktop.
Bookmarklet to hide rows on various source hosting sites
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
var url = window.location.href; | |
var searchTextToIgnore = prompt('Enter text to ignore:'); | |
if (url.match(/bitbucket/)) { | |
$('h1:contains(' + searchTextToIgnore + ')').closest('section').hide(); | |
} else if (url.match(/gitlab/)) { | |
$('.diff-header span:contains(' + searchTextToIgnore + ')').parent().parent().hide(); | |
} else { | |
alert(url + " doesn't match any known sites."); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is just a simple script that can hide sections within a pull request on (currently) GitLab or Bitbucket. As an example, if there is generated code that is checked in, it might be useful to ignore that while reviewing the pull request. This script prompts the user for a partial string match so that it can hide those sections.
It currently assumes jQuery is loaded, but it wouldn't be hard to remove that dependency.
I used this Bookmarklet Creator to convert this into a bookmarklet.