From 47edca2832d5ffb935bb24636ccc3fdf82f7fff0 Mon Sep 17 00:00:00 2001 From: "thayes%netscape.com" Date: Thu, 14 Sep 2006 05:52:03 +0000 Subject: [PATCH] Implement tab-based framework for pageInfo. + tabs + extension by overlay + open to specific tab git-svn-id: svn://10.0.0.236/trunk@210427 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/suite/browser/pageInfo.js | 30 +++++++++++++++++-- mozilla/suite/browser/pageInfo.xul | 22 +++++++++++--- .../locales/en-US/chrome/browser/pageInfo.dtd | 3 ++ 3 files changed, 49 insertions(+), 6 deletions(-) diff --git a/mozilla/suite/browser/pageInfo.js b/mozilla/suite/browser/pageInfo.js index 700c8db8276..26619693801 100644 --- a/mozilla/suite/browser/pageInfo.js +++ b/mozilla/suite/browser/pageInfo.js @@ -18,8 +18,12 @@ * Rights Reserved. * * Contributor(s): smorrison@gte.com + * Terry Hayes */ +/* Overlays register init functions here */ +var onLoadRegistry = [ ]; + function onLoadPageInfo() { var page = window.opener.frames[0].document; @@ -32,6 +36,9 @@ function onLoadPageInfo() var hasForm = makeFormTree(page, formTreeHolder); if (hasForm) { + var formsTab = document.getElementById("formsTab"); + + formsTab.removeAttribute("hidden"); formTreeHolder.removeAttribute("collapsed"); } @@ -39,14 +46,33 @@ function onLoadPageInfo() var hasImages = makeImageTree(page, imageTreeHolder); if (hasImages) { + var imagesTab = document.getElementById("imagesTab"); + + imagesTab.removeAttribute("hidden"); imageTreeHolder.removeAttribute("collapsed"); } - if (hasForm && hasImages) + /* Call registered overlay init functions */ + for (x in onLoadRegistry) { - document.getElementById("formImageSplitter").removeAttribute("hidden"); + onLoadRegistry[x](); } + /* Selected the requested tab, if the name is specified */ + /* if (window.arguments != null) { */ + if ("arguments" in window) { + var tabName = window.arguments[0]; + + if (tabName) + { + var tabControl = document.getElementById("tabcontrol"); + var tab = document.getElementById(tabName); + + if (tabControl && tab) { + tabControl.selectedTab = tab; + } + } + } } function makeDocument(page, root) diff --git a/mozilla/suite/browser/pageInfo.xul b/mozilla/suite/browser/pageInfo.xul index 0fa898c7d72..4da4bf89db0 100644 --- a/mozilla/suite/browser/pageInfo.xul +++ b/mozilla/suite/browser/pageInfo.xul @@ -56,8 +56,18 @@ - + + + + + + + + @@ -84,6 +94,7 @@ + @@ -104,9 +115,8 @@ - -