Skip to content

Instantly share code, notes, and snippets.

@jennings
Last active December 31, 2015 04:39
Show Gist options
  • Save jennings/7935231 to your computer and use it in GitHub Desktop.
Save jennings/7935231 to your computer and use it in GitHub Desktop.
Makes the repository selectors in Bitbucket wider so long repository names don't get cut off. Works in Chrome or (hopefully) Firefox with Greasemonkey.
// ==UserScript==
// @name Atlassian Repository Width Tweaks
// @description Increases the width of various repository fields in Atlassian's hosted services
// @namespace https://github.com/jennings
// @match https://bitbucket.org/*
// @updateURL https://gist.github.com/jennings/7935231/raw/atlassian.user.js
// @version 0.2
// ==/UserScript==
var main = function () {
var $r = $('#relevant-repos');
if ($r.length > 0) {
var $c = $('#content');
// Increase main content size
$c.width($c.width() + 100);
// Increase repository browser
$r.width($r.width() + 100);
}
var $repoSelectors = $('form.aui .aui-select2-container');
$repoSelectors.width($repoSelectors.width() + 100);
}
// We do this to get access to jQuery and the
// rest of the page's context.
// See: http://stackoverflow.com/a/8890387/19818
var script = document.createElement('script');
script.type = 'text/javascript';
script.textContent = '(' + main.toString() + ')();';
document.body.appendChild(script);

Chrome installation

  1. Click here
  2. Click OK on the warning, the file will be downloaded.
  3. Open chrome://extensions and drag the downloaded file onto the extensions page.

Firefox installation

  1. Install Greasemonkey
  2. Click here and install the script.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment