зеркало из https://github.com/mozilla/gecko-dev.git
Page info panes should have adjustable and have scrollbars (by db48x@yahoo.com, 63913). r=timeless sr=alecf
This commit is contained in:
Родитель
08646b2ca2
Коммит
fd0cba1673
|
@ -28,63 +28,64 @@ function onLoadPageInfo()
|
|||
|
||||
makeDocument(page, root);
|
||||
|
||||
var formTreeHolder = document.getElementById("formtreecontainer");
|
||||
var formTreeHolder = document.getElementById("formTreeContainer");
|
||||
var hasForm = makeFormTree(page, formTreeHolder);
|
||||
if (hasForm)
|
||||
{
|
||||
var formBox = document.getElementById("formtreecontainer");
|
||||
formBox.removeAttribute("collapsed");
|
||||
formTreeHolder.removeAttribute("collapsed");
|
||||
}
|
||||
|
||||
var imageTreeHolder = document.getElementById("imagetreecontainer");
|
||||
var hasimages = makeImageTree(page, imageTreeHolder);
|
||||
if (hasimages)
|
||||
var imageTreeHolder = document.getElementById("imageTreeContainer");
|
||||
var hasImages = makeImageTree(page, imageTreeHolder);
|
||||
if (hasImages)
|
||||
{
|
||||
var imageBox = document.getElementById("image_items");
|
||||
imageBox.removeAttribute("collapsed");
|
||||
imageTreeHolder.removeAttribute("collapsed");
|
||||
}
|
||||
|
||||
if (hasForm && hasImages)
|
||||
{
|
||||
document.getElementById("formImageSplitter").removeAttribute("hidden");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function makeDocument(page, root)
|
||||
{
|
||||
var title = page.title;
|
||||
var url = page.URL;
|
||||
var lastmodified;
|
||||
var lastmod = page.lastModified // get string of last modified date
|
||||
var lastmoddate = Date.parse(lastmod) // convert modified string to date
|
||||
if(lastmoddate == 0){ // unknown date (or January 1, 1970 GMT)
|
||||
lastmodified = "Unknown";
|
||||
} else {
|
||||
lastmodified = lastmod;
|
||||
}
|
||||
var lastModified;
|
||||
var lastMod = page.lastModified // get string of last modified date
|
||||
var lastModdate = Date.parse(lastMod) // convert modified string to date
|
||||
|
||||
lastModified = (lastModdate) ? lastMod : "Unknown"; // unknown date (or January 1, 1970 GMT)
|
||||
|
||||
document.getElementById("titletext").setAttribute("value", title);
|
||||
document.getElementById("urltext").setAttribute("value", url);
|
||||
document.getElementById("lastmodifiedtext").setAttribute("value", lastmodified);
|
||||
document.getElementById("lastmodifiedtext").setAttribute("value", lastModified);
|
||||
}
|
||||
|
||||
function makeFormTree(page, root)
|
||||
{
|
||||
var form_list = page.forms;
|
||||
if (form_list.length == 0) return false;
|
||||
var formList = page.forms;
|
||||
if (formList.length == 0) return false;
|
||||
|
||||
var treechildren = document.getElementById("formchildren");
|
||||
var treeChildren = document.getElementById("formChildren");
|
||||
|
||||
for (var i = 0; i < form_list.length; i++)
|
||||
for (var i = 0; i < formList.length; i++)
|
||||
{
|
||||
var treeitem = document.createElement("treeitem");
|
||||
var treerow_elem = treeitem.appendChild(document.createElement("treerow"));
|
||||
var treeItem = document.createElement("treeitem");
|
||||
var treeRowElem = treeItem.appendChild(document.createElement("treerow"));
|
||||
|
||||
var treecell_elem = treerow_elem.appendChild(document.createElement("treecell"));
|
||||
treecell_elem.setAttribute("value", form_list[i].action);
|
||||
var treeCellElem = treeRowElem.appendChild(document.createElement("treecell"));
|
||||
treeCellElem.setAttribute("value", formList[i].action);
|
||||
|
||||
treecell_elem = treerow_elem.appendChild(document.createElement("treecell"));
|
||||
treecell_elem.setAttribute("value", form_list[i].method);
|
||||
treeCellElem = treeRowElem.appendChild(document.createElement("treecell"));
|
||||
treeCellElem.setAttribute("value", formList[i].method);
|
||||
|
||||
treecell_elem = treerow_elem.appendChild(document.createElement("treecell"));
|
||||
treecell_elem.setAttribute("value", form_list[i].name);
|
||||
treeCellElem = treeRowElem.appendChild(document.createElement("treecell"));
|
||||
treeCellElem.setAttribute("value", formList[i].name);
|
||||
|
||||
treechildren.appendChild(treeitem);
|
||||
treeChildren.appendChild(treeItem);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -92,32 +93,32 @@ function makeFormTree(page, root)
|
|||
|
||||
function makeImageTree(page, root)
|
||||
{
|
||||
var img_list = page.images;
|
||||
if (img_list.length == 0) return false;
|
||||
var imgList = page.images;
|
||||
if (imgList.length == 0) return false;
|
||||
|
||||
var treechildren = document.getElementById("imageschildren");
|
||||
var treeChildren = document.getElementById("imagesChildren");
|
||||
|
||||
for (var i = 0; i < img_list.length; i++)
|
||||
for (var i = 0; i < imgList.length; i++)
|
||||
{
|
||||
var treeitem = document.createElement("treeitem");
|
||||
treeitem.setAttribute("container", "true");
|
||||
treeitem.setAttribute("parent", "true");
|
||||
var treeItem = document.createElement("treeitem");
|
||||
treeItem.setAttribute("container", "true");
|
||||
treeItem.setAttribute("parent", "true");
|
||||
|
||||
var treerow_elem = treeitem.appendChild(document.createElement("treerow"));
|
||||
var treeRowElem = treeItem.appendChild(document.createElement("treerow"));
|
||||
|
||||
var treecell_elem = treerow_elem.appendChild(document.createElement("treecell"));
|
||||
treecell_elem.setAttribute("value", img_list[i].src);
|
||||
var treeCellElem = treeRowElem.appendChild(document.createElement("treecell"));
|
||||
treeCellElem.setAttribute("value", imgList[i].src);
|
||||
|
||||
treecell_elem = treerow_elem.appendChild(document.createElement("treecell"));
|
||||
treecell_elem.setAttribute("value", img_list[i].width);
|
||||
treeCellElem = treeRowElem.appendChild(document.createElement("treecell"));
|
||||
treeCellElem.setAttribute("value", imgList[i].width);
|
||||
|
||||
treecell_elem = treerow_elem.appendChild(document.createElement("treecell"));
|
||||
treecell_elem.setAttribute("value", img_list[i].height);
|
||||
treeCellElem = treeRowElem.appendChild(document.createElement("treecell"));
|
||||
treeCellElem.setAttribute("value", imgList[i].height);
|
||||
|
||||
treecell_elem = treerow_elem.appendChild(document.createElement("treecell"));
|
||||
treecell_elem.setAttribute("value", img_list[i].alt);
|
||||
treeCellElem = treeRowElem.appendChild(document.createElement("treecell"));
|
||||
treeCellElem.setAttribute("value", imgList[i].alt);
|
||||
|
||||
treechildren.appendChild(treeitem);
|
||||
treeChildren.appendChild(treeItem);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -125,8 +126,8 @@ function makeImageTree(page, root)
|
|||
|
||||
function onImageSelect()
|
||||
{
|
||||
var tree = document.getElementById("images_tree");
|
||||
var imageFrame = document.getElementById("image_frame");
|
||||
var tree = document.getElementById("imageTree");
|
||||
var imageFrame = document.getElementById("imageFrame");
|
||||
|
||||
if (tree.selectedItems.length == 1)
|
||||
{
|
||||
|
@ -137,8 +138,8 @@ function onImageSelect()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
function BrowserClose()
|
||||
{
|
||||
window.close();
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
-->
|
||||
|
||||
<?xml-stylesheet href="chrome://navigator/skin/" type="text/css"?>
|
||||
|
||||
<?xul-overlay href="chrome://navigator/content/navigatorOverlay.xul"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://navigator/locale/pageInfo.dtd">
|
||||
|
@ -39,11 +38,11 @@
|
|||
windowtype="Browser:page-info"
|
||||
onload="onLoadPageInfo()"
|
||||
align="vertical" class="dialog"
|
||||
width="400" height="320"
|
||||
width="400" height="450"
|
||||
screenX="10" screenY="10"
|
||||
persist="screenX screenY width height sizemode">
|
||||
|
||||
<script src="chrome://navigator/content/pageInfo.js"></script>
|
||||
<script type="text/javascript" src="chrome://navigator/content/pageInfo.js"/>
|
||||
|
||||
<broadcasterset id="broadcasterset"/>
|
||||
|
||||
|
@ -59,32 +58,35 @@
|
|||
|
||||
<box id="cont" orient="vertical" flex="1">
|
||||
|
||||
<box orient="vertical">
|
||||
<text class="header label" value="&pageInfo.description;"/>
|
||||
<box class="inset" orient="vertical" id="documentinfo">
|
||||
<grid>
|
||||
<columns>
|
||||
<column/>
|
||||
<column flex="1"/>
|
||||
<column flex="3"/>
|
||||
</columns>
|
||||
|
||||
<rows>
|
||||
<row>
|
||||
<text class="label" value="&pageInfo.pageTitle;"/> <text class="label" id="titletext" value=""/>
|
||||
<text class="label" value="&pageInfo.pageTitle;"/>
|
||||
<text class="label" id="titletext" value=""/>
|
||||
</row>
|
||||
<row>
|
||||
<text class="label" value="&pageInfo.URL;"/> <text class="label" id="urltext" value=""/>
|
||||
<text class="label" value="&pageInfo.URL;"/>
|
||||
<text class="label" id="urltext" value=""/>
|
||||
</row>
|
||||
<row>
|
||||
<text class="label" value="&pageInfo.lastModified;"/> <text class="label" id="lastmodifiedtext" value=""/>
|
||||
<text class="label" value="&pageInfo.lastModified;"/>
|
||||
<text class="label" id="lastmodifiedtext" value=""/>
|
||||
</row>
|
||||
|
||||
</rows>
|
||||
</grid>
|
||||
</box>
|
||||
</box>
|
||||
|
||||
<box id="formtreecontainer" flex="1" orient="vertical" collapsed="true">
|
||||
<box id="formTreeContainer" flex="1" orient="vertical" collapsed="true">
|
||||
<text class="header label" value="&pageInfo.formHeader;"/>
|
||||
<tree id="forms_tree" class="inset" flex="1">
|
||||
<tree id="formTree" class="inset" flex="1">
|
||||
<treecolgroup>
|
||||
<treecol flex="2"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
|
@ -99,18 +101,17 @@
|
|||
<treecell value="&pageInfo.formName;" class="treecell-header treecell-inset-header"/>
|
||||
</treerow>
|
||||
</treehead>
|
||||
<treechildren id="formchildren" flex="1">
|
||||
</treechildren>
|
||||
<treechildren id="formChildren" flex="1"/>
|
||||
</tree>
|
||||
|
||||
</box>
|
||||
|
||||
<box id="image_items" orient="vertical" flex="1" collapsed="true">
|
||||
<box id="imagetreecontainer" flex="1" orient="vertical">
|
||||
<splitter id="formImageSplitter" hidden="true"/>
|
||||
|
||||
<box id="imageTreeContainer" flex="1" orient="vertical" collapsed="true">
|
||||
<text class="header label" value="&pageInfo.imageHeader;"/>
|
||||
<tree id="images_tree" class="inset" onselect="onImageSelect()" flex="1">
|
||||
<tree id="imageTree" class="inset" onselect="onImageSelect()" flex="1">
|
||||
<treecolgroup>
|
||||
<treecol flex="8"/>
|
||||
<treecol flex="7"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol flex="2"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
|
@ -126,21 +127,14 @@
|
|||
<treecell value="&pageInfo.imageAltText;" class="treecell-header treecell-inset-header"/>
|
||||
</treerow>
|
||||
</treehead>
|
||||
<treechildren id="imageschildren" flex="1">
|
||||
</treechildren>
|
||||
<treechildren id="imagesChildren" flex="1"/>
|
||||
</tree>
|
||||
</box>
|
||||
|
||||
<splitter orient="vertical" collapse="after">
|
||||
<spring flex="1"/>
|
||||
<grippy/>
|
||||
<spring flex="1"/>
|
||||
</splitter>
|
||||
<splitter collapse="after" id="imageSplitter"/>
|
||||
|
||||
<box id="imagepreviewcontainer">
|
||||
<iframe id="image_frame" class="inset" src="about:blank" flex="1"/>
|
||||
<box id="imagePreviewContainer" flex="1">
|
||||
<iframe id="imageFrame" class="inset" src="about:blank" flex="1"/>
|
||||
</box>
|
||||
</box>
|
||||
</box>
|
||||
|
||||
</window>
|
||||
|
|
Загрузка…
Ссылка в новой задаче