Skip to content

Instantly share code, notes, and snippets.

@daveallie
Last active November 24, 2017 01:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daveallie/a099c116793fe7bdadc6e852e1df5f68 to your computer and use it in GitHub Desktop.
Save daveallie/a099c116793fe7bdadc6e852e1df5f68 to your computer and use it in GitHub Desktop.
Codeship Improvements
strong.build-details-primary::first-letter {
color: #f00;
}
.build-details-time, .build-details-time + span, time.build-details-secondary {
float: right;
}
.build-img {
width: 60px;
height: 60px;
filter: none;
}
.build-img-overlay {
display: none;
}
.status-icon {
display: none;
}
.build-link.box {
padding: 10px 10px 10px 75px;
height: 60px;
}
.build-item {
margin: 5px 0;
}
.hero {
height: 0;
}
.hero-container {
display: none;
}
// ==UserScript==
// @name Codeship split repo/branch
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @include https://app.codeship.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
function splitRepoBranch() {
$(".build-item").each(function() {
var $parent = $(this);
if ($parent.find('.build-details-commit-id').length > 1) return;
var $repo_branch = $parent.find(".build-details-primary:eq(1)");
var $commitId = $parent.find(".build-details-commit-id");
var parts = $repo_branch.text().split('/');
var repo = parts[0];
var branch = parts.slice(1).join('/');
var $firstSpan = $parent.find('span:first');
var githubLink = $parent.find('a.build-cta-link:contains(View on GitHub)').attr('href');
$commitId.next().remove();
$parent.find('.build-details').append($commitId.nextAll().get().reverse());
$repo_branch.remove();
$('<strong>').addClass('build-details-primary build-details-commit-id').text(repo).insertAfter($firstSpan);
$('<span>').text('•').insertAfter($firstSpan);
$('<strong>').addClass('build-details-primary').text(branch).insertAfter($firstSpan);
$commitId.replaceWith($('<a>').text($commitId.text()).addClass('build-details-primary build-details-commit-id').attr('href', githubLink).attr('target', '_blank'));
});
}
$(document).ready(function() {
window.MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
var observer = new MutationObserver(splitRepoBranch);
observer.observe($('.build-list')[0], { attributes: true, childList: true, characterData: true });
splitRepoBranch();
});
})();
.header-icon-logo {
display: none;
}
.header-logo-link {
background-image: url(http://i.imgur.com/3GYRFzY.png);
background-size: cover;
border-radius: 50%;
background-color: wheat;
}
.header-logo-link:hover {
color: inherit;
background-color: #69493d;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment