Bug #285158 --> Move shared pref UI files from mozilla\browser to mozilla\toolkit\mozapps so Firefox and Thunderbird can share the files together.

No actual coding or UI changes here.

sr=ben
This commit is contained in:
scott%scott-macgregor.org 2005-03-10 23:11:10 +00:00
Родитель ea9edcb5be
Коммит 1d6ce30db1
47 изменённых файлов: 1120 добавлений и 29 удалений

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

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

@ -80,7 +80,7 @@ var gAdvancedPane = {
showOCSP: function ()
{
document.documentElement.openSubDialog("chrome://browser/content/preferences/ocsp.xul",
document.documentElement.openSubDialog("chrome://mozapps/content/preferences/ocsp.xul",
"", null);
},

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

@ -38,7 +38,7 @@
# ***** END LICENSE BLOCK *****
<?xml-stylesheet href="chrome://global/skin/"?>
<?xml-stylesheet href="chrome://browser/content/preferences/preferences.css" type="text/css"?>
<?xml-stylesheet href="chrome://mozapps/content/preferences/preferences.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://browser/locale/preferences/changeaction.dtd">
@ -50,7 +50,7 @@
style="width: 36em;"
persist="screenX screenY">
<script type="application/x-javascript" src="chrome://browser/content/preferences/actionsshared.js"/>
<script type="application/x-javascript" src="chrome://mozapps/content/preferences/actionsshared.js"/>
<script type="application/x-javascript" src="chrome://browser/content/preferences/changeaction.js"/>
<stringbundle id="bundlePreferences" src="chrome://browser/locale/preferences/preferences.properties"/>

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

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

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

@ -67,7 +67,7 @@
type="bool"/>
</preferences>
<script type="application/x-javascript" src="chrome://browser/content/preferences/fontbuilder.js"/>
<script type="application/x-javascript" src="chrome://mozapps/content/preferences/fontbuilder.js"/>
<script type="application/x-javascript" src="chrome://browser/content/preferences/content.js"/>
<groupbox>

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

@ -54,7 +54,7 @@
title="&downloadactionsWindow.title;"
width="480" height="310" persist="width height screenX screenY">
<script type="application/x-javascript" src="chrome://browser/content/preferences/actionsshared.js"/>
<script type="application/x-javascript" src="chrome://mozapps/content/preferences/actionsshared.js"/>
<script type="application/x-javascript" src="chrome://browser/content/preferences/downloadactions.js"/>
<stringbundle id="bundlePreferences" src="chrome://browser/locale/preferences/preferences.properties"/>

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

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

@ -189,7 +189,7 @@ var gFontsDialog = {
if (aMenulist.selectedItem.value == "choose") {
var rv = { newdpi: -1 };
document.documentElement.openSubDialog("chrome://browser/content/preferences/fontscaling.xul",
document.documentElement.openSubDialog("chrome://mozapps/content/preferences/fontscaling.xul",
"", rv);
if (rv.newdpi != -1) {
this._setResolution(rv.newdpi);

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

@ -62,7 +62,7 @@
</preferences>
<stringbundle id="bundlePreferences" src="chrome://browser/locale/preferences/preferences.properties"/>
<script type="application/x-javascript" src="chrome://browser/content/preferences/fontbuilder.js"/>
<script type="application/x-javascript" src="chrome://mozapps/content/preferences/fontbuilder.js"/>
<script type="application/x-javascript" src="chrome://browser/content/preferences/fonts.js"/>
<groupbox>

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

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

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

@ -1,11 +1,8 @@
browser.jar:
* content/browser/preferences/actionsshared.js
* content/browser/preferences/advanced.xul
* content/browser/preferences/advanced.js
* content/browser/preferences/changeaction.xul
* content/browser/preferences/changeaction.js
* content/browser/preferences/changemp.xul
* content/browser/preferences/changemp.js
* content/browser/preferences/colors.xul
* content/browser/preferences/cookies.xul
* content/browser/preferences/cookies.js
@ -17,28 +14,19 @@ browser.jar:
* content/browser/preferences/downloads.js
* content/browser/preferences/downloadactions.xul
* content/browser/preferences/downloadactions.js
* content/browser/preferences/fontbuilder.js
* content/browser/preferences/fonts.xul
* content/browser/preferences/fonts.js
* content/browser/preferences/fontscaling.xul
* content/browser/preferences/fontscaling.js
* content/browser/preferences/general.xul
* content/browser/preferences/general.js
* content/browser/preferences/helperapplications.js
* content/browser/preferences/languages.xul
* content/browser/preferences/languages.js
* content/browser/preferences/ocsp.xul
* content/browser/preferences/ocsp.js
* content/browser/preferences/permissions.xul
* content/browser/preferences/permissions.js
* content/browser/preferences/permissionsutils.js
* content/browser/preferences/preferences.xul
* content/browser/preferences/preferences.xml
* content/browser/preferences/preferences.css
* content/browser/preferences/privacy.xul
* content/browser/preferences/privacy.js
* content/browser/preferences/removemp.xul
* content/browser/preferences/removemp.js
* content/browser/preferences/sanitize.xul
* content/browser/preferences/sanitize.js
* content/browser/preferences/tabs.xul

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

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

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

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

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

@ -37,7 +37,7 @@
# ***** END LICENSE BLOCK *****
<?xml-stylesheet href="chrome://global/skin/global.css"?>
<?xml-stylesheet href="chrome://browser/content/preferences/preferences.css"?>
<?xml-stylesheet href="chrome://mozapps/content/preferences/preferences.css"?>
<?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css"?>
<!DOCTYPE prefwindow [

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

@ -193,7 +193,7 @@ var gPrivacyPane = {
changeMasterPassword: function ()
{
document.documentElement.openSubDialog("chrome://browser/content/preferences/changemp.xul",
document.documentElement.openSubDialog("chrome://mozapps/content/preferences/changemp.xul",
"", null);
this.updateMasterPasswordButton();
},
@ -230,7 +230,7 @@ var gPrivacyPane = {
bundle.getString("pw_change2empty_in_fips_mode"));
}
else {
document.documentElement.openSubDialog("chrome://browser/content/preferences/removemp.xul",
document.documentElement.openSubDialog("chrome://mozapps/content/preferences/removemp.xul",
"", null);
this.updateMasterPasswordButton();
document.getElementById("setMasterPassword").focus();

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

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

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

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

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

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

@ -29,7 +29,6 @@
locale/browser/migration/migration.properties (%chrome/browser/migration/migration.properties)
locale/browser/preferences/advanced.dtd (%chrome/browser/preferences/advanced.dtd)
locale/browser/preferences/changeaction.dtd (%chrome/browser/preferences/changeaction.dtd)
locale/browser/preferences/changemp.dtd (%chrome/browser/preferences/changemp.dtd)
locale/browser/preferences/colors.dtd (%chrome/browser/preferences/colors.dtd)
locale/browser/preferences/cookies.dtd (%chrome/browser/preferences/cookies.dtd)
locale/browser/preferences/content.dtd (%chrome/browser/preferences/content.dtd)
@ -37,15 +36,12 @@
locale/browser/preferences/downloads.dtd (%chrome/browser/preferences/downloads.dtd)
locale/browser/preferences/downloadactions.dtd (%chrome/browser/preferences/downloadactions.dtd)
locale/browser/preferences/fonts.dtd (%chrome/browser/preferences/fonts.dtd)
locale/browser/preferences/fontscaling.dtd (%chrome/browser/preferences/fontscaling.dtd)
locale/browser/preferences/general.dtd (%chrome/browser/preferences/general.dtd)
locale/browser/preferences/languages.dtd (%chrome/browser/preferences/languages.dtd)
locale/browser/preferences/ocsp.dtd (%chrome/browser/preferences/ocsp.dtd)
locale/browser/preferences/permissions.dtd (%chrome/browser/preferences/permissions.dtd)
locale/browser/preferences/preferences.dtd (%chrome/browser/preferences/preferences.dtd)
locale/browser/preferences/preferences.properties (%chrome/browser/preferences/preferences.properties)
locale/browser/preferences/privacy.dtd (%chrome/browser/preferences/privacy.dtd)
locale/browser/preferences/removemp.dtd (%chrome/browser/preferences/removemp.dtd)
locale/browser/preferences/sanitize.dtd (%chrome/browser/preferences/sanitize.dtd)
locale/browser/preferences/tabs.dtd (%chrome/browser/preferences/tabs.dtd)
locale/browser/sidebar/sidebar.properties (%chrome/browser/sidebar/sidebar.properties)

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

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

@ -0,0 +1,9 @@
<!ENTITY setPassword.title "Change Master Password">
<!ENTITY setPassword.tokenName.label "Security Device">
<!ENTITY setPassword.oldPassword.label "Current password:">
<!ENTITY setPassword.newPassword.label "Enter new password:">
<!ENTITY setPassword.reenterPassword.label "Re-enter password:">
<!ENTITY setPassword.meter.label "Password quality meter">
<!ENTITY setPassword.meter.loading "Loading">
<!ENTITY masterPasswordDescription.label "A Master Password is used to protect sensitive information like site passwords. If you create a Master Password you will be asked to enter it once per session when &brandShortName; retrieves saved information protected by the password.">
<!ENTITY masterPasswordWarning.label "Please make sure you remember the Master Password you have set. If you forget your Master Password, you will be unable to access any of the information protected by it.">

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

@ -0,0 +1,9 @@
<!ENTITY ocspDialog.title "Verification">
<!ENTITY validation.ocsp.description "&brandShortName; can use Online Certificate Status Protocol (OCSP) to verify certificates. Set &brandShortName; to use OCSP as follows:">
<!ENTITY disableOCSP.label "Do not use OCSP for certificate validation">
<!ENTITY certOCSP.label "Use OCSP to validate only certificates that specify an OCSP service URL">
<!ENTITY proxyOCSP.label "Use OCSP to validate all certificates using this URL and signer:">
<!ENTITY serviceURL.label "Service URL:">
<!ENTITY serviceURL.accesskey "S">
<!ENTITY signingCA.label "Response Signer:">
<!ENTITY signingCA.accesskey "R">

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

@ -0,0 +1,18 @@
#### Change Action
downloadHelperNoneSelected=None Selected
#### Master Password
password_not_set=(not set)
failed_pw_change=Unable to change Master Password.
incorrect_pw=You did not enter the correct current Master Password. Please try again.
pw_change_ok=Master Password successfully changed.
pw_erased_ok=You have deleted your Master Password.
pw_not_wanted=Warning! You have decided not to use a Master Password.
pw_empty_warning=Your stored web and email passwords, form data, and private keys will not be protected.
pw_change2empty_in_fips_mode=You are currently in FIPS mode. FIPS requires a non-empty Master Password.
pw_change_success_title=Password Change Succeeded
pw_change_failed_title=Password Change Failed
pw_remove_button=Remove

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

@ -0,0 +1,6 @@
<!ENTITY removePassword.title "Remove Master Password">
<!ENTITY removeInfo.label "You must enter your current password to proceed:">
<!ENTITY removeWarning1.label "Your Master Password is used to protect sensitive information like site passwords.">
<!ENTITY removeWarning2.label "If you remove your Master Password your information will not be protected if your computer is compromised.">
<!ENTITY setPassword.oldPassword.label "Current password:">

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

@ -65,7 +65,6 @@
* locale/@AB_CD@/mozapps/contents.rdf (generic/chrome/mozapps/contents.rdf)
* locale/@AB_CD@/mozapps/downloads/unknownContentType.properties (%chrome/mozapps/downloads/unknownContentType.properties)
* locale/@AB_CD@/mozapps/downloads/unknownContentType.dtd (%chrome/mozapps/downloads/unknownContentType.dtd)
locale/@AB_CD@/mozapps/downloads/pref-downloads.dtd (%chrome/mozapps/downloads/pref-downloads.dtd)
locale/@AB_CD@/mozapps/downloads/editAction.dtd (%chrome/mozapps/downloads/editAction.dtd)
locale/@AB_CD@/mozapps/downloads/downloads.dtd (%chrome/mozapps/downloads/downloads.dtd)
locale/@AB_CD@/mozapps/downloads/downloads.properties (%chrome/mozapps/downloads/downloads.properties)
@ -76,6 +75,11 @@
locale/@AB_CD@/mozapps/extensions/finalize.dtd (%chrome/mozapps/extensions/finalize.dtd)
locale/@AB_CD@/mozapps/plugins/plugins.dtd (%chrome/mozapps/plugins/plugins.dtd)
locale/@AB_CD@/mozapps/plugins/plugins.properties (%chrome/mozapps/plugins/plugins.properties)
locale/@AB_CD@/mozapps/preferences/ocsp.dtd (%chrome/mozapps/preferences/ocsp.dtd)
locale/@AB_CD@/mozapps/preferences/fontscaling.dtd (%chrome/mozapps/preferences/fontscaling.dtd)
locale/@AB_CD@/mozapps/preferences/changemp.dtd (%chrome/mozapps/preferences/changemp.dtd)
locale/@AB_CD@/mozapps/preferences/removemp.dtd (%chrome/mozapps/preferences/removemp.dtd)
locale/@AB_CD@/mozapps/preferences/preferences.properties (%chrome/mozapps/preferences/preferences.properties)
locale/@AB_CD@/mozapps/profile/createProfileWizard.dtd (%chrome/mozapps/profile/createProfileWizard.dtd)
locale/@AB_CD@/mozapps/profile/profileSelection.properties (%chrome/mozapps/profile/profileSelection.properties)
locale/@AB_CD@/mozapps/profile/profileSelection.dtd (%chrome/mozapps/profile/profileSelection.dtd)

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

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

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

@ -1,8 +1,6 @@
toolkit.jar:
* content/mozapps/downloads/helperApps.js (downloads/content/helperApps.js)
* content/mozapps/downloads/unknownContentType.xul (downloads/content/unknownContentType.xul)
* content/mozapps/downloads/pref-downloads.xul (downloads/content/pref-downloads.xul)
* content/mozapps/downloads/pref-downloads.js (downloads/content/pref-downloads.js)
* content/mozapps/downloads/overrideHandler.js (downloads/content/overrideHandler.js)
* content/mozapps/downloads/editAction.xul (downloads/content/editAction.xul)
* content/mozapps/downloads/editAction.js (downloads/content/editAction.js)
@ -20,6 +18,18 @@ toolkit.jar:
* content/mozapps/extensions/about.xul (extensions/content/about.xul)
* content/mozapps/extensions/about.js (extensions/content/about.js)
* content/mozapps/extensions/finalize.xul (extensions/content/finalize.xul)
* content/mozapps/preferences/actionsshared.js (preferences/actionsshared.js)
* content/mozapps/preferences/ocsp.js (preferences/ocsp.js)
* content/mozapps/preferences/ocsp.xul (preferences/ocsp.xul)
* content/mozapps/preferences/fontbuilder.js (preferences/fontbuilder.js)
* content/mozapps/preferences/fontscaling.js (preferences/fontscaling.js)
* content/mozapps/preferences/fontscaling.xul (preferences/fontscaling.xul)
* content/mozapps/preferences/changemp.js (preferences/changemp.js)
* content/mozapps/preferences/changemp.xul (preferences/changemp.xul)
* content/mozapps/preferences/removemp.js (preferences/removemp.js)
* content/mozapps/preferences/removemp.xul (preferences/removemp.xul)
* content/mozapps/preferences/preferences.css (preferences/preferences.css)
* content/mozapps/preferences/preferences.xml (preferences/preferences.xml)
* content/mozapps/update/update.xul (update/content/update.xul)
* content/mozapps/update/update.js (update/content/update.js)
* content/mozapps/update/updates.xml (update/content/updates.xml)

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

@ -0,0 +1,63 @@
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
# 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 Download Actions Manager.
#
# The Initial Developer of the Original Code is Ben Goodger.
# Portions created by the Initial Developer are
# Copyright (C) 2000, 2001, 2003, 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Ben Goodger <ben@mozilla.org>
#
# 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 *****
const FILEACTION_SAVE_TO_DISK = 1;
const FILEACTION_OPEN_INTERNALLY = 2;
const FILEACTION_OPEN_DEFAULT = 3;
const FILEACTION_OPEN_CUSTOM = 4;
const FILEACTION_OPEN_PLUGIN = 5;
function FileAction ()
{
}
FileAction.prototype = {
type : "",
extension : "",
hasExtension: true,
editable : true,
smallIcon : "",
bigIcon : "",
typeName : "",
action : "",
mimeInfo : null,
customHandler : "",
handleMode : false,
pluginAvailable : false,
pluginEnabled : false,
handledOnlyByPlugin : false
};

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

@ -0,0 +1,254 @@
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
# 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 Netscape are
# Copyright (C) 2001 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Bob Lord <lord@netscape.com>
# Terry Hayes <thayes@netscape.com>
const nsPK11TokenDB = "@mozilla.org/security/pk11tokendb;1";
const nsIPK11TokenDB = Components.interfaces.nsIPK11TokenDB;
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
const nsPKCS11ModuleDB = "@mozilla.org/security/pkcs11moduledb;1";
const nsIPKCS11ModuleDB = Components.interfaces.nsIPKCS11ModuleDB;
const nsIPKCS11Slot = Components.interfaces.nsIPKCS11Slot;
const nsIPK11Token = Components.interfaces.nsIPK11Token;
var params;
var tokenName="";
var pw1;
function init()
{
pw1 = document.getElementById("pw1");
process();
}
function process()
{
var secmoddb = Components.classes[nsPKCS11ModuleDB].getService(nsIPKCS11ModuleDB);
var bundle = document.getElementById("bundlePreferences");
// If the token is unitialized, don't use the old password box.
// Otherwise, do.
var slot = secmoddb.findSlotByName(tokenName);
if (slot) {
var oldpwbox = document.getElementById("oldpw");
var msgBox = document.getElementById("message");
var status = slot.status;
if (status == nsIPKCS11Slot.SLOT_UNINITIALIZED
|| status == nsIPKCS11Slot.SLOT_READY) {
oldpwbox.setAttribute("hidden", "true");
msgBox.setAttribute("value", bundle.getString("password_not_set"));
msgBox.setAttribute("hidden", "false");
if (status == nsIPKCS11Slot.SLOT_READY) {
oldpwbox.setAttribute("inited", "empty");
} else {
oldpwbox.setAttribute("inited", "true");
}
// Select first password field
document.getElementById('pw1').focus();
} else {
// Select old password field
oldpwbox.setAttribute("hidden", "false");
msgBox.setAttribute("hidden", "true");
oldpwbox.setAttribute("inited", "false");
oldpwbox.focus();
}
}
if (params) {
// Return value 0 means "canceled"
params.SetInt(1, 0);
}
checkPasswords();
}
function setPassword()
{
var pk11db = Components.classes[nsPK11TokenDB].getService(nsIPK11TokenDB);
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
var token = pk11db.findTokenByName(tokenName);
dump("*** TOKEN!!!! (name = |" + token + "|\n");
var oldpwbox = document.getElementById("oldpw");
var initpw = oldpwbox.getAttribute("inited");
var bundle = document.getElementById("bundlePreferences");
var success = false;
if (initpw == "false" || initpw == "empty") {
try {
var oldpw = "";
var passok = 0;
if (initpw == "empty") {
passok = 1;
} else {
oldpw = oldpwbox.value;
passok = token.checkPassword(oldpw);
}
if (passok) {
if (initpw == "empty" && pw1.value == "") {
// This makes no sense that we arrive here,
// we reached a case that should have been prevented by checkPasswords.
} else {
if (pw1.value == "") {
var secmoddb = Components.classes[nsPKCS11ModuleDB].getService(nsIPKCS11ModuleDB);
if (secmoddb.isFIPSEnabled) {
// empty passwords are not allowed in FIPS mode
promptService.alert(window,
bundle.getString("pw_change_failed_title"),
bundle.getString("pw_change2empty_in_fips_mode"));
passok = 0;
}
}
if (passok) {
token.changePassword(oldpw, pw1.value);
if (pw1.value == "") {
promptService.alert(window,
bundle.getString("pw_change_success_title"),
bundle.getString("pw_erased_ok")
+ " " + bundle.getString("pw_empty_warning"));
} else {
promptService.alert(window,
bundle.getString("pw_change_success_title"),
bundle.getString("pw_change_ok"));
}
success = true;
}
}
} else {
oldpwbox.focus();
oldpwbox.setAttribute("value", "");
promptService.alert(window,
bundle.getString("pw_change_failed_title"),
bundle.getString("incorrect_pw"));
}
} catch (e) {
promptService.alert(window,
bundle.getString("pw_change_failed_title"),
bundle.getString("failed_pw_change"));
}
} else {
token.initPassword(pw1.value);
if (pw1.value == "") {
promptService.alert(window,
bundle.getString("pw_change_success_title"),
bundle.getString("pw_not_wanted")
+ " " + bundle.getString("pw_empty_warning"));
}
success = true;
}
// Terminate dialog
if (success)
window.close();
}
function setPasswordStrength()
{
// Here is how we weigh the quality of the password
// number of characters
// numbers
// non-alpha-numeric chars
// upper and lower case characters
var pw=document.getElementById('pw1').value;
//length of the password
var pwlength=(pw.length);
if (pwlength>5)
pwlength=5;
//use of numbers in the password
var numnumeric = pw.replace (/[0-9]/g, "");
var numeric=(pw.length - numnumeric.length);
if (numeric>3)
numeric=3;
//use of symbols in the password
var symbols = pw.replace (/\W/g, "");
var numsymbols=(pw.length - symbols.length);
if (numsymbols>3)
numsymbols=3;
//use of uppercase in the password
var numupper = pw.replace (/[A-Z]/g, "");
var upper=(pw.length - numupper.length);
if (upper>3)
upper=3;
var pwstrength=((pwlength*10)-20) + (numeric*10) + (numsymbols*15) + (upper*10);
// make sure we're give a value between 0 and 100
if ( pwstrength < 0 ) {
pwstrength = 0;
}
if ( pwstrength > 100 ) {
pwstrength = 100;
}
var mymeter=document.getElementById('pwmeter');
mymeter.setAttribute("value",pwstrength);
return;
}
function checkPasswords()
{
var pw1=document.getElementById('pw1').value;
var pw2=document.getElementById('pw2').value;
var ok=document.documentElement.getButton("accept");
var oldpwbox = document.getElementById("oldpw");
if (oldpwbox) {
var initpw = oldpwbox.getAttribute("inited");
if (initpw == "empty" && pw1 == "") {
// The token has already been initialized, therefore this dialog
// was called with the intention to change the password.
// The token currently uses an empty password.
// We will not allow changing the password from empty to empty.
ok.setAttribute("disabled","true");
return;
}
}
if (pw1 == pw2){
ok.setAttribute("disabled","false");
} else
{
ok.setAttribute("disabled","true");
}
}

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

@ -0,0 +1,85 @@
<?xml version="1.0"?>
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
# 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 Netscape are
# Copyright (C) 2001 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Bob Lord <lord@netscape.com>
# Terry Hayes <thayes@netscape.com>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE dialog [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
<!ENTITY % changempDTD SYSTEM "chrome://mozapps/locale/preferences/changemp.dtd" >
%brandDTD;
%changempDTD;
]>
<dialog id="changemp" title="&setPassword.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
style="width: 35em;"
ondialogaccept="setPassword();"
onload="init()">
<script type="application/x-javascript" src="chrome://mozapps/content/preferences/changemp.js"/>
<stringbundle id="bundlePreferences" src="chrome://mozapps/locale/preferences/preferences.properties"/>
<description>&masterPasswordDescription.label;</description>
<groupbox>
<grid>
<columns>
<column/>
<column/>
</columns>
<rows>
<row>
<label value="&setPassword.oldPassword.label;"/>
<textbox id="oldpw" type="password"/>
<!-- This textbox is inserted as a workaround to the fact that making the 'type'
& 'disabled' property of the 'oldpw' textbox toggle between ['password' &
'false'] and ['text' & 'true'] - as would be necessary if the menu has more
than one tokens, some initialized and some not - does not work properly. So,
either the textbox 'oldpw' or the textbox 'message' would be displayed,
depending on the state of the token selected
-->
<textbox id="message" disabled="true" />
</row>
<row>
<label value="&setPassword.newPassword.label;"/>
<textbox id="pw1" type="password"
oninput="setPasswordStrength(); checkPasswords();"/>
</row>
<row>
<label value="&setPassword.reenterPassword.label;"/>
<textbox id="pw2" type="password" oninput="checkPasswords();"/>
</row>
</rows>
</grid>
</groupbox>
<groupbox>
<caption label="&setPassword.meter.label;"/>
<progressmeter id="pwmeter" mode="determined" value="0"/>
</groupbox>
<description class="header">&masterPasswordWarning.label;</description>
</dialog>

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

@ -0,0 +1,119 @@
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
# 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
# Doron Rosenberg.
# Portions created by the Initial Developer are Copyright (C) 2001
# 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 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 FontBuilder = {
_enumerator: null,
get enumerator ()
{
if (!this._enumerator) {
this._enumerator = Components.classes["@mozilla.org/gfx/fontenumerator;1"]
.createInstance(Components.interfaces.nsIFontEnumerator);
}
return this._enumerator;
},
_allFonts: null,
buildFontList: function (aLanguage, aFontType, aMenuList)
{
// Reset the list
while (aMenuList.hasChildNodes())
aMenuList.removeChild(aMenuList.firstChild);
var defaultFont = null;
// Load Font Lists
var fonts = this.enumerator.EnumerateFonts(aLanguage, aFontType, { } );
if (fonts.length > 0)
defaultFont = this.enumerator.getDefaultFont(aLanguage, aFontType);
else {
fonts = this.enumerator.EnumerateFonts(aLanguage, "", { });
if (fonts.length > 0)
defaultFont = this.enumerator.getDefaultFont(aLanguage, "");
}
if (!this._allFonts)
this._allFonts = this.enumerator.EnumerateAllFonts({});
// Build the UI for the Default Font and Fonts for this CSS type.
var popup = document.createElement("menupopup");
var separator;
if (fonts.length > 0) {
if (defaultFont) {
var bundlePreferences = document.getElementById("bundlePreferences");
var label = bundlePreferences.getFormattedString("labelDefaultFont", [defaultFont]);
var menuitem = document.createElement("menuitem");
menuitem.setAttribute("label", label);
menuitem.setAttribute("value", ""); // Default Font has a blank value
popup.appendChild(menuitem);
separator = document.createElement("menuseparator");
popup.appendChild(separator);
}
for (var i = 0; i < fonts.length; ++i) {
menuitem = document.createElement("menuitem");
menuitem.setAttribute("value", fonts[i]);
menuitem.setAttribute("label", fonts[i]);
popup.appendChild(menuitem);
}
}
// Build the UI for the remaining fonts.
if (this._allFonts.length > fonts.length) {
// Both lists are sorted, and the Fonts-By-Type list is a subset of the
// All-Fonts list, so walk both lists side-by-side, skipping values we've
// already created menu items for.
var builtItem = separator ? separator.nextSibling : popup.firstChild;
var builtItemValue = builtItem ? builtItem.getAttribute("value") : null;
separator = document.createElement("menuseparator");
popup.appendChild(separator);
for (i = 0; i < this._allFonts.length; ++i) {
if (this._allFonts[i] != builtItemValue) {
menuitem = document.createElement("menuitem");
menuitem.setAttribute("value", this._allFonts[i]);
menuitem.setAttribute("label", this._allFonts[i]);
popup.appendChild(menuitem);
}
else {
builtItem = builtItem.nextSibling;
builtItemValue = builtItem ? builtItem.getAttribute("value") : null;
}
}
}
aMenuList.appendChild(popup);
},
};

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

@ -0,0 +1,72 @@
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
# 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 Firefox Preferences System.
#
# The Initial Developer of the Original Code is Ben Goodger.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Gervase Markham <gerv@gerv.net> (Logic)
# Ben Goodger <ben@mozilla.org>
#
# 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 gFontScalingDialog = {
init: function ()
{
sizeToContent();
},
onAccept: function ()
{
// Get value from the dialog to work out dpi
var horizSize = parseFloat(document.getElementById("horizSize").value);
var units = document.getElementById("units").value;
if (!horizSize || horizSize < 0) {
// We can't calculate anything without a proper value
window.arguments[0].newdpi = -1;
return true;
}
// Convert centimetres to inches.
// The magic number is allowed because it's a fundamental constant :-)
if (units == "centimetres")
horizSize /= 2.54;
// These shouldn't change, but you can't be too careful.
var horizBarLengthPx = document.getElementById("horizRuler").boxObject.width;
var horizDPI = parseInt(horizBarLengthPx) / horizSize;
// Average the two <shrug>.
window.arguments[0].newdpi = Math.round(horizDPI);
dump("*** intergoat = " + window.arguments[0].toSource() + "\n");
return true;
}
};

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

@ -0,0 +1,55 @@
<?xml version="1.0"?>
# 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, released
# March 31, 1998.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE dialog SYSTEM "chrome://mozapps/locale/preferences/fontscaling.dtd" >
<dialog id="FontScalingDialog"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&calibrateDialog.title;"
onload="gFontScalingDialog.init();"
ondialogaccept="gFontScalingDialog.onAccept();">
<script type="application/x-javascript" src="chrome://mozapps/content/preferences/fontscaling.js"/>
<vbox id="horizRuler" width="300" height="30" style="margin: 10px; margin-bottom: 0px">
<hbox height="10px" style="border-bottom: 1px solid black; border-left: 1px solid black; border-right: 1px solid black;"/>
<hbox height="10px" style="border-top: 1px solid black; border-left: 1px solid black; border-right: 1px solid black;"/>
</vbox>
<vbox align="center">
<description>&calibrate.instructions;</description>
<separator class="thin"/>
<hbox align="center">
<textbox id="horizSize" size="5"/>
<menulist id="units" persist="value">
<menupopup>
<menuitem value="inches" label="&units.inches;"/>
<menuitem value="centimetres" label="&units.centimetres;"/>
</menupopup>
</menulist>
</hbox>
</vbox>
<separator/>
</dialog>

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

@ -0,0 +1,95 @@
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
# 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 Firefox Preferences System.
#
# The Initial Developer of the Original Code is Ben Goodger.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Ben Goodger <ben@mozilla.org>
#
# 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 gOCSPDialog = {
_certDB : null,
_OCSPResponders : null,
init: function ()
{
this._certDB = Components.classes["@mozilla.org/security/x509certdb;1"]
.getService(Components.interfaces.nsIX509CertDB);
this._OCSPResponders = this._certDB.getOCSPResponders();
var signingCA = document.getElementById("signingCA");
const nsIOCSPResponder = Components.interfaces.nsIOCSPResponder;
for (var i = 0; i < this._OCSPResponders.length; ++i) {
var ocspEntry = this._OCSPResponders.queryElementAt(i, nsIOCSPResponder);
var menuitem = document.createElement("menuitem");
menuitem.setAttribute("value", ocspEntry.responseSigner);
menuitem.setAttribute("label", ocspEntry.responseSigner);
signingCA.firstChild.appendChild(menuitem);
}
var signingCAPref = document.getElementById("security.OCSP.signingCA");
if (!signingCAPref.hasUserValue)
signingCA.selectedIndex = 0;
else {
// We need to initialize manually since auto-initialization is often
// called prior to menulist population above.
signingCA.value = signingCAPref.value;
}
this.chooseServiceURL();
},
_updateUI: function ()
{
var signingCA = document.getElementById("security.OCSP.signingCA");
var serviceURL = document.getElementById("security.OCSP.URL");
var securityOCSPEnabled = document.getElementById("security.OCSP.enabled");
var OCSPEnabled = parseInt(securityOCSPEnabled.value);
signingCA.disabled = serviceURL.disabled = OCSPEnabled == 0 || OCSPEnabled == 1;
return undefined;
},
chooseServiceURL: function ()
{
var signingCA = document.getElementById("signingCA");
var serviceURL = document.getElementById("serviceURL");
var CA = signingCA.value;
const nsIOCSPResponder = Components.interfaces.nsIOCSPResponder;
for (var i = 0; i < this._OCSPResponders.length; ++i) {
var ocspEntry = this._OCSPResponders.queryElementAt(i, nsIOCSPResponder);
if (CA == ocspEntry.responseSigner) {
serviceURL.value = ocspEntry.serviceURL;
break;
}
}
},
};

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

@ -0,0 +1,96 @@
<?xml version="1.0"?>
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
# 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 Firefox Preferences System.
#
# The Initial Developer of the Original Code is Ben Goodger.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Ben Goodger <ben@mozilla.org>
#
# 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 *****
<?xml-stylesheet href="chrome://global/skin/"?>
<!DOCTYPE prefwindow [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
<!ENTITY % ocspDTD SYSTEM "chrome://toolkit/locale/mozapps/preferences/ocsp.dtd">
%brandDTD;
%ocspDTD;
]>
<prefwindow id="OCSPDialog" type="child"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
dlgbuttons="accept,cancel"
title="&ocspDialog.title;"
style="width: 38em !important;">
<prefpane id="OCSPDialogPane" onpaneload="gOCSPDialog.init();">
<script type="application/x-javascript" src="chrome://toolkit/content/mozapps/preferences/ocsp.js"/>
<preferences>
<preference id="security.OCSP.enabled" name="security.OCSP.enabled" type="int"/>
<preference id="security.OCSP.signingCA" name="security.OCSP.signingCA" type="string"/>
<preference id="security.OCSP.URL" name="security.OCSP.URL" type="string"/>
</preferences>
<description>&validation.ocsp.description;</description>
<radiogroup id="securityOCSPEnabled" preference="security.OCSP.enabled"
onpreferenceread="return gOCSPDialog._updateUI();">
<radio value="0" label="&disableOCSP.label;"/>
<radio value="1" label="&certOCSP.label;"/>
<radio value="2" label="&proxyOCSP.label;"/>
<grid class="indent" flex="1">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row align="center">
<label value="&signingCA.label;" accesskey="&signingCA.accesskey;" control="signingCA"/>
<hbox id="signingCABox" flex="1">
<menulist id="signingCA" flex="1"
preference="security.OCSP.signingCA"
oncommand="gOCSPDialog.chooseServiceURL()">
<menupopup/>
</menulist>
</hbox>
</row>
<row align="center">
<label value="&serviceURL.label;" accesskey="&serviceURL.accesskey;" control="serviceURL"/>
<textbox id="serviceURL" preference="security.OCSP.URL"/>
</row>
</rows>
</grid>
</radiogroup>
<separator/>
</prefpane>
</prefwindow>

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

@ -0,0 +1,5 @@
filefield {
-moz-binding: url("chrome://mozapps/content/preferences/preferences.xml#fileField");
}

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

@ -0,0 +1,83 @@
<?xml version="1.0"?>
<bindings id="PreferencesSkinBindings"
xmlns="http://www.mozilla.org/xbl"
xmlns:xbl="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<binding id="fileField">
<content>
<xul:stringbundle anonid="bundle" src="chrome://mozapps/locale/preferences/preferences.properties"/>
<xul:hbox class="fileFieldContentBox" align="center" flex="1">
<xul:image class="fileFieldIcon" xbl:inherits="src=image"/>
<xul:textbox class="fileFieldLabel" xbl:inherits="value=label,disabled" flex="1" readonly="true"/>
</xul:hbox>
</content>
<implementation>
<property name="image" onget="return this.getAttribute('image');"
onset="this.setAttribute('image', val); return val;"/>
<property name="label" onget="return this.getAttribute('label');">
<setter>
this.setAttribute('label', val);
var elt = document.getAnonymousElementByAttribute(this, "class", "fileFieldLabel");
return (elt.value = val);
</setter>
</property>
<field name="_file">null</field>
<property name="file" onget="return this._file">
<setter>
<![CDATA[
this._file = val;
if (val) {
this.image = this._getIconURLForFile(val);
this.label = this._getDisplayNameForFile(val);
}
else {
this.removeAttribute("image");
var bundle = document.getAnonymousElementByAttribute(this, "anonid", "bundle");
this.label = bundle.getString("downloadHelperNoneSelected");
}
return val;
]]>
</setter>
</property>
<property name="disabled" onget="return this.getAttribute('disabled');"
onset="this.setAttribute('disabled', val); return val;"/>
<method name="_getDisplayNameForFile">
<parameter name="aFile"/>
<body>
<![CDATA[
#ifdef XP_WIN
var lfw = aFile.QueryInterface(Components.interfaces.nsILocalFileWin);
return lfw.getVersionInfoField("FileDescription");
#else
// XXXben - Read the bundle name on OS X.
var ios = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
var url = ios.newFileURI(aFile).QueryInterface(Components.interfaces.nsIURL);
return url.fileName;
#endif
]]>
</body>
</method>
<method name="_getIconURLForFile">
<parameter name="aFile"/>
<body>
<![CDATA[
if (!aFile)
return "";
var ios = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
var fph = ios.getProtocolHandler("file")
.QueryInterface(Components.interfaces.nsIFileProtocolHandler);
var urlspec = fph.getURLSpecFromFile(aFile);
return "moz-icon://" + urlspec + "?size=16";
]]>
</body>
</method>
</implementation>
</binding>
</bindings>

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

@ -0,0 +1,86 @@
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
# 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 Firefox Preferences System.
#
# The Initial Developer of the Original Code is Google Inc.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Ben Goodger <ben@mozilla.org>
#
# 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 gRemovePasswordDialog = {
_token : null,
_bundle : null,
_prompt : null,
_okButton : null,
_password : null,
init: function ()
{
this._prompt = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
this._bundle = document.getElementById("bundlePreferences");
this._okButton = document.documentElement.getButton("accept")
this._okButton.label = this._bundle.getString("pw_remove_button");
this._password = document.getElementById("password");
var pk11db = Components.classes["@mozilla.org/security/pk11tokendb;1"]
.getService(Components.interfaces.nsIPK11TokenDB);
this._token = pk11db.getInternalKeyToken();
// Initialize the enabled state of the Remove button by checking the
// initial value of the password ("" should be incorrect).
this.validateInput();
},
validateInput: function ()
{
this._okButton.disabled = !this._token.checkPassword(this._password.value);
},
removePassword: function ()
{
if (this._token.checkPassword(this._password.value)) {
this._token.changePassword(this._password.value, "");
this._prompt.alert(window,
this._bundle.getString("pw_change_success_title"),
this._bundle.getString("pw_erased_ok")
+ " " + this._bundle.getString("pw_empty_warning"));
}
else {
this._password.value = "";
this._password.focus();
this._prompt.alert(window,
this._bundle.getString("pw_change_failed_title"),
this._bundle.getString("incorrect_pw"));
}
},
};

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

@ -0,0 +1,38 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE dialog [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
<!ENTITY % removempDTD SYSTEM "chrome://mozapps/locale/preferences/removemp.dtd" >
%brandDTD;
%removempDTD;
]>
<dialog id="removemp" title="&removePassword.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
style="width: 35em;"
ondialogaccept="gRemovePasswordDialog.removePassword();"
onload="gRemovePasswordDialog.init()">
<script type="application/x-javascript" src="chrome://mozapps/content/preferences/removemp.js"/>
<stringbundle id="bundlePreferences" src="chrome://mozapps/locale/preferences/preferences.properties"/>
<description>&removeWarning1.label;</description>
<description class="header">&removeWarning2.label;</description>
<separator class="thin"/>
<groupbox>
<caption label="&removeInfo.label;"/>
<hbox align="center">
<label value="&setPassword.oldPassword.label;"/>
<textbox id="password" type="password" oninput="gRemovePasswordDialog.validateInput();"/>
</hbox>
</groupbox>
<separator/>
</dialog>