Trello Card Number

Show trello card number

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name        Trello Card Number
// @namespace   http://allencch.wordpress.com
// @description Show trello card number
// @include     https://trello.com/b/*
// @version     1.1
// @grant       none
// ==/UserScript==

/**
 * Changelog:
 * Just override the card-short-id class
 */

function removeClass(elem, className) {
  elem.className = elem.className.replace(new RegExp('\\b' + className + '\\b', 'g'), '');
}

function addClass(elem, className) {
  elem.className += ' ' + className;
}

function showCardNumbers() {
  //Get all the elements
  var elems = Array.from(document.querySelectorAll('.card-short-id'));
  for(var i in elems) {
    addClass(elems[i], 'card-short-id');
  }
}

function createCSS() {
  var style = document.createElement('style');
  style.type = 'text/css';
  style.innerHTML = '.card-short-id { font-weight: bold ; display: inline }';
  var style2 = document.createElement('style');
  style2.type = 'text/css';
  style2.innerHTML = '.card-short-id:after { content: " " }';
  
  document.getElementsByTagName('head')[0].appendChild(style);
  document.getElementsByTagName('head')[0].appendChild(style2);
}

window.setTimeout(function() {
  createCSS();
  //showCardNumbers();
},1000);