bug 588419 - Switch SeaMonkey UI to open Data Manager instead of other windows, r=IanN

This commit is contained in:
Robert Kaiser 2010-12-15 15:15:37 +01:00
Родитель 1ff8d302ca
Коммит 75e655b1cc
19 изменённых файлов: 42 добавлений и 168 удалений

Просмотреть файл

@ -2370,8 +2370,8 @@ function StatusbarViewPopupManager()
}
catch(ex) { }
// open whitelist with site prefilled to unblock
viewPopups(hostPort);
// Open Data Manager permissions pane site and type prefilled to add.
toDataManager(hostPort + "|permissions|add|popup");
}
function popupBlockerMenuShowing(event)

Просмотреть файл

@ -67,6 +67,7 @@
<script type="application/javascript" src="chrome://navigator/content/pageinfo/security.js"/>
<script type="application/javascript" src="chrome://help/content/contextHelp.js"/>
<script type="application/javascript" src="chrome://communicator/content/utilityOverlay.js"/>
<script type="application/javascript" src="chrome://communicator/content/tasksOverlay.js"/>
<stringbundleset id="pageinfobundleset">
<stringbundle id="pageinfobundle" src="chrome://navigator/locale/pageInfo.properties"/>

Просмотреть файл

@ -137,47 +137,15 @@ var security = {
*/
viewCookies : function()
{
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var win = wm.getMostRecentWindow("mozilla:cookieviewer");
var eTLDService = Components.classes["@mozilla.org/network/effective-tld-service;1"].
getService(Components.interfaces.nsIEffectiveTLDService);
var eTLD;
var uri = gDocument.documentURIObject;
try {
eTLD = eTLDService.getBaseDomain(uri);
}
catch (e) {
// getBaseDomain will fail if the host is an IP address or is empty
eTLD = uri.asciiHost;
}
if (win) {
win.setFilter(eTLD);
win.focus();
}
else
window.openDialog("chrome://communicator/content/permissions/cookieViewer.xul",
"", "resizable", {filterString : eTLD});
toDataManager(this._getSecurityInfo().hostName + '|cookies');
},
/**
* Open the login manager window
*/
viewPasswords : function()
{
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var win = wm.getMostRecentWindow("Toolkit:PasswordManager");
if (win) {
win.setFilter(this._getSecurityInfo().hostName);
win.focus();
}
else
window.openDialog("chrome://communicator/content/passwordManager.xul",
"", "resizable",
{filterString : this._getSecurityInfo().hostName});
toDataManager(this._getSecurityInfo().hostName + '|passwords');
},
_cert : null
@ -242,10 +210,12 @@ function securityOnLoad() {
var yesStr = pageInfoBundle.getString("yes");
var noStr = pageInfoBundle.getString("no");
setText("security-privacy-cookies-value",
hostHasCookies(info.hostName) ? yesStr : noStr);
setText("security-privacy-passwords-value",
realmHasPasswords(info.fullLocation) ? yesStr : noStr);
var hasCookies = hostHasCookies(info.hostName);
setText("security-privacy-cookies-value", hasCookies ? yesStr : noStr);
document.getElementById("security-view-cookies").disabled = !hasCookies;
var hasPasswords = realmHasPasswords(info.fullLocation);
setText("security-privacy-passwords-value", hasPasswords ? yesStr : noStr);
document.getElementById("security-view-password").disabled = !hasPasswords;
var visitCount = previousVisitCount(info.hostName);
if(visitCount > 1) {

Просмотреть файл

@ -163,7 +163,6 @@ comm.jar:
content/communicator/permissions/permissionsManager.js (permissions/permissionsManager.js)
content/communicator/permissions/permissionsManager.xul (permissions/permissionsManager.xul)
content/communicator/permissions/permissionsNavigatorOverlay.xul (permissions/permissionsNavigatorOverlay.xul)
content/communicator/permissions/permissionsOverlay.js (permissions/permissionsOverlay.js)
content/communicator/permissions/treeUtils.js (permissions/treeUtils.js)
* content/communicator/places/browserPlacesViews.js (places/browserPlacesViews.js)
content/communicator/places/controller.js (places/controller.js)

Просмотреть файл

@ -40,8 +40,6 @@
<overlay id="cookieContextOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://communicator/content/permissions/permissionsOverlay.js"/>
<script type="application/javascript">
<![CDATA[
// Code from nsContextMenu.js. Note that we extend the prototype here,

Просмотреть файл

@ -43,7 +43,6 @@
<overlay id="cookieNavigatorOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://communicator/content/permissions/permissionsOverlay.js"/>
<script type="application/javascript">
<![CDATA[
/******* THE FOLLOWING IS FOR THE TASKMENU OVERLAY *******/
@ -220,7 +219,7 @@
<menuseparator/>
<menuitem label="&cookieDisplayCookiesCmd.label;"
accesskey="&cookieDisplayCookiesCmd.accesskey;"
oncommand="viewCookies();"/>
oncommand="toDataManager('|cookies');"/>
</menupopup>
</menu>
<menu label="&cookieImageManager.label;"
@ -249,7 +248,7 @@
<menuseparator/>
<menuitem label="&cookieDisplayImagesCmd.label;"
accesskey="&cookieDisplayImagesCmd.accesskey;"
oncommand="viewImages();"/>
oncommand="toDataManager('|permissions');"/>
</menupopup>
</menu>
<menu label="&cookiePopupManager.label;"
@ -261,10 +260,10 @@
<menupopup>
<menuitem id="AllowPopups" label="&cookieAllowPopupsCmd.label;"
accesskey="&cookieAllowPopupsCmd.accesskey;"
oncommand="viewPopups(popupHost());"/>
oncommand="toDataManager(popupHost() + '|permissions|add|popup');"/>
<menuitem id="ManagePopups" label="&cookieManagePopups.label;"
accesskey="&cookieManagePopups.accesskey;"
oncommand="viewPopups('');"
oncommand="toDataManager('|permissions');"
hidden="true"/>
<menuseparator id="popupMenuSeparator" hidden="true"/>
<!-- Additional items are generated (except for mac - see bug 533097)

Просмотреть файл

@ -1,90 +0,0 @@
/* -*- Mode: Java; tab-width: 4; c-basic-offset: 4; -*-
*
* ***** 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.org Code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Neil Rashbrook <neil@parkwaycc.co.uk>
*
* 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 ***** */
function openCookieViewer(viewerType)
{
const wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var enumerator = wm.getEnumerator("mozilla:cookieviewer");
while (enumerator.hasMoreElements()) {
var viewer = enumerator.getNext();
if (viewer.arguments[0] == viewerType) {
viewer.focus();
return;
}
}
window.openDialog("chrome://communicator/content/permissions/cookieViewer.xul",
"_blank", "chrome,resizable", viewerType);
}
function showPermissionsManager(viewerType, host) {
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var existingWindow = wm.getMostRecentWindow("permissions-" + viewerType);
if (existingWindow) {
existingWindow.setHost(host);
existingWindow.focus();
}
else {
var params = { blockVisible: (viewerType == "image"),
sessionVisible: false,
allowVisible: true,
prefilledHost: host,
permissionType: viewerType };
window.openDialog("chrome://communicator/content/permissions/permissionsManager.xul", "_blank",
"chrome,resizable=yes", params);
}
}
function viewPopups(host) {
showPermissionsManager("popup", host);
}
function viewImages() {
showPermissionsManager("image", "");
}
function viewInstalls() {
showPermissionsManager("install", "");
}
function viewCookies() {
openCookieViewer("cookieManager");
}

Просмотреть файл

@ -130,7 +130,7 @@
label="&viewCookies.label;"
accesskey="&viewCookies.accesskey;"
preference="pref.advanced.cookies.disable_button.view_cookies"
oncommand="viewCookies();"/>
oncommand="toDataManager('|cookies');"/>
</hbox>
</groupbox>
</prefpane>

Просмотреть файл

@ -75,8 +75,10 @@
</radiogroup>
<hbox pack="end">
<button id="viewImages" label="&viewImages.label;"
accesskey="&viewImages.accesskey;" oncommand="viewImages();"
<button id="viewImages"
label="&viewPermissions.label;"
accesskey="&viewPermissions.accesskey;"
oncommand="toDataManager('|permissions');"
preference="pref.advanced.images.disable_button.view_image"/>
</hbox>
</groupbox>

Просмотреть файл

@ -47,8 +47,7 @@
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="passwords_pane"
label="&pref.passwords.title;"
script="chrome://communicator/content/tasksOverlay.js">
label="&pref.passwords.title;">
<preferences id="passwords_preferences">
<preference id="signon.rememberSignons"
@ -72,7 +71,7 @@
<button id="viewStoredPassword"
label="&viewSignons.label;"
accesskey="&viewSignons.accesskey;"
oncommand="toPasswordManager();"
oncommand="toDataManager('|passwords');"
preference="pref.advanced.password.disable_button.view_stored_password"/>
</hbox>
</groupbox>

Просмотреть файл

@ -101,10 +101,10 @@
preference="dom.disable_open_during_load"/>
<spacer flex="1"/>
<button id="exceptionsButton"
label="&popupExceptions.label;"
accesskey="&popupExceptions.accesskey;"
label="&viewPermissions.label;"
accesskey="&viewPermissions.accesskey;"
preference="pref.advanced.popups.disable_button.view_popups"
oncommand="viewPopups('');"/>
oncommand="toDataManager('|permissions');"/>
</hbox>
<separator class="thin"/>
<description id="whenBlock">&whenBlock.description;</description>

Просмотреть файл

@ -49,7 +49,7 @@
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="smartupdate_pane"
label="&pref.smartUpdate.title;"
script="chrome://communicator/content/tasksOverlay.js chrome://communicator/content/pref/pref-smartupdate.js">
script="chrome://communicator/content/pref/pref-smartupdate.js">
<preferences id="smartupdate_preferences">
<preference id="xpinstall.enabled"
@ -89,8 +89,10 @@
<hbox align="center">
<checkbox id="XPInstallEnabled" label="&enableSU.label;" flex="1"
accesskey="&enableSU.accesskey;" preference="xpinstall.enabled"/>
<button id="allowedSitesButton" label="&allowedSites.label;"
accesskey="&allowedSites.accesskey;" oncommand="viewInstalls('');"/>
<button id="allowedSitesButton"
label="&viewPermissions.label;"
accesskey="&viewPermissions.accesskey;"
oncommand="toDataManager('|permissions');"/>
</hbox>
</groupbox>

Просмотреть файл

@ -56,8 +56,9 @@
autopanes="true">
<script type="application/javascript" src="chrome://communicator/content/pref/preferences.js"/>
<!-- Used by pref-smartupdate, pref-cookies, pref-images and pref-popups -->
<script type="application/javascript" src="chrome://communicator/content/permissions/permissionsOverlay.js"/>
<!-- Used by pref-smartupdate, pref-security, pref-cookies, pref-images, pref-popups and pref-passwords -->
<script type="application/javascript" src="chrome://communicator/content/utilityOverlay.js"/>
<script type="application/javascript" src="chrome://communicator/content/tasksOverlay.js"/>
<stringbundle id="bundle_prefutilities"
src="chrome://communicator/locale/pref/prefutilities.properties"/>

Просмотреть файл

@ -47,13 +47,6 @@ function toNavigator()
OpenBrowserWindow();
}
function toPasswordManager()
{
toOpenWindowByType("Toolkit:PasswordManager",
"chrome://communicator/content/passwordManager.xul",
"resizable");
}
function ExpirePassword()
{
// Queries the HTTP Auth Manager and clears all sessions

Просмотреть файл

@ -42,7 +42,7 @@
<menupopup id="passwordPopup">
<menuitem label="&passwordDisplayCmd.label;"
accesskey="&passwordDisplayCmd.accesskey;"
oncommand="toPasswordManager();"/>
oncommand="toDataManager('|passwords');"/>
<menuitem label="&passwordExpireCmd.label;"
accesskey="&passwordExpireCmd.accesskey;"
oncommand="ExpirePassword();"/>

Просмотреть файл

@ -390,7 +390,7 @@
oncommand="this.notificationbox.allowPopupsForSite(event);"/>
<menuitem id="showPopupManager" label="&showPopupManager.label;"
accesskey="&showPopupManager.accesskey;"
oncommand="viewPopups(this.hostport)"/>
oncommand="toDataManager(this.hostport + '|permissions|add|popup')"/>
<menuitem id="dontShowMessage" label="&dontShowMessage.label;"
accesskey="&dontShowMessage.accesskey;"
oncommand="disablePopupBlockerNotifications();"/>

Просмотреть файл

@ -14,8 +14,8 @@
<!ENTITY accOrgImagesRadio.accesskey "r">
<!ENTITY disableImages.label "Do not load any images">
<!ENTITY disableImages.accesskey "n">
<!ENTITY viewImages.label "Manage Image Permissions">
<!ENTITY viewImages.accesskey "P">
<!ENTITY viewPermissions.label "Manage Permissions">
<!ENTITY viewPermissions.accesskey "P">
<!ENTITY animLoopingTitle.label "Animated images should loop">
<!ENTITY animLoopAsSpecified.label "As many times as the image specifies">
<!ENTITY animLoopAsSpecified.accesskey "m">

Просмотреть файл

@ -5,8 +5,8 @@
<!ENTITY popupBlock.label "Block unrequested popup windows">
<!ENTITY popupBlock.accesskey "B">
<!ENTITY popupExceptions.label "Allowed Websites…">
<!ENTITY popupExceptions.accesskey "A">
<!ENTITY viewPermissions.label "Manage Permissions">
<!ENTITY viewPermissions.accesskey "M">
<!ENTITY whenBlock.description "When a popup window has been blocked:">
<!ENTITY playSound.label "Play a sound:">

Просмотреть файл

@ -3,8 +3,8 @@
<!ENTITY smartTitle.label "Manage Software Installations and Updates">
<!ENTITY enableSU.label "Allow websites to install extensions and updates">
<!ENTITY enableSU.accesskey "x">
<!ENTITY allowedSites.label "Allowed Websites">
<!ENTITY allowedSites.accesskey "e">
<!ENTITY viewPermissions.label "Manage Permissions">
<!ENTITY viewPermissions.accesskey "P">
<!ENTITY verifyUpdates.caption "Updates">
<!ENTITY autoUpdates.label "Automatically check for updates to:">