233 lines
8.4 KiB
XML
233 lines
8.4 KiB
XML
<?xml version="1.0"?>
|
|
|
|
<!--
|
|
The contents of this file are subject to the Netscape 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/NPL/
|
|
|
|
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-1999 Netscape Communications Corporation. All
|
|
Rights Reserved.
|
|
|
|
Contributor(s):
|
|
-->
|
|
|
|
<!DOCTYPE window SYSTEM "chrome://wallet/locale/walletTasksOverlay.dtd">
|
|
|
|
<overlay id="walletTasksOverlay"
|
|
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
|
|
|
<script type="application/x-javascript" src="chrome://wallet/content/walletOverlay.js"/>
|
|
|
|
<script type="application/x-javascript">
|
|
<![CDATA[
|
|
|
|
function CheckForEncrypt() {
|
|
// remove either encrypt or obscure depending on pref setting
|
|
var elementOn, elementOff;
|
|
var pref;
|
|
pref = Components.classes['@mozilla.org/preferences-service;1'];
|
|
pref = pref.getService();
|
|
pref = pref.QueryInterface(Components.interfaces.nsIPrefBranch);
|
|
try {
|
|
if (pref.getBoolPref("wallet.crypto")) {
|
|
elementOn = document.getElementById("obscure");
|
|
elementOff = document.getElementById("encrypt");
|
|
} else {
|
|
elementOn = document.getElementById("encrypt");
|
|
elementOff = document.getElementById("obscure");
|
|
}
|
|
elementOn.setAttribute("disabled","false");
|
|
elementOff.setAttribute("disabled","true");
|
|
} catch(e) {
|
|
var encrypt = document.getElementById("encrypt");
|
|
if(encrypt) {
|
|
encrypt.setAttribute("disabled", "true");
|
|
}
|
|
var obscure = document.getElementById("obscure");
|
|
if(obscure) {
|
|
obscure.setAttribute("disabled", "true");
|
|
}
|
|
dump("wallet.crypto pref is missing from all.js\n");
|
|
}
|
|
}
|
|
|
|
// perform a wallet action
|
|
function WalletAction( action ) {
|
|
var wallet = Components.classes['@mozilla.org/wallet/wallet-service;1'];
|
|
wallet = wallet.getService();
|
|
wallet = wallet.QueryInterface(Components.interfaces.nsIWalletService);
|
|
var strings = document.getElementById("personalManagers");
|
|
|
|
var pref;
|
|
pref = Components.classes['@mozilla.org/preferences-service;1'];
|
|
pref = pref.getService();
|
|
pref = pref.QueryInterface(Components.interfaces.nsIPrefBranch);
|
|
|
|
switch( action ) {
|
|
case "password":
|
|
if (!wallet.WALLET_ChangePassword()) {
|
|
window.alert(strings.getAttribute("PasswordNotChanged"));
|
|
}
|
|
break;
|
|
case "expire":
|
|
if (wallet.WALLET_ExpirePassword()) {
|
|
window.alert(strings.getAttribute("PasswordExpired"));
|
|
} else {
|
|
window.alert(strings.getAttribute("PasswordNotExpired"));
|
|
}
|
|
break;
|
|
case "clear":
|
|
|
|
var pipNSSBundle = document.getElementById("bundle_pipnss");
|
|
var tokenName = pipNSSBundle.getString("InternalToken");
|
|
window.open("chrome://pippki/content/resetpassword.xul",
|
|
tokenName,
|
|
"centerscreen,chrome,resizable=1,modal=1,dialog=1");
|
|
break;
|
|
case "encrypt":
|
|
if (pref) {
|
|
wallet.WALLET_InitReencryptCallback(window._content);
|
|
pref.setBoolPref("wallet.crypto", true);
|
|
}
|
|
break;
|
|
case "obscure":
|
|
if (pref) {
|
|
wallet.WALLET_InitReencryptCallback(window._content);
|
|
pref.setBoolPref("wallet.crypto", false);
|
|
}
|
|
break;
|
|
/*
|
|
case "safefill":
|
|
formPrefill();
|
|
break;
|
|
case "quickfill":
|
|
formQuickPrefill();
|
|
break;
|
|
case "capture":
|
|
formCapture();
|
|
walletService.WALLET_RequestToCapture(window._content);
|
|
break;
|
|
*/
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
// display a Wallet Dialog
|
|
function WalletDialog(which) {
|
|
switch( which ) {
|
|
case "signon":
|
|
window.openDialog("chrome://communicator/content/wallet/SignonViewer.xul",
|
|
"_blank","chrome,resizable=yes","S");
|
|
break;
|
|
case "samples":
|
|
window._content.location.href = 'chrome://communicator/locale/wallet/index.html';
|
|
break;
|
|
case "walletsites":
|
|
window.openDialog("chrome://communicator/content/wallet/SignonViewer.xul",
|
|
"_blank","chrome,resizable=no","W");
|
|
break;
|
|
case "wallet":
|
|
default:
|
|
formShow();
|
|
break;
|
|
}
|
|
}
|
|
|
|
]]>
|
|
</script>
|
|
|
|
<!-- tasksOverlay menu items -->
|
|
<menupopup id="personalManagers"
|
|
PasswordNotChanged = "&PasswordNotChanged;"
|
|
PasswordExpired = "&PasswordExpired;"
|
|
PasswordNotExpired = "&PasswordNotExpired;"
|
|
AllDataWillBeCleared = "&AllDataWillBeCleared;"
|
|
UnableToCapture = "&UnableToCapture;"
|
|
Captured = "&Captured;"
|
|
NotCaptured = "&NotCaptured;"
|
|
noPrefills = "&noPrefills;">
|
|
<menu label="&walletPasswordManager.label;"
|
|
accesskey="&walletPasswordManager.accesskey;"
|
|
position="1">
|
|
<menupopup onpopupshowing="CheckForEncrypt()">
|
|
<menuitem label="&walletDisplaySignonsCmd.label;"
|
|
accesskey="&walletDisplaySignonsCmd.accesskey;"
|
|
oncommand="WalletDialog('signon');"/>
|
|
<menuitem label="&walletChangePasswordCmd.label;"
|
|
accesskey="&walletChangePasswordCmd.accesskey;"
|
|
oncommand="WalletAction('password');"/>
|
|
<menuitem label="&walletExpirePasswordCmd.label;"
|
|
accesskey="&walletExpirePasswordCmd.accesskey;"
|
|
oncommand="WalletAction('expire');"/>
|
|
<menuseparator/>
|
|
<menuitem label="&walletEncryptCmd.label;"
|
|
id="encrypt"
|
|
accesskey="&walletEncryptCmd.accesskey;"
|
|
oncommand="WalletAction('encrypt');"/>
|
|
<menuitem label="&walletObscureCmd.label;"
|
|
id="obscure"
|
|
accesskey="&walletObscureCmd.accesskey;"
|
|
oncommand="WalletAction('obscure');"/>
|
|
<menuitem label="&walletClearCmd.label;"
|
|
id="clear"
|
|
accesskey="&walletClearCmd.accesskey;"
|
|
oncommand="WalletAction('clear');"/>
|
|
</menupopup>
|
|
</menu>
|
|
<menu label="&walletFormManager.label;"
|
|
accesskey="&walletFormManager.accesskey;"
|
|
id="wallet"
|
|
position="2">
|
|
<menupopup>
|
|
<menuitem label="&walletContentsCmd.label;"
|
|
accesskey="&walletContentsCmd.accesskey;"
|
|
id="walleteditor"
|
|
oncommand="WalletDialog('wallet');"/>
|
|
<menuitem label="&walletSitesCmd.label;"
|
|
accesskey="&walletSitesCmd.accesskey;"
|
|
id="walletsites"
|
|
oncommand="WalletDialog('walletsites');"/>
|
|
<!--
|
|
<menuseparator/>
|
|
<menuitem label="&walletSafeFillCmd.label;"
|
|
accesskey="&walletSafeFillCmd.accesskey;"
|
|
id="walletSafeFill"
|
|
oncommand="WalletAction('safefill');"/>
|
|
<menuitem label="&walletQuickFillCmd.label;"
|
|
accesskey="&walletQuickFillCmd.accesskey;"
|
|
id="walletQuickFill"
|
|
oncommand="WalletAction('quickfill');"/>
|
|
<menuitem label="&walletRequestToCaptureCmd.label;"
|
|
accesskey="&walletRequestToCaptureCmd.accesskey;"
|
|
id="walletCapture"
|
|
oncommand="WalletAction('capture');"/>
|
|
<menuseparator/>
|
|
<menuitem label="&walletSamplesCmd.label;"
|
|
accesskey="&walletSamplesCmd.accesskey;"
|
|
id="walletSamples"
|
|
oncommand="WalletDialog('samples');"/>
|
|
-->
|
|
</menupopup>
|
|
</menu>
|
|
</menupopup>
|
|
|
|
<stringbundleset id="stringbundleset">
|
|
<stringbundle id="bundle_pipnss"
|
|
src="chrome://pipnss/locale/pipnss.properties"/>
|
|
</stringbundleset>
|
|
|
|
|
|
</overlay>
|