Last active
April 26, 2017 03:33
-
-
Save nuklea/80ca0ed922133a8ee3588753b739299f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Redminy story counter | |
// @version 0.2.2 | |
// @description try to take over the world! | |
// @author Vladislav Polukhin <[email protected]> | |
// @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 + ')'); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Для установки нажмите на ссылку кнопку
Raw
.