aboutsummaryrefslogtreecommitdiff
path: root/p/scripts
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-08-02 11:43:43 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-08-02 11:43:43 +0200
commitc685998768aae2177fabdba78f96bf5e790cf841 (patch)
tree6fc5cf6eaefe57ed09b28822b4a86d58eadb67a7 /p/scripts
parent0246d2340b2db208de3fad48e7d45608351e3ab5 (diff)
Dynamic favicon large numbers 2
https://github.com/marienfressinaud/FreshRSS/issues/539
Diffstat (limited to 'p/scripts')
-rw-r--r--p/scripts/main.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/p/scripts/main.js b/p/scripts/main.js
index d18a02668..5677e5bbc 100644
--- a/p/scripts/main.js
+++ b/p/scripts/main.js
@@ -1082,14 +1082,12 @@ function faviconNbUnread(n) {
ctx.drawImage(this, 0, 0);
if (n > 0) {
var text = '';
- if (n < 100) {
+ if (n < 1000) {
text = n;
- } else if (n < 1000) {
- text = Math.floor(n / 100) + 'h+';
- } else if (n < 10000) {
- text = Math.floor(n / 1000) + 'k+';
+ } else if (n < 100000) {
+ text = Math.floor(n / 1000) + 'k';
} else {
- text = '10k+';
+ text = 'E' + Math.min(99, Math.floor(Math.log10(n)));
}
ctx.font = 'bold 9px "Arial", sans-serif';
ctx.fillStyle = 'rgba(255, 255, 255, 127)';