Last active
October 25, 2022 13:23
-
-
Save ErgEnn/0ad1b2f0d9bc350fb38efcd3d65e3958 to your computer and use it in GitHub Desktop.
Removes the GIT CLI command for branch creation from Create Branch menu for easier copying
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
// ==UserScript== | |
// @name JiraCopyBranchName | |
// @namespace | |
// @version 0.1 | |
// @description Removes the GIT CLI command for branch creation from Create Branch menu for easier copying | |
// @author Ergo Enn | |
// @match https://*/browse* | |
// @match https://*/jira/software* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=atlassian.net | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js | |
// @downloadURL | |
// @updateURL | |
// ==/UserScript== | |
var $j = jQuery.noConflict(true); | |
$j(document).ready(function () { | |
$j( "body" ).bind("DOMSubtreeModified", function(){ | |
var popup = $j('*[data-testid="development-summary-branch.ui.create-branch-dropdown.git-command-section"]'); | |
if(popup.is(":visible")){ | |
var inp = $j('*[data-testid="platform-copy-text-field.textfield--"]'); | |
if(!inp) | |
return; | |
var parts = inp.val().split(" ") | |
var last = parts[parts.length-1]; | |
inp.val(last); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment