Porting fix for bug 181764 from the trunk.

Page Info has no more xpfe dependencies.
This commit is contained in:
chanial@noos.fr
2003-01-29 07:39:36 +00:00
parent e0ebc68631
commit 38b0ee456e
6 changed files with 75 additions and 74 deletions

View File

@@ -0,0 +1,32 @@
@import "chrome://global/skin/";
tree {
margin: .5em;
}
textbox,
textbox > .textbox-internal-box,
textbox > .textarea-internal-box {
background: transparent !important;
border: none;
padding: 0px;
-moz-appearance: none;
}
textbox.header {
margin-left: 0;
}
.iframe {
margin: .5em;
background: white;
overflow: auto;
}
#thepreviewimage {
margin: 1em;
}
.fixedsize {
height: 8.5em;
}

View File

@@ -37,6 +37,7 @@
#
# ***** END LICENSE BLOCK *****
#
//******** define a js object to implement nsITreeView
function pageInfoTreeView(columnids, copycol)
{
@@ -53,7 +54,6 @@ function pageInfoTreeView(columnids, copycol)
this.selection = null;
this.sortcol = null;
this.sortdir = 0;
this.initialized = 0; // set this to one once we fill in all the rows
}
pageInfoTreeView.prototype = {
@@ -96,6 +96,7 @@ pageInfoTreeView.prototype = {
addRow: function(row)
{
this.rows = this.data.push(row);
this.rowCountChanged(this.rows - 1, 1);
},
addRows: function(rows)
@@ -103,6 +104,7 @@ pageInfoTreeView.prototype = {
var length = rows.length;
for(var i = 0; i < length; i++)
this.rows = this.data.push(rows[i]);
this.rowCountChanged(this.rows - length, length);
},
rowCountChanged: function(index, count)
@@ -178,6 +180,8 @@ var fieldView = new pageInfoTreeView(["field-label","field-field","field-type","
var linkView = new pageInfoTreeView(["link-name","link-address","link-type"], COPYCOL_LINK_ADDRESS);
var imageView = new pageInfoTreeView(["image-address","image-type","image-alt","image-node", "image-bg"], COPYCOL_IMAGE_ADDRESS);
var intervalID = null;
// localized strings (will be filled in when the document is loaded)
// this isn't all of them, these are just the ones that would otherwise have been loaded inside a loop
var gStrings = {}
@@ -294,6 +298,9 @@ function onLoadPageInfo()
// do the easy stuff first
makeGeneralTab();
// and then the hard stuff
makeTabs(theDocument, theWindow);
/* Call registered overlay init functions */
for (x in onLoadRegistry)
{
@@ -456,11 +463,13 @@ function makeGeneralTab()
}
//******** Generic Build-a-tab
// Assumes the views are empty. Only called once to build the tabs, and
// does so by farming the task off to another thread via setTimeout().
// The actual work is done with a TreeWalker that calls doGrab() once for
// each element node in the document.
function makeTabs(aDocument, aWindow)
{
if (formView.initialized || linkView.initialized || imageView.initialized)
return;
if (aWindow && aWindow.frames.length > 0)
{
var num = aWindow.frames.length;
@@ -477,22 +486,20 @@ function makeTabs(aDocument, aWindow)
imageTree.treeBoxObject.view = imageView;
var iterator = aDocument.createTreeWalker(aDocument, NodeFilter.SHOW_ELEMENT, grabAll, true);
while (iterator.nextNode())
; // it'll never be executed anyway, since grabAll never
// accepts any nodes
formView.rowCountChanged(0, formView.rowCount);
formView.selection.select(0);
formView.initialized = 1;
setTimeout(doGrab, 1, iterator, 0);
}
linkView.rowCountChanged(0, linkView.rowCount);
linkView.selection.select(0);
linkView.initialized = 1;
function doGrab(iterator, i)
{
if (iterator.nextNode())
setTimeout(doGrab, 1, iterator, i);
}
imageView.rowCountChanged(0, imageView.rowCount);
imageView.selection.select(0);
imageView.initialized = 1;
function ensureSelection(view)
{
if (view.selection.count == 0) // only select something if nothing is currently selected
view.selection.select(0);
}
function grabAll(elem)
@@ -505,7 +512,6 @@ function grabAll(elem)
imageView.addRow([url.getStringValue(), gStrings.mediaBGImg, gStrings.notSet, elem, true]);
// one swi^H^H^Hif-else to rule them all
// XXX: these tests should use regexes to be a little more lenient wrt whitespace, see bug 177047
if (elem instanceof nsIAnchorElement)
{
linktext = getValueText(elem);
@@ -570,7 +576,7 @@ function grabAll(elem)
linkView.addRow([linktext, getAbsoluteURL(elem.href, elem), gStrings.linkX, ""]);
}
return NodeFilter.FILTER_SKIP;
return NodeFilter.FILTER_ACCEPT;
}
//******** Form Stuff
@@ -1052,3 +1058,4 @@ function doCopy(event)
if (text)
gClipboardHelper.copyString(text);
}

View File

@@ -22,14 +22,10 @@
# Chris McAfee <mcafee@netscape.com>
# Daniel Brooks <db48x@yahoo.com>
# Gervase Markham <gerv@gerv.net>
<?xml-stylesheet href="chrome://navigator/skin/pageInfo.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/pageInfo.css" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd">
%brandDTD;
<!ENTITY % navigatorDTD SYSTEM "chrome://navigator/locale/navigator.dtd">
%navigatorDTD;
<!ENTITY % pageInfoDTD SYSTEM "chrome://navigator/locale/pageInfo.dtd">
<!ENTITY % pageInfoDTD SYSTEM "chrome://browser/locale/pageInfo.dtd">
%pageInfoDTD;
]>
@@ -38,13 +34,11 @@
windowtype="Browser:page-info"
onload="onLoadPageInfo()"
align="stretch" class="dialog"
width="&pageInfoWindow.width;" height="&pageInfoWindow.height;"
screenX="10" screenY="10"
persist="screenX screenY width height sizemode">
persist="screenX screenY">
<script type="application/x-javascript" src="chrome://communicator/content/contentAreaUtils.js"/>
<script type="application/x-javascript" src="chrome://navigator/content/pageInfo.js"/>
<script type="application/x-javascript" src="chrome://help/content/contextHelp.js"/>
<script type="application/x-javascript" src="chrome://browser/content/contentAreaUtils.js"/>
<script type="application/x-javascript" src="chrome://browser/content/pageInfo.js"/>
<keyset>
<key id="closeWindow" key="&closeWindow;" modifiers="accel" oncommand="window.close();"/>
@@ -54,18 +48,18 @@
<!-- keys are appended from the overlay -->
<keyset id="dialogKeys"/>
<stringbundle id="pageinfobundle" src="chrome://navigator/locale/pageInfo.properties"/>
<stringbundle id="pageinfobundle" src="chrome://browser/locale/pageInfo.properties"/>
<tabbox id="tabbox" flex="1">
<tabs id="tabs">
<tab id="generalTab" label="&generalTab;"
accesskey="&generalAccesskey;"/>
<tab id="formsTab" label="&formsTab;"
accesskey="&formsAccesskey;" oncommand="makeTabs(theDocument, theWindow);"/>
accesskey="&formsAccesskey;" oncommand="ensureSelection(formView)"/>
<tab id="linksTab" label="&linksTab;"
accesskey="&linksAccesskey;" oncommand="makeTabs(theDocument, theWindow);"/>
accesskey="&linksAccesskey;" oncommand="ensureSelection(linkView)"/>
<tab id="mediaTab" label="&mediaTab;"
accesskey="&mediaAccesskey;" oncommand="makeTabs(theDocument, theWindow);"/>
accesskey="&mediaAccesskey;" oncommand="ensureSelection(imageView)"/>
<!-- Others added by overlay -->
</tabs>
<tabpanels id="tabpanels" flex="1">
@@ -135,7 +129,7 @@
</grid>
<separator class="thin"/>
<text id="metahead" class="header" value="&generalMeta;"/>
<tree id="metatree" flex="1" class="inset">
<tree id="metatree" flex="1">
<treecols>
<treecol persist="hidden width" flex="1" id="meta-name" label="&generalMetaName;"/>
<splitter class="tree-splitter"/>
@@ -147,7 +141,7 @@
<!-- Form information -->
<vbox>
<tree id="formtree" class="inset fixedsize" onselect="onFormSelect();">
<tree id="formtree" class="fixedsize" onselect="onFormSelect();">
<treecols>
<splitter class="tree-splitter"/>
<treecol sortSeparators="true" persist="hidden width" flex="1"
@@ -184,7 +178,7 @@
</rows>
</grid>
<text class="header" value="&formFields;"/>
<tree id="formpreview" flex="1" class="inset">
<tree id="formpreview" flex="1">
<treecols>
<treecol sortSeparators="true" persist="hidden width" flex="3"
width="3" id="field-label" label="&formLabel;"/>
@@ -205,7 +199,7 @@
<!-- Link info -->
<vbox>
<tree id="linktree" flex="1" class="inset" ondraggesture="onBeginLinkDrag(event,'link-address','link-name')">
<tree id="linktree" flex="1" ondraggesture="onBeginLinkDrag(event,'link-address','link-name')">
<treecols>
<treecol sortSeparators="true" persist="hidden width" flex="5"
width="5" id="link-name" label="&linkName;"/>
@@ -225,7 +219,7 @@
<!-- Media information -->
<vbox>
<tree id="imagetree" class="inset fixedsize" onselect="onImageSelect();" ondraggesture="onBeginLinkDrag(event,'image-address','image-alt')">
<tree id="imagetree" class="fixedsize" onselect="onImageSelect();" ondraggesture="onBeginLinkDrag(event,'image-address','image-alt')">
<treecols>
<treecol sortSeparators="true" persist="hidden width" flex="10"
width="10" id="image-address" label="&mediaAddress;"/>

View File

@@ -33,15 +33,6 @@
#
# ***** END LICENSE BLOCK ***** -->
<!ENTITY preface "Info for: ">
<!ENTITY title "Page Info">
<!ENTITY description "Information about the current page">
<!ENTITY helpButton "Help">
<!ENTITY pageInfoWindow.width "425">
<!ENTITY pageInfoWindow.height "470">
<!ENTITY unknown "Unknown">
<!ENTITY closeWindow "w">
<!ENTITY generalTab "General">

View File

@@ -1,26 +1,3 @@
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and imitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is International
# Business Machines Corporation. Portions created by IBM
# Corporation are Copyright (C) 2000 International Business
# Machines Corporation. All Rights Reserved.
#
# Contributor(s):
# Daniel Brooks <db48x@yahoo.com>
# Mike Kowalski <mikejk@ameritech.net>
pageInfo.title=Page Info
frameInfo.title=Frame Info
@@ -60,8 +37,8 @@ mediaObject=Object
mediaEmbed=Embed
mediaLink=Icon
mediaInput=Input
mediaWidth=Width: %Spx
mediaHeight=Height: %Spx
mediaSize=Width: %Spx, Height: %Spx
mediaPhysSize=Physical Width: %Spx, Physical Height: %Spx
generalDiskCache=Disk Cache
generalMemoryCache=Memory Cache

View File

@@ -483,7 +483,7 @@ toolbar[iconsize="small"] #history-button[disabled="true"] {
#page-proxy-button[pageproxystate="invalid"] {
cursor: default;
-moz-image-region: rect(32px, 16px, 48px, 0px); !important;
-moz-image-region: rect(32px, 16px, 48px, 0px) !important;
}