Merge remote-tracking branch 'origin/master'

This commit is contained in:
Pootle server 2011-12-02 06:40:12 +01:00
commit d76f1884aa

View File

@ -41,11 +41,18 @@ function PMA_adjustTotals() {
var rowsSum = 0;
var sizeSum = 0;
var overheadSum = 0;
var rowSumApproximated = false;
$allTr.each(function () {
var $this = $(this);
// Get the number of rows for this SQL table
var strRows = $this.find('.tbl_rows').text();
// If the value is approximated
if (strRows.indexOf('~') == 0) {
rowSumApproximated = true;
// The approximated value contains a preceding ~ and a following 2 (Eg 100 --> ~1002)
strRows = strRows.substring(1, strRows.length - 1);
}
strRows = strRows.replace(/[,.]/g , '');
var intRow = parseInt(strRows, 10);
if (! isNaN(intRow)) {
@ -84,6 +91,10 @@ function PMA_adjustTotals() {
while (regex.test(strRowSum)) {
strRowSum = strRowSum.replace(regex, '$1' + ',' + '$2');
}
// If approximated total value add ~ in front
if (rowSumApproximated) {
strRowSum = "~" + strRowSum;
}
// Calculate the magnitude for the size and overhead values
var size_magnitude = 0, overhead_magnitude = 0;
while (sizeSum >= 1024) {