// ==UserScript==
// @name Trello Category
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://trello.com/*
// @grant none
// @downloadURL https://update.greasyfork.icu/scripts/22154/Trello%20Category.user.js
// @updateURL https://update.greasyfork.icu/scripts/22154/Trello%20Category.meta.js
// ==/UserScript==
function render(){
var color_match =
{
Everyone: '#e67e22',
Product: '#95a5a6',
Marketing: '#2980b9',
Hardware: '#1abc9c',
CXO: '#e74c3c',
Operation: '#95a5a6',
Software: '#f1c40f'
};
$('span.board-tile-details-name').each(function(){
var title = $(this).text();
var re = /\[ (.+) \] (.+)/;
var match = title.match(re);
if(match){
$(this).text(match[2]);
$('
'+match[1]+'').insertAfter($(this));
var tile = $(this).parent().parent();
tile.css({'border-left': '20px solid '+color_match[match[1]]});
}
});
}
$(window).load(function(){
render();
$('body').append(``);
});
setInterval(render, 1000);