Last active
January 2, 2016 08:49
-
-
Save bentleyo/8278671 to your computer and use it in GitHub Desktop.
BitBucket GitHub App clone link
This file contains hidden or 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
// ==UserScript== | |
// @name F Yo SourceTree | |
// @namespace https://gist.github.com/bentleyo/8278671 | |
// @version 0.1.2 | |
// @description Replace SourceTree clone link with a link for GitHub app | |
// @match https://bitbucket.org/* | |
// @copyright 2013+, Bentley O'Kane-Chase | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js | |
// ==/UserScript== | |
$( window ).load(function() { | |
var info = $('.clone-in-sourcetree').removeClass('clone-in-sourcetree'); | |
var button = info.find('button'); | |
button.off().text('Clone in GitHub').addClass('clone-in-github'); | |
$('.clone-in-github').click(function() {window.location = 'github-mac://openRepo/' + $(this).closest('.clone-in-sourcetree').data('ssh-url')}); | |
$('body').on('click', '.clone-in-github', function() { | |
window.open('github-mac://openRepo/' + info.data('ssh-url'), '_self'); | |
}); | |
}); |
Run on window load instead of dom ready as it seems bitbucket isn't ready by this point
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently specific to the GitHub Mac App & SSH, but can be customised.