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
This commit is contained in:
parent
d9bf832099
commit
47edca2832
@ -18,8 +18,12 @@
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s): smorrison@gte.com
|
||||
* Terry Hayes <thayes@netscape.com>
|
||||
*/
|
||||
|
||||
/* 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)
|
||||
|
||||
@ -56,8 +56,18 @@
|
||||
<!-- keys are appended from the overlay -->
|
||||
<keyset id="keyset"/>
|
||||
|
||||
<box id="cont" orient="vertical" flex="1">
|
||||
<box id="cont" orient="vertical" flex="1">
|
||||
<text class="header label" value="&pageInfo.description;"/>
|
||||
<tabcontrol id="tabcontrol" flex="1">
|
||||
<tabbox id="tabbox">
|
||||
<tab id="generalTab" value="&pageInfo.generalTab;"/>
|
||||
<tab id="formsTab" value="&pageInfo.formsTab;" hidden="true" />
|
||||
<tab id="imagesTab" value="&pageInfo.imagesTab;" hidden="true" />
|
||||
<!-- Others added by overlay -->
|
||||
</tabbox>
|
||||
<tabpanel id="tabpanel" flex="1">
|
||||
|
||||
<!-- General page information -->
|
||||
<box orient="vertical">
|
||||
<text class="header label" value="&pageInfo.description;"/>
|
||||
<box class="inset" orient="vertical" id="documentinfo">
|
||||
@ -84,6 +94,7 @@
|
||||
</box>
|
||||
</box>
|
||||
|
||||
<!-- Form information -->
|
||||
<box id="formTreeContainer" flex="1" orient="vertical" collapsed="true">
|
||||
<text class="header label" value="&pageInfo.formHeader;"/>
|
||||
<tree id="formTree" class="inset" flex="1">
|
||||
@ -104,9 +115,8 @@
|
||||
<treechildren id="formChildren" flex="1"/>
|
||||
</tree>
|
||||
</box>
|
||||
|
||||
<splitter id="formImageSplitter" hidden="true"/>
|
||||
|
||||
|
||||
<!-- Image information -->
|
||||
<box id="imageTreeContainer" flex="1" orient="vertical" collapsed="true">
|
||||
<text class="header label" value="&pageInfo.imageHeader;"/>
|
||||
<tree id="imageTree" class="inset" onselect="onImageSelect()" flex="1">
|
||||
@ -136,5 +146,9 @@
|
||||
<iframe id="imageFrame" class="inset" src="about:blank" flex="1"/>
|
||||
</box>
|
||||
</box>
|
||||
|
||||
<!-- Others added by overlay -->
|
||||
</tabpanel>
|
||||
</tabcontrol>
|
||||
</box>
|
||||
</window>
|
||||
|
||||
@ -9,15 +9,18 @@
|
||||
<!ENTITY pageInfo.title "Page Info">
|
||||
<!ENTITY pageInfo.description "Information about the current page">
|
||||
|
||||
<!ENTITY pageInfo.generalTab "General">
|
||||
<!ENTITY pageInfo.pageTitle "Title:">
|
||||
<!ENTITY pageInfo.URL "URL:">
|
||||
<!ENTITY pageInfo.lastModified "Last Modified:">
|
||||
|
||||
<!ENTITY pageInfo.formsTab "Forms">
|
||||
<!ENTITY pageInfo.formHeader "Forms on this page">
|
||||
<!ENTITY pageInfo.formAction "Form Action">
|
||||
<!ENTITY pageInfo.formMethod "Method">
|
||||
<!ENTITY pageInfo.formName "Name">
|
||||
|
||||
<!ENTITY pageInfo.imagesTab "Images">
|
||||
<!ENTITY pageInfo.imageHeader "Images on this page">
|
||||
<!ENTITY pageInfo.imageURL "Image URL">
|
||||
<!ENTITY pageInfo.imageWidth "Width">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user