diff --git a/extensions/p3p/resources/content/pageInfoOverlay.js b/extensions/p3p/resources/content/pageInfoOverlay.js index 78cbe587ca1..e69de29bb2d 100755 --- a/extensions/p3p/resources/content/pageInfoOverlay.js +++ b/extensions/p3p/resources/content/pageInfoOverlay.js @@ -1,231 +0,0 @@ -/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 limitations under the - * License. - * - * The Original Code is the Platform for Privacy Preferences. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Samir Gehani - * Harish Dhurvasula - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTopWin = null; -var gTopDoc = null; -var gIOService = null; - -function initTopDocAndWin() -{ - if ("arguments" in window && window.arguments.length > 0 && - window.arguments[0]) - { - gTopWin = null; - gTopDoc = window.arguments[0]; - } - else - { - if ("gBrowser" in window.opener) - gTopWin = window.opener.gBrowser.contentWindow; - else - gTopWin = window.opener.frames[0]; - gTopDoc = gTopWin.document; - } -} - -function initP3PTab() -{ - initTopDocAndWin(); - - var mainLinkNode = document.getElementById("mainLink"); - mainLinkNode.setAttribute("label", gTopDoc.location.href); - - // now select the main link - var tree = document.getElementById("linkList"); - tree.view.selection.select(0); - - var linkTypes = - [ - // Tag Attr List node ID - ["a", "href", "linkKids"], - ["applet", "code", "appletKids"], - ["area", "href", "imageMapKids"], - ["form", "action", "formKids"], - ["frame", "src", "frameKids"], - ["iframe", "src", "frameKids"], - ["img", "src", "imageKids"], - ["image", "src", "imageKids"], - ["link", "href", "externalDocKids"], - ["object", "codebase", "objectKids"], - ["object", "data", "objectKids"], - ["script", "src", "scriptKids"] - ]; - - var list, i, j; - var length = linkTypes.length; - for (i = 0; i < length; ++i) - { - list = getLinksFor(linkTypes[i][0], linkTypes[i][1], gTopWin, gTopDoc); - // now add list items under appropriate link type in the tree - var len = list.length; - for (j = 0; j < len; ++j) - { - addRow(linkTypes[i][2], list[j]); - } - } -} - -function makeURLAbsolute(url, base) -{ - if (url.indexOf(':') > -1) - return url; - - if (!gIOService) { - gIOService = - Components.classes["@mozilla.org/network/io-service;1"].getService(nsIIOService); - } - - var baseURI = gIOService.newURI(base, null, null); - - return gIOService.newURI(baseURI.resolve(url), null, null).spec; -} - -function getLinksFor(aTagName, aAttrName, aWin, aDoc) -{ - var i, frame, length, list = new Array; - - // cycle through frames - if (aWin) - { - length = aWin.frames.length; - for (i = 0; i < length; ++i) - { - frame = aWin.frames[i]; - list = list.concat(getLinksFor(aTagName, aAttrName, - frame, frame.document)); - } - } - - // now look for tags in the leaf document - var elts = aDoc.getElementsByTagName(aTagName); - length = elts.length; - for (i = 0; i < length; ++i) - { - var url = elts[i].getAttribute(aAttrName); - if (url) { - try { - // The user sees the links as absolute when mousing over. - // The link list does not show the base URL for the user, - // so this is the only way we can indicate where things - // really point to in the link list. - list.push(makeURLAbsolute(url, elts[i].baseURI)); - } catch (e) { - // XXX Ignore for now, most likely bad URL, but could also be - // something really serious like out of memory. - } - } - } - - return list; -} - -function addRow(aRootID, aLabel) -{ - const kXULNS = - "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; - var root = document.getElementById(aRootID); - var item = document.createElementNS(kXULNS, "treeitem"); - root.appendChild(item); - var row = document.createElementNS(kXULNS, "treerow"); - item.appendChild(row); - var cell = document.createElementNS(kXULNS, "treecell"); - cell.setAttribute("label", aLabel); - row.appendChild(cell); -} - -function getSelectedURI() -{ - var URI = null; - var tree = document.getElementById("linkList"); - var selectedItem = tree.contentView.getItemAtIndex(tree.currentIndex); - if (selectedItem) - { - var selectedRow = - selectedItem.getElementsByTagName("treerow")[0]; - if (selectedRow) - { - var selectedCell = - selectedRow.getElementsByTagName("treecell")[0]; - if (selectedCell) - URI = selectedCell.getAttribute("label"); - } - } - - return URI; -} - -//--------------------------------------------------------------------------- -// Interface to P3P backend -//--------------------------------------------------------------------------- -var gPolicyViewer = null; // one policy viewer per page info window -var gPrivacyTabInfo = null; - -function onMachineReadable() -{ - if (!gPolicyViewer) { - gPolicyViewer = new nsPolicyViewer(gTopDoc); - } - gPolicyViewer.load(getSelectedURI(), LOAD_SUMMARY); -} - -function onHumanReadable() -{ - if (!gPolicyViewer) { - gPolicyViewer = new nsPolicyViewer(gTopDoc); - } - gPolicyViewer.load(getSelectedURI(), LOAD_POLICY); - -} - -function onOptInOptOut() -{ - if (!gPolicyViewer) { - gPolicyViewer = new nsPolicyViewer(gTopDoc); - } - gPolicyViewer.load(getSelectedURI(), LOAD_OPTIONS); - -} - -function finalizePolicyViewer() -{ - if (gPolicyViewer) - gPolicyViewer.finalize(); -} - -addEventListener("unload", finalizePolicyViewer, false); - diff --git a/security/manager/pki/resources/content/PageInfoOverlay.xul b/security/manager/pki/resources/content/PageInfoOverlay.xul index 94f83abdae9..cf64df9501d 100644 --- a/security/manager/pki/resources/content/PageInfoOverlay.xul +++ b/security/manager/pki/resources/content/PageInfoOverlay.xul @@ -62,16 +62,10 @@ // Get the window for this information var w; -#ifdef MOZ_PHOENIX - if (window.arguments[0] && window.arguments[0].doc) - { - w = window.arguments[0].doc; -#else - if ("arguments" in window && window.arguments.length > 0 && window.arguments[0]) + if ("arguments" in window && window.arguments.length > 0 && + window.arguments[0] && window.arguments[0].doc) { - w = window.arguments[0]; -#endif - + // w = window.arguments[0].doc; // We don't have separate info for a frame, return null until further notice // (see bug 138479) return null; diff --git a/security/manager/pki/resources/jar.mn b/security/manager/pki/resources/jar.mn index ac5a423fc48..8c28654f8a1 100644 --- a/security/manager/pki/resources/jar.mn +++ b/security/manager/pki/resources/jar.mn @@ -20,7 +20,7 @@ pippki.jar: content/pippki/ssl2ciphers.xul (content/ssl2ciphers.xul) content/pippki/ssl3tlsciphers.xul (content/ssl3tlsciphers.xul) content/pippki/ssl3tlsciphers2.xul (content/ssl3tlsciphers2.xul) -* content/pippki/PageInfoOverlay.xul (content/PageInfoOverlay.xul) + content/pippki/PageInfoOverlay.xul (content/PageInfoOverlay.xul) content/pippki/newserver.js (content/newserver.js) * content/pippki/newserver.xul (content/newserver.xul) content/pippki/downloadcert.js (content/downloadcert.js) diff --git a/themes/classic/navigator/pageInfo.css b/themes/classic/navigator/pageInfo.css index 61e83169f98..e69de29bb2d 100644 --- a/themes/classic/navigator/pageInfo.css +++ b/themes/classic/navigator/pageInfo.css @@ -1,72 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code. - * - * The Initial Developer of the Original Code is Daniel Brooks. - * Portions created by the Initial Developer are Copyright (C) 2001-2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the LGPL or the GPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** -*/ - -@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; -} - -textbox[disabled] { - font-style: italic; -} diff --git a/themes/modern/navigator/pageInfo.css b/themes/modern/navigator/pageInfo.css index 9f059c60aa0..e69de29bb2d 100644 --- a/themes/modern/navigator/pageInfo.css +++ b/themes/modern/navigator/pageInfo.css @@ -1,72 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * 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 limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code. - * - * The Initial Developer of the Original Code is Daniel Brooks. - * Portions created by the Initial Developer are Copyright (C) 2001-2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the LGPL or the GPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** -*/ - -@import "chrome://global/skin/"; - -tree { - margin: .5em; -} - -textbox, -textbox > .textbox-internal-box, -textbox > .textarea-internal-box { - background: transparent !important; - border: none; - padding: 0px; -} - -textbox.header { - margin-left: 0; -} - -.iframe { - margin: .5em; - background: white; - overflow: auto; -} - -#thepreviewimage { - margin: 1em; -} - -.fixedsize { - height: 8.5em; -} - -textbox[disabled] -{ - font-style: italic; -} diff --git a/xpfe/browser/resources/content/navigator.js b/xpfe/browser/resources/content/navigator.js index fc677b306a7..3611ed16ed6 100644 --- a/xpfe/browser/resources/content/navigator.js +++ b/xpfe/browser/resources/content/navigator.js @@ -1715,13 +1715,12 @@ function BrowserViewSourceOfURL(url, charset, pageCookie) } // doc=null for regular page info, doc=owner document for frame info. -function BrowserPageInfo(doc, tab) +function BrowserPageInfo(doc, initialTab) { window.openDialog("chrome://navigator/content/pageInfo.xul", "_blank", "chrome,dialog=no", - doc, - tab); + {doc: doc, initialTab: initialTab}); } function hiddenWindowStartup() diff --git a/xpfe/browser/resources/content/pageInfo.js b/xpfe/browser/resources/content/pageInfo.js index b218a9f1e4d..9d55cdc1c58 100644 --- a/xpfe/browser/resources/content/pageInfo.js +++ b/xpfe/browser/resources/content/pageInfo.js @@ -245,9 +245,11 @@ const XHTMLre = RegExp(XHTMLNSre + "|" + XHTML2NSre, ""); var onLoadRegistry = [ ]; /* Called when PageInfo window is loaded. Arguments are: - * window.arguments[0] - document to use for source (null=Page Info, otherwise Frame Info) - * window.arguments[1] - tab name to display first (may be null) -*/ + * window.arguments[0] - (optional) an object consisting of + * - doc: (optional) document to use for source. if not provided, + * the calling window's document will be used + * - initialTab: (optional) id of the inital tab to display + */ function onLoadPageInfo() { //dump("===============================================================================\n"); @@ -274,10 +276,11 @@ function onLoadPageInfo() gStrings.mediaInput = theBundle.getString("mediaInput"); var docTitle = ""; - if ("arguments" in window && window.arguments.length >= 1 && window.arguments[0]) + if ("arguments" in window && window.arguments.length >= 1 && + window.arguments[0] && window.arguments[0].doc) { theWindow = null; - theDocument = window.arguments[0]; + theDocument = window.arguments[0].doc; docTitle = theBundle.getString("frameInfo.title"); } else @@ -305,21 +308,18 @@ function onLoadPageInfo() onLoadRegistry[x](); } - /* Select the requested tab, if the name is specified */ - if ("arguments" in window && window.arguments.length > 1) + var tabControl = document.getElementById("tabbox"); + if (tabControl) { - var tabName = window.arguments[1]; - - if (tabName) + /* Select the requested tab, if the name is specified */ + if ("arguments" in window && window.arguments.length >= 1 && + window.arguments[0] && window.arguments[0].initialTab) { - var tabControl = document.getElementById("tabbox"); - var tab = document.getElementById(tabName); - - if (tabControl && tab) - { + var tab = document.getElementById(window.arguments[0].initialTab); + if (tab) tabControl.selectedTab = tab; - } } + tabControl.selectedTab.focus(); } } diff --git a/xpfe/browser/resources/content/pageInfo.xul b/xpfe/browser/resources/content/pageInfo.xul index 058a0636901..60a356fac1d 100644 --- a/xpfe/browser/resources/content/pageInfo.xul +++ b/xpfe/browser/resources/content/pageInfo.xul @@ -102,7 +102,7 @@ - + @@ -111,60 +111,60 @@ - - - - - - - - - - +