Skip to content

Instantly share code, notes, and snippets.

@nuklea
Last active April 26, 2017 03:33
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 nuklea/80ca0ed922133a8ee3588753b739299f to your computer and use it in GitHub Desktop.
Save nuklea/80ca0ed922133a8ee3588753b739299f to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Redminy story counter
// @version 0.2.2
// @description try to take over the world!
// @author Vladislav Polukhin <nuklea@gmail.com>
// @match http://redmine.24auto.ru/*
// @grant none
// ==/UserScript==
function mceil(number, roundto){
return roundto * Math.ceil(number/roundto);
}
(function() {
'use strict';
var c = 0,
zeroes = 0,
sum;
$(".issues td.cf_1").each(function(i, el) {
var raw_value = $(el).text(),
value = parseFloat(raw_value.replace(',', '.')) || 0;
c += value;
if (raw_value === '0') {
++zeroes;
}
});
sum = mceil(c + zeroes / 4 * 0.5, 0.5);
$(".issues th[title*=Оценка] a").text('Оценка (' + sum + ')');
})();
@nuklea
Copy link
Author

nuklea commented Mar 13, 2017

Для установки нажмите на ссылку кнопку Raw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment