Permalink
Browse files

Improved the code according to the comments

  • Loading branch information...
1 parent 96c04ac commit 5de9aa912148e52c49f4460e5bb6f06203ef09d6 bharath committed Aug 21, 2012
@@ -500,9 +500,10 @@ CookiePanel.prototype = Obj.extend(Firebug.ActivablePanel,
}
}
- delete this.infoTipURL;
+ delete this.infoTipCookieId;
return false;
},
+
populateSizeInfoTip: function(infoTip, cookie)
{
CookieReps.SizeInfoTip.render(cookie, infoTip);
@@ -932,7 +932,7 @@ CookieReps.CookieCleared = domplate(CookieReps.Rep,
CookieReps.SizeInfoTip = domplate(Firebug.Rep,
{
tag:
- TABLE({"class": "sizeInfoTip", "id": "fbNetSizeInfoTip", role:"presentation"},
+ TABLE({"class": "sizeInfoTip", "id": "cookiesSizeInfoTip", role:"presentation"},
TBODY(
FOR("size", "$sizeInfo",
TAG("$size|getRowTag", {size: "$size"})
@@ -942,18 +942,9 @@ CookieReps.SizeInfoTip = domplate(Firebug.Rep,
sizeTag:
TR({"class": "sizeInfoRow", $collapsed: "$size|hideRow"},
- TD({"class": "sizeInfoLabelCol"}, "$size.label"+" :"),
- TD({"class": "sizeInfoSizeCol"}, "$size|formatNumber")
- ),
-
- separatorTag:
- TR(
- TD({"colspan": 3, "height": "7px"})
- ),
-
- descTag:
- TR(
- TD({"colspan": 3, "class": "sizeInfoDescCol"}, "$size.label")
+ TD({"class": "sizeInfoLabelCol"}, "$size.label"),
+ TD({"class": "sizeInfoSizeCol"}, "$size|formatSize"),
+ TD({"class": "sizeInfoDetailCol"}, "$size|formatNumber")
),
getRowTag: function(size)
@@ -971,22 +962,20 @@ CookieReps.SizeInfoTip = domplate(Firebug.Rep,
formatSize: function(size)
{
- return Str.formatSize(size.size);
+ size = Str.formatSize(size.size);
+ return size;
},
formatNumber: function(size)
{
- return size.size ? (Str.formatNumber(size.size)) : "";
+ return size.size && size.size >= 1024 ? "(" + Str.formatNumber(size.size) + " B)" : "";
},
render: function(cookie, parentNode)
{
var size = cookie.cookie.name.length + cookie.cookie.value.length;
- size = Str.formatSize(size);
var sizeInfo = [];
- sizeInfo.push({label: Locale.$STR("cookie.sizeinfo.Cookie_Size"), size: size});
- //sizeInfo.push({label: Locale.$STR("net.sizeinfo.Post Body"), size: postText.length});
-
+ sizeInfo.push({label: Locale.$STR("cookie.sizeinfo.Size"), size: size});
this.tag.replace({sizeInfo: sizeInfo}, parentNode);
},
});
@@ -316,3 +316,5 @@ cookies.console.Filter_By_Cookies=Filter By Cookies
# LOCALIZATION NOTE (firebug.shortcut.removeAllCookies.label) Label used by the
# Customize Shortcuts dialog (Firebug menu)
firebug.shortcut.removeAllCookies.label=Remove All Cookies
+
+cookie.sizeinfo.Size=Cookie Size

0 comments on commit 5de9aa9

Please sign in to comment.