Skip to content

Instantly share code, notes, and snippets.

@nuklea
Last active Apr 26, 2017
Embed
What would you like to do?
// ==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

This comment has been minimized.

Copy link
Owner Author

@nuklea nuklea commented Mar 13, 2017

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

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