Răsfoiți Sursa

Dynamic favicon large numbers 2

https://github.com/marienfressinaud/FreshRSS/issues/539
Alexandre Alapetite 11 ani în urmă
părinte
comite
c685998768
1 a modificat fișierele cu 4 adăugiri și 6 ștergeri
  1. 4 6
      p/scripts/main.js

+ 4 - 6
p/scripts/main.js

@@ -1082,14 +1082,12 @@ function faviconNbUnread(n) {
 			ctx.drawImage(this, 0, 0);
 			ctx.drawImage(this, 0, 0);
 			if (n > 0) {
 			if (n > 0) {
 				var text = '';
 				var text = '';
-				if (n < 100) {
+				if (n < 1000) {
 					text = n;
 					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 {
 				} else {
-					text = '10k+';
+					text = 'E' + Math.min(99, Math.floor(Math.log10(n)));
 				}
 				}
 				ctx.font = 'bold 9px "Arial", sans-serif';
 				ctx.font = 'bold 9px "Arial", sans-serif';
 				ctx.fillStyle = 'rgba(255, 255, 255, 127)';
 				ctx.fillStyle = 'rgba(255, 255, 255, 127)';