From d6f5fcbd4700558848125a17c49565b93dffb100 Mon Sep 17 00:00:00 2001 From: "timeless%mozdev.org" Date: Tue, 19 Jul 2005 21:55:38 +0000 Subject: [PATCH] Bug 201264 Media tab should have a column named "count" for objects used more than once, instead of repeating them patch by f.qu@laposte.net r=db48x sr=neil a=asa --- browser/base/content/pageInfo.js | 14 ++++++-------- xpfe/browser/resources/content/pageInfo.js | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/browser/base/content/pageInfo.js b/browser/base/content/pageInfo.js index 798bd4aea6bb..1c79c0f6f670 100644 --- a/browser/base/content/pageInfo.js +++ b/browser/base/content/pageInfo.js @@ -507,15 +507,13 @@ function addImage(url, type, alt, elem, isBg) { if (url == "") return; - //|imageHash[url][type][alt] === undefined| avoids matching row index 0. - if (!imageHash[url] || !imageHash[url][type] || imageHash[url][type][alt] === undefined) { + if (!(url in imageHash)) + imageHash[url] = {}; + if (!(type in imageHash[url])) + imageHash[url][type] = {}; + if (!(alt in imageHash[url][type])) { + imageHash[url][type][alt] = imageView.data.length; imageView.addRow([url, type, alt, 1, elem, isBg]); - // I wish I could do imageHash[url][type][alt] = imageView.data.length without getting errors. - if (!imageHash[url]) - imageHash[url] = {}; - if (!imageHash[url][type]) - imageHash[url][type] = {}; - imageHash[url][type][alt] = imageView.data.length - 1; } else { var i = imageHash[url][type][alt]; imageView.data[i][3]++; diff --git a/xpfe/browser/resources/content/pageInfo.js b/xpfe/browser/resources/content/pageInfo.js index 2a7a7c5a30ed..a2fc16f4fc2a 100644 --- a/xpfe/browser/resources/content/pageInfo.js +++ b/xpfe/browser/resources/content/pageInfo.js @@ -505,15 +505,13 @@ function addImage(url, type, alt, elem, isBg) { if (url == "") return; - //|imageHash[url][type][alt] === undefined| avoids matching row index 0. - if (!imageHash[url] || !imageHash[url][type] || imageHash[url][type][alt] === undefined) { + if (!(url in imageHash)) + imageHash[url] = {}; + if (!(type in imageHash[url])) + imageHash[url][type] = {}; + if (!(alt in imageHash[url][type])) { + imageHash[url][type][alt] = imageView.data.length; imageView.addRow([url, type, alt, 1, elem, isBg]); - // I wish I could do imageHash[url][type][alt] = imageView.data.length without getting errors. - if (!imageHash[url]) - imageHash[url] = {}; - if (!imageHash[url][type]) - imageHash[url][type] = {}; - imageHash[url][type][alt] = imageView.data.length - 1; } else { var i = imageHash[url][type][alt]; imageView.data[i][3]++;