Skip to content

Instantly share code, notes, and snippets.

@marcelovani
Last active June 26, 2018 16:51
Show Gist options
  • Save marcelovani/9a2898885afccb1ebc2e09fb4d4fc1ed to your computer and use it in GitHub Desktop.
Save marcelovani/9a2898885afccb1ebc2e09fb4d4fc1ed to your computer and use it in GitHub Desktop.
Tampermonkey tweaks for Jira
// ==UserScript==
// @name Jira
// @namespace work
// @version 0.1
// @description Tweaks
// @author Marcelo Vani
// @match https://creativesolutions.atlassian.net/secure/RapidBoard.jspa*
// @grant none
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// ==/UserScript==
(function() {
'use strict';
// Your code here...
})();
$(document).ready(function() {
tweak();
//setInterval(tweak, 15000);
});
function tweak() {
// Paint the whole background of each ticket.
$( ".ghx-card-color-enabled" ).each(function() {
var color = $( this ).find( ".ghx-grabber" ).css('backgroundColor');
$( this ).css('background-color', easyColor(color));
});
// Paint blocked cards in red.
$("[data-column-id=239]").find(".ghx-card-color-enabled").css('background-color', 'rgba(210, 0, 0, 0.68)');
columnsHeight();
}
// Make colors smoothier //
function easyColor(color) {
switch (color) {
// Blue.
case '#3355ff':
case 'rgb(51, 85, 255)':
color = 'rgba(37, 120, 247, 0.62)';
break;
// Red.
case 'rgb(255, 0, 0)':
case '#ff0000':
color = 'rgba(210, 0, 0, 0.68)';
break;
// No change.
case 'rgb(238, 242, 29)':
break;
// Log color.
default:
console.log(color);
}
return color;
}
// Limit the height of columns //
function columnsHeight() {
$( ".ghx-swimlane" ).each(function() {
//var height = $( this ).attr('height');
//console.log(height);
// $( this ).css('background-color', easyColor(color));
$( this ).css('max-height', '600px');
$( this ).css('overflow', 'hidden');
$( this ).append('<span>Expand</span>');
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment