Bug 252043 - MetaData Properties window doesn't respect locale for file size and image dimensions; (Sv1.1) SeaMonkey part; r=db48x sr=neil

This commit is contained in:
Behnam Esfahbod 2009-07-20 17:04:54 +02:00
Родитель 91dc3d5cd3
Коммит fd09e00a68
2 изменённых файлов: 19 добавлений и 9 удалений

Просмотреть файл

@ -196,13 +196,15 @@ function checkForImage(elem, htmllocalname)
if (size != -1) {
var kbSize = size / 1024;
kbSize = Math.round(kbSize*100)/100;
setInfo("image-filesize", gMetadataBundle.getFormattedString("imageSize", [kbSize, size]));
setInfo("image-filesize", gMetadataBundle.getFormattedString("imageSize",
[formatNumber(kbSize),
formatNumber(size)]));
} else {
setInfo("image-filesize", gMetadataBundle.getString("imageSizeUnknown"));
}
if ("width" in img && img.width != "") {
setInfo("image-width", gMetadataBundle.getFormattedString("imageWidth", [ img.width ]));
setInfo("image-height", gMetadataBundle.getFormattedString("imageHeight", [ img.height ]));
setInfo("image-width", gMetadataBundle.getFormattedString("imageWidth", [formatNumber(img.width)]));
setInfo("image-height", gMetadataBundle.getFormattedString("imageHeight", [formatNumber(img.height)]));
}
else {
setInfo("image-width", "");
@ -546,3 +548,8 @@ function setAlt(elem) {
}
}
function formatNumber(number)
{
return (+number).toLocaleString(); // coerce number to a numeric value before calling toLocaleString()
}

Просмотреть файл

@ -497,8 +497,10 @@ function makeGeneralTab()
var sizeText;
if (cacheEntryDescriptor) {
var pageSize = cacheEntryDescriptor.dataSize;
var kbSize = formatNumber(Math.round(pageSize / 1024 * 100) / 100);
sizeText = gBundle.getFormattedString("generalSize", [kbSize, formatNumber(pageSize)]);
var kbSize = Math.round(pageSize / 1024 * 100) / 100;
sizeText = gBundle.getFormattedString("generalSize",
[formatNumber(kbSize),
formatNumber(pageSize)]);
}
setItemValue("sizetext", sizeText);
@ -587,8 +589,8 @@ function addImage(url, type, alt, elem, isBg)
var sizeText;
if (cacheEntryDescriptor) {
var pageSize = cacheEntryDescriptor.dataSize;
var kbSize = formatNumber(Math.round(pageSize / 1024 * 100) / 100);
sizeText = gBundle.getFormattedString("mediaFileSize", [kbSize]);
var kbSize = Math.round(pageSize / 1024 * 100) / 100;
sizeText = gBundle.getFormattedString("mediaFileSize", [formatNumber(kbSize)]);
}
else
sizeText = gStrings.unknown;
@ -1019,7 +1021,8 @@ function makePreview(row)
var pageSize = cacheEntryDescriptor.dataSize;
var kbSize = Math.round(pageSize / 1024 * 100) / 100;
sizeText = gBundle.getFormattedString("generalSize",
[formatNumber(kbSize), formatNumber(pageSize)]);
[formatNumber(kbSize),
formatNumber(pageSize)]);
}
setItemValue("imagesizetext", sizeText);
@ -1125,7 +1128,7 @@ function makePreview(row)
if (url)
imageSize = gBundle.getFormattedString("mediaSize",
[formatNumber(width),
formatNumber(height)]);
formatNumber(height)]);
setItemValue("imageSize", imageSize);
var physSize = "";